"Brent W. Baccala" <cos...@freesoft.org> writes:
> What is the best way to fork() a child and have a Mach receive right on the
> parent connected to a send right on the child?  Or vice versa?

There is no easy and obvious way that I know.  Basically, you need to
insert the send right into the other task, then communicate the name.

If you are looking to do that across fork/exec, take a look at the
startup server to see how to replace fork/exec with
task_create/file_exec.  If you do that, you can communicate the port
name using the argument vector.  We do that e.g. to give the bootstrap
filesystem the privileged kernel ports.

One other idea that comes to mind is to install the send right as one of
the special ports (e.g. the bootstrap port), and hope that it is copied
during fork(2).  You need to read the fork implementation to see what it
does.


Cheers,
Justus

Attachment: signature.asc
Description: PGP signature

Reply via email to