Share fd: When you share a file descriptor over a socket, the kernel mediates. You need to prepare data using the cmsg(3)
macros, send it using sendmsg(2)
and receive it using recvmsg(2)
. The kernel is involved in the latter two operations, and it handles the conversion from a file descriptor to whatever data it needs to transmit the file descriptor, and making the file descriptor available in the receiving process.