Can you pass a file descriptor to another process?
Can you pass a file descriptor to another process?
- Subject: Can you pass a file descriptor to another process?
- From: James Bucanek <email@hidden>
- Date: Wed, 20 Aug 2014 13:49:59 -0700
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 have a helper process that's started (indirectly) via launchd. I'm now
writing a command line tool to control it. At some point I'd like to
redirect the helper's output to the file descriptor of the tool's
stdout/stderr. In other words, I want to command line tool to tell the
the helper to do something useful, and then have the helper's output
sent to the same stdout the tool is connected to.
A little research says this should be possible using ioctl() and the
I_SENDFD and I_RECVFD commands, but I cannot find these command symbols
in the OS X frameworks. (Well, there's one in OpenTransportProtocol.h,
but I'm pretty sure we're not supposed to be using that.)
So let me start by asking if this is even possible in OS X/Darwin.
James
_______________________________________________
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