]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
clone.2: Warn that the clone() wrapper modifies child_stack in the parent
authorMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 17 Oct 2017 20:24:49 +0000 (22:24 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 17 Oct 2017 20:24:49 +0000 (22:24 +0200)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/clone.2

index 8a46184d40d8223b47afd1c290f8dffce306fce9..4fd56d21c61d3977cfb2043467c24747d573a554 100644 (file)
@@ -809,6 +809,22 @@ Memory writes or file mappings/unmappings performed by one of the
 processes do not affect the other, as with
 .BR fork (2).
 .SH NOTES
+Note that the glibc
+.BR clone ()
+wrapper function makes some changes
+in the memory pointed to by
+.I child_stack
+(changes required to set the stack up correctly for the child)
+.I before
+invoking the
+.BR clone ()
+system call.
+So, in cases where
+.BR clone ()
+is used to recursively create children,
+do not use the buffer employed for the parent's stack
+as the stack of the child.
+.\"
 .SS C library/kernel differences
 The raw
 .BR clone ()