[PATCH 1/2] posix_spawn.3: Document implementation using clone() since glibc 2.24

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

 



Since glibc 2.24, the use of posix_spawn (2) makes an unconditional call
to clone(CLONE_VM | CLONE_VFORK ...) rather than relying on fork (2) or
vfork (2).

As a consequence, the statements regarding the use of the flag
POSIX_SPAWN_USEVFORK and how the function decides whether it should use
fork (2) or vfork (2) are obsolete since this glibc 2.24.

This patch makes a distinction in the manual page between glibc 2.24 and
older versions.

Upstream commit in glibc.git:

  9ff72da471 posix: New Linux posix_spawn{p} implementation

Signed-off-by: Olivier Gayot <olivier.gayot@xxxxxxxxxxx>
---
 man3/posix_spawn.3 | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/man3/posix_spawn.3 b/man3/posix_spawn.3
index 3e1e9011c..9cc5a63d5 100644
--- a/man3/posix_spawn.3
+++ b/man3/posix_spawn.3
@@ -155,9 +155,16 @@ and the
 .BR exec ()
 step (executed in the child).
 .SS fork() step
-The
+Since glibc 2.24, the
 .BR posix_spawn ()
 function commences by calling
+.BR clone (2)
+with
+.BR CLONE_VM
+and
+.BR CLONE_VFORK
+flags.
+Older implementations use
 .BR fork (2),
 or possibly
 .BR vfork (2)
@@ -176,7 +183,7 @@ If the child fails in any of the housekeeping steps described below,
 or fails to execute the desired file,
 it exits with a status of 127.
 .PP
-The child process is created using
+Before glibc 2.24, the child process is created using
 .BR vfork (2)
 instead of
 .BR fork (2)
@@ -480,14 +487,16 @@ The
 and
 .BR posix_spawnp ()
 functions fail only in the case where the underlying
-.BR fork (2)
-or
+.BR fork (2),
 .BR vfork (2)
+or
+.BR clone (2)
 call fails;  in these cases, these functions return an error number,
 which will be one of the errors described for
-.BR fork (2)
+.BR fork (2),
+.BR vfork (2)
 or
-.BR vfork (2).
+.BR clone (2).
 .PP
 In addition, these functions fail if:
 .TP
-- 
2.19.1




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux