[PATCH 2/2] man/man2/fork.2: Document glibc and musl relaxed fork->exec AS requirements

Trevor Gross tg@trevorgross.com
Wed Sep 23 23:38:19 GMT 2026


Link: https://lore.kernel.org/linux-man/20260923013428.GT23438@brightrain.aerifal.cx/ [1]
Link: https://git.musl-libc.org/cgit/musl/commit/?id=167390f05564e0a4d3fcb4329377fd7743267560
Signed-off-by: Trevor Gross <tg@trevorgross.com>
---
 man/man2/fork.2 | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/man/man2/fork.2 b/man/man2/fork.2
index fc78f786b..336c17448 100644
--- a/man/man2/fork.2
+++ b/man/man2/fork.2
@@ -147,10 +147,17 @@ may be helpful for dealing with problems that this can cause.
 After a
 .BR fork ()
 in a multithreaded program,
-the child can safely call only async-signal-safe functions (see
+POSIX specifies that the child can safely call only async-signal-safe
+functions (see
 .BR signal\-safety (7))
-until such time as it calls
+until it calls
 .BR execve (2).
+On glibc and musl libc, this is relaxed;
+it is safe to call non-async-signal-safe functions in the time between
+.BR fork ()
+and
+.BR exec ()
+\&.
 .IP \[bu]
 The child inherits copies of the parent's set of open file descriptors.
 Each file descriptor in the child refers to the same
-- 
2.50.1 (Apple Git-155)



More information about the Libc-alpha mailing list