[Swan-dev] use vfork/exec

Paul Wouters paul at nohats.ca
Fri Oct 16 20:56:32 UTC 2015


On Fri, 16 Oct 2015, Andrew Cagney wrote:

> I'd like to float the idea of simplifying pluto a little by
> unconditionally using vfork/exec.

Sounds good to me.

> I should note that vfork() comes with caveats.  Other than exec() and
> exit() there's really not much else that is allowed between the
> vfork() and exec() calls.  The above, which calls sleep() and printf()
> is likely wrong and I'd need to fix it.

The debug printing can easilly be moved.

The sleep was there to ensure the parent had continued, and when the
addconn fork is calling the parent on the socket in /var/run, there
is something listening. If that is actually needed, we could add it
as an option to addconn to pause for one second there.

Paul


More information about the Swan-dev mailing list