Linux Manual Pages development
 help / color / mirror / Atom feed
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 1/2] man/man2/chroot.2: Document that chroot is AS-safe
Date: Wed, 23 Sep 2026 23:38:18 +0000	[thread overview]
Message-ID: <20260923233818.25289-2-tg@trevorgross.com> (raw)
In-Reply-To: <44aca4d502f6891df1587ed1c4c9b6a1@trevorgross.com>

As discussed at [1], this is an async-signal-safe syscall wrapper.

Link: https://lore.kernel.org/linux-man/5db76d666377410fc105b9d527cbcd9f9ef3b332.camel@posteo.net/T/#t [1]
Signed-off-by: Trevor Gross <tg@trevorgross.com>
---
 man/man2/chroot.2        |  4 ++++
 man/man7/signal-safety.7 | 10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/man/man2/chroot.2 b/man/man2/chroot.2
index fa579eb83..4372ab9c7 100644
--- a/man/man2/chroot.2
+++ b/man/man2/chroot.2
@@ -150,6 +150,10 @@ inherits its parent's root directory.
 The root directory is left unchanged by
 .BR execve (2).
 .P
+.BR chroot()
+is async-signal-safe:
+it may be safely called within a signal handler.
+.P
 The magic symbolic link,
 .IR /proc/ pid /root ,
 can be used to discover a process's root directory;
diff --git a/man/man7/signal-safety.7 b/man/man7/signal-safety.7
index f63d37f75..73d716751 100644
--- a/man/man7/signal-safety.7
+++ b/man/man7/signal-safety.7
@@ -280,6 +280,16 @@ T}
 \f[B]write\f[](2)
 .TE
 .P
+Functions listed in the following table are not required to be
+async-signal-safe by POSIX, but are safe on Linux:
+.P
+.TS
+lb
+lw(24n) l.
+Function
+\f[B]chroot\f[](2)
+.TE
+.P
 Notes:
 .IP \[bu] 3
 POSIX.1-2001 and POSIX.1-2001 TC2 required the functions
-- 
2.50.1 (Apple Git-155)


  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 ` Trevor Gross [this message]
2026-09-23 23:38 ` [PATCH 2/2] man/man2/fork.2: Document glibc and musl relaxed fork->exec AS requirements Trevor Gross
2026-09-23 23:47   ` [musl] " 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-2-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