Re: Piping capability communication, data vs. descriptor capability strengths
| Newsgroups | gmane.comp.capabilities.general,gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
Jed Donnelley <capability-iCFHVraI1K1Wk0Htik3J/[email protected]> writes > Even in Unix I've heard that open file descriptors can be sent > through a pipe. If that's so, what's the syntax (e.g. as above) look > like? How are the descriptors sent and received specified (by the > sender on sending and by the OS on receiving to the receiver)? You can send descriptors as seen in "Advanced Programming in the Unix Environment" section 15.3. which uses ioctl() with I_SENDFD . http://opengroup.org/onlinepubs/007908799/xsh/ioctl.html The sender already has the descriptor it's sending and refers to it by number (small integer) and ioctl() produces from that a value related to kernel tables that will be meaningful to an ioctl() with I_REVCFD in the receiving program. I've never done that - normally when I set up one pipe between a pair of processes I can set up two. You'd rarely pass a descriptor to a program you call directly and I don't think there's any shell pipeline syntax to do so.