Skip to content
  • Jonas Termansen's avatar
    Implement file descriptor passing. · 3c43f710
    Jonas Termansen authored
    This change refactors the Unix socket / pipe backend to have a ring buffer
    containing segments, where each segment has an optional leading ancillary
    buffer containing control messages followed by a normal data buffer.
    
    The SCM_RIGHTS control message has been implemented which transfers file
    descriptors to the receiving process. File descriptors are reference counted
    and cycles are prevented using the following restrictions:
    
    1) Unix sockets cannot be sent on themselves (on either end).
    2) Unix sockets themselves being sent cannot be sent on.
    3) Unix sockets cannot send a Unix socket being sent on.
    
    This is a compatible ABI change.
    3c43f710