• 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
Can you pass a file descriptor to another process?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Can you pass a file descriptor to another process?
      • From: Mark Day <email@hidden>
    • Re: Can you pass a file descriptor to another process?
      • From: Ken Hornstein <email@hidden>
    • Re: Can you pass a file descriptor to another process?
      • From: Chris Suter <email@hidden>
  • Prev by Date: Re: Crash in Core Backup or Launch Services?
  • Next by Date: Re: Can you pass a file descriptor to another process?
  • Previous by thread: Re: Crash in Core Backup or Launch Services?
  • Next by thread: Re: Can you pass a file descriptor to another process?
  • Index(es):
    • Date
    • Thread