• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can you pass a file descriptor to another process?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Can you pass a file descriptor to another process?
      • From: James Bucanek <email@hidden>
References: 
 >Can you pass a file descriptor to another process? (From: James Bucanek <email@hidden>)

  • Prev by Date: Re: Can you pass a file descriptor to another process?
  • Next by Date: Re: Can you pass a file descriptor to another process?
  • Previous by thread: Re: Can you pass a file descriptor to another process?
  • Next by thread: Re: Can you pass a file descriptor to another process?
  • Index(es):
    • Date
    • Thread