I was checking code of sendmsg system call for AF_UNIX socket, there I find one function: wait_for_unix_gc ( a garbage collector of inflight sockets). Can anyone brief what these inflight sockets are?

Kernel File: linux/net/unix/garbage.c


Just copy from Unix network programming V1: Chapter 15.7

The sending process builds a msghdr structure (Section 14.5) containing the descriptor to be passed. POSIX specifies that the descriptor be sent as ancillary data (the msg_control member of the msghdr structure, Section 14.6), but older implementations use the msg_accrights member. The sending process calls sendmsg to send the descriptor across the Unix domain socket from Step 1. At this point, we say that the descriptor is "in flight." Even if the sending process closes the descriptor after calling sendmsg, but before the receiving process calls recvmsg (in the next step), the descriptor remains open for the receiving process. Sending a descriptor increments the descriptor's reference count by one.

  • Is'nt it a description for in flight descriptor??? rather than in flight sockets... but anyway can we guess similar concept for in flight socket?? thanks for answering – Saturn Sep 7 '16 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.