[Bug 214871] New: Man(3) system outdated
Adhemerval Zanella
adhemerval.zanella@linaro.org
Tue Nov 2 11:37:41 GMT 2021
On 02/11/2021 06:58, Alejandro Colomar (man-pages) via Libc-alpha wrote:
> Hi Adhemerval, Michael,
>
> On 11/1/21 13:06, zatrazz wrote:
>> Hi Alejandro,
>>
>> Indeed we changed glibc to use posix_spawn on system and popen on 2.29 since
>> to use posix_spawn (which uses clone (CLONE_VFORK | CLONE_VM)). It plays
>> way better with Linux memory subsystem than fork() + exec() specially when such
>> calls are used with process with large RSS.
>
> I applied the following patch. I'll close the bug.
>
> Thanks,
>
> Alex
I forgot to add that neither system(), posix_spawn(), nor popen() call
atfork handlers [1]. POSIX recently changed their description to make
it implementation-defined instead of unspecified [2], so I think it
is worth to change that is not really behave as called by fork() (since
it will run atfork handlers).
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=17490
[2] https://www.austingroupbugs.net/view.php?id=1317
>
> ---
> system.3: It doesn't call fork anymore
>
> Reported-by: Michael Kearney <mikekearney85@hotmail.com>
> Cc: Adhemerval Zanella <zatrazz@gmail.com>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>
> diff --git a/man3/system.3 b/man3/system.3
> index 880fe93c6..bde45ed82 100644
> --- a/man3/system.3
> +++ b/man3/system.3
> @@ -40,9 +40,9 @@ system \- execute a shell command
> .SH DESCRIPTION
> The
> .BR system ()
> -library function uses
> +library function behaves as if it used
> .BR fork (2)
> -to create a child process that executes the shell command specified in
> +to create a child process that executed the shell command specified in
> .I command
> using
> .BR execl (3)
>
>
>
More information about the Libc-alpha
mailing list