I\'m seeing a couple strange things with a pair of AF_UNIX sockets created by a call such as:
socketpair(AF_UNIX, SOCK_STREAM, 0, sfd);
W
Take a look at the socket(7) man page. There is a section that reads:
SO_SNDBUF Sets or gets the maximum socket send buffer in bytes. The kernel doubles this value (to allow space for bookkeeping overhead) when it is set using setsockopt(2), and this doubled value is returned by getsockopt(2). The default value is set by the /proc/sys/net/core/wmem_default file and the maximum allowed value is set by the /proc/sys/net/core/wmem_max file. The minimum (doubled) value for this option is 2048.
So it appears that the overhead is simply to hold bookkeeping information for the Kernel.