From: Trevor Gross <tg@trevorgross.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-man@vger.kernel.org, libc-alpha@sourceware.org,
musl@lists.openwall.com, Trevor Gross <tg@trevorgross.com>
Subject: [PATCH 2/2] man/man2/fork.2: Document glibc and musl relaxed fork->exec AS requirements
Date: Wed, 23 Sep 2026 23:38:19 +0000 [thread overview]
Message-ID: <20260923233818.25289-3-tg@trevorgross.com> (raw)
In-Reply-To: <44aca4d502f6891df1587ed1c4c9b6a1@trevorgross.com>
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)
next prev parent reply other threads:[~2026-09-23 23:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 0:53 async-signal-safety of chroot tg
2026-09-23 1:34 ` [musl] " Rich Felker
2026-09-23 4:17 ` John Scott
2026-09-23 4:40 ` [musl] " Rich Felker
2026-09-23 8:38 ` Florian Weimer
2026-09-23 23:21 ` Trevor Gross
2026-09-24 0:34 ` Trevor Gross
2026-09-24 2:12 ` [musl] " Rich Felker
2026-09-24 9:21 ` Florian Weimer
2026-09-23 23:38 ` [PATCH 1/2] man/man2/chroot.2: Document that chroot is AS-safe Trevor Gross
2026-09-23 23:38 ` Trevor Gross [this message]
2026-09-23 23:47 ` [musl] [PATCH 2/2] man/man2/fork.2: Document glibc and musl relaxed fork->exec AS requirements Rich Felker
2026-09-25 19:54 ` Florian Weimer
2026-10-02 6:50 ` Trevor Gross
2026-10-03 20:48 ` Gabriel Ravier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260923233818.25289-3-tg@trevorgross.com \
--to=tg@trevorgross.com \
--cc=alx@kernel.org \
--cc=libc-alpha@sourceware.org \
--cc=linux-man@vger.kernel.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox