Subject: Re: Passing file descriptors between processes

From: [email-masked] (Frederick G.M. Roeber)
Date: Tue, 23 Mar 1993 13:04:47 +0100

>How does one pass an open file descriptor from one process to another?
>
>I heard that it might have to do with the msg_accrights field of the
>msghdr structure used by sendmsg(2), but I couldn't find anything in
>the man pages or the FAQs...  I could've sworn I'd seen this answered
>somewhere before, how do you do it?

Under BSD-type systems, this is how you do it.  Look at the recv(2) page.
Under SysV-type systems, there's a streamio(7) command (I_SENDFD).

Examples of both of these are available on the net, in the form of the
sample code of Stevens' book "Unix Network Programming."

One location for these examples is:
    ftp://ftp.uu.net/published/books/stevens.netprog.tar.Z

Or try archie for more.

Regards,
Frederick.

---

From: Barry Margolin <[email-masked]>
Date: Tue, 23 Mar 93 20:11:12 EST

In article <[email-masked]> you write:
>msghdr structure used by sendmsg(2),

You heard right.

>				      but I couldn't find anything in

It's answered in "Unix Network Programming" by W. Richard Stevens.
--
Barry Margolin
System Manager, Thinking Machines Corp.

[email-masked]          {uunet,harvard}!think!barmar