[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mach "pipe" between parent and child

From: Justus Winter
Subject: Re: Mach "pipe" between parent and child
Date: Wed, 26 Oct 2016 11:30:51 +0200

"Brent W. Baccala" <cosine@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


Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]