starlight | 8 Feb 02:13
Favicon

Re: suggestion for improvement to vfork() man page

At 12:04 PM 2/8/2012 +1300, Michael Kerrisk wrote:
>Hi,
>
>On Wed, Feb 8, 2012 at 10:50 AM,  <starlight@...> wrote:
>> +(However, on such systems,
>> +the preferred standard way of accomplishing the same result is to use
>> +.BR posix_spawn (3).)
>>
>> I'm not sure I agree on this.  Linux posix_spawn()
>> calls fork()
>
>I think isn't quite correct. I believe glibc's posix_spawn uses
>vfork() where it can. See sysdeps/posix/spawni.c::spawni().

Looked at glibc-2.9 and posix_spawn() uses
fork() in only when no process attibutes are
modified (i.e. it respects the AIX and Solaris
semantics of vfork though this is a bit irrelevent
since AIX and Solaris have kernel-native support
for posix_spawn) or when a non-standard
POSIX_SPAWN_USEVFORK flag is present.  It's
rather muddy so I stick with #ifdef vfork()
for Linux and #ifdef posix_spawn() for the
*nixes.

>
>So, I'll change that last sentence to
>
>[[
>(POSIX.1-2008 removed vfork() from the standard; the POSIX rationale
(Continue reading)


Gmane