LinuxSA Mailing list archives
Index:
[thread]
[date]
[subject]
[author]
From: Greg Lehey <grog@lemis.com>
To : Daryl Tester <dt@picknowl.com.au>
Date: Sun, 30 Apr 2000 14:57:44 +0930
Passing file descriptors (was: Protecting files against power failure)
On Saturday, 29 April 2000 at 20:34:28 +0930, Daryl Tester wrote:
> David Newall wrote:
>
> [I originally wrote:]
>>> (although, of course, this shouldn't affect the shell's file
>>> descriptor - care to hazard a guess why?).
> [But later retracted after being enlightened with a hammer.]
>
>> File descriptors can be shared amongst different processes. Consider these
>> two command sequences:
>>
>> bash$ some-process < some-file & some-process < some-file
>> bash$ (some-process & some-process) < some-file
>
> File descriptors can be _inherited_ by child processes, as both your
> above examples show. They can't be passed to any arbitrary process.
I don't know about Linux, but UNIX can definitely pass file
descriptors. Rich Stevens goes into it in great detail in "Advanced
Programming in the UNIX environment", pages 479-490, but he doesn't
mention Linux. System V uses the I_SENDFD ioctl, whereas BSD uses an
obscure feature of sendmsg(2).
Greg
--
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers
--
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject
Index:
[thread]
[date]
[subject]
[author]
Return to the LinuxSA Mailing List Information Page