On Sat, Nov 26, 2011 at 11:35:29AM +0100, Samuel Thibault wrote:
> > (Naturally, the result would be non-portable for systems where fork==vfork,
> > but then maybe implementing vfork as fork is the bug? ;-))
> 
> It's what the norm says.

I think you meant the norm explicitely says vfork can be implemented as
fork.

> Now, about the problem you mention on the webpage, isn't it possible to
> use a semaphore to tell the hypervisor when the "just-forked" process
> has changed its signal handler for something that is fine with SIGTERM?
> Or use a signal back (IIRC Xorg does this). That would implement the
> "make father wait" in a portable way.

How about blocking signals until the child is actually able to handle
SIGTERM correctly ? POSIX clearly states signal masks are inherited on
forks. AIUI, this case doesn't need the parent to wait, only to avoid
the kill/exec race.

-- 
Richard Braun

Reply via email to