Re: Can you pass a file descriptor to another process?
Re: Can you pass a file descriptor to another process?
- Subject: Re: Can you pass a file descriptor to another process?
- From: Ken Hornstein <email@hidden>
- Date: Wed, 20 Aug 2014 18:19:35 -0400
>Random question of the week: Is it possible in OS X/Darwin to use
>ioctl() and the I_SENDFD/I_RECVFD commands to copy a file descriptor to
>another process?
I_SENDFD/I_RECVFD is really only a thing supported by STREAMS, as far
as I know. As others have pointed out, the more commonly-supported way
to do this is via sendmsg()/recvmsg(). I have personally done this on
MacOS X and it works fine. One big caveat: it is only supported over
a Unix domain socket. One minor caveat: the code is a pain, but there
are plenty of examples out there.
--Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden