• 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: Alternative to bootstrap_register?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alternative to bootstrap_register?


  • Subject: Re: Alternative to bootstrap_register?
  • From: Damien Sorresso <email@hidden>
  • Date: Wed, 18 Nov 2009 15:15:45 -0800

On Nov 18, 2009, at 1:54 PM, Godfrey van der Linden wrote:
> I'm not 100% sure but I think that your child process inherits or can be made to inherit the parents mach ports.

This only applies to task special ports (bootstrap port, exception port, etc.).

> So the trick I envisage is
>
> 1> Parent create a right and make it inheritable (?)
> 2> Parent calls fork
> 3> Parent waits on a message
> 4> Calls exec with an argument of the inherited port id in hex I'd guess
> and rendezvous can not happen
>
> This seems pretty reliable, if ports can be inherited across a fork() which is a big if.
>
> Finally if it doesn't work I know for a fact that it will work with unix-domain sockets.


There is the mach_ports_register() API, which stashes a bunch of ports so that a child task can obtain them with mach_ports_lookup(), but honestly, I don't even know if that works on our platform, and even if it does, a POSIX child process (created via fork(2)) may not necessarily be the same thing as Mach child process (created via task_create()).
--
Damien Sorresso
BSD Engineering
Apple Inc.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Alternative to bootstrap_register? (From: Uli Kusterer <email@hidden>)
 >Re: Alternative to bootstrap_register? (From: Damien Sorresso <email@hidden>)
 >Re: Alternative to bootstrap_register? (From: Uli Kusterer <email@hidden>)
 >Re: Alternative to bootstrap_register? (From: Godfrey van der Linden <email@hidden>)

  • Prev by Date: Re: gcc compiler error: "Ignoring attempt to re-define symbol"
  • Next by Date: Re: Alternative to bootstrap_register?
  • Previous by thread: Re: Alternative to bootstrap_register?
  • Next by thread: Finder tool rewritten in Cocoa
  • Index(es):
    • Date
    • Thread