Linux Manual Pages development
 help / color / mirror / Atom feed
* async-signal-safety of chroot
@ 2026-09-23  0:53 tg
  2026-09-23  1:34 ` [musl] " Rich Felker
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: tg @ 2026-09-23  0:53 UTC (permalink / raw)
  To: linux-man, musl, libc-alpha

Hi everyone,

Is `chroot` async-signal-safe?

It is a somewhat popular pattern to `fork`, `chroot`, then `exec`.
However, only AS-safe functions may be called between `fork` and `exec`
(stated at [1]) but the manual entry for `chroot` makes no such mention
[2]. signal-safety(7) [3] only covers POSIX, so it is also not listed
there.

The rather old POSIX edition that last specified chroot also does not
mark it AS-safe [4], [5].

Is code using this pattern buggy, or is it just missing documentation?
I expect it's the latter but it would be nice to confirm either way.

Thanks,
Trevor

[1]: https://man7.org/linux/man-pages/man2/fork.2.html
[2]: https://man7.org/linux/man-pages/man2/chroot.2.html
[3]: https://man7.org/linux/man-pages/man7/signal-safety.7.html
[4]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/chroot.html
[5]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/sigaction.html

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-10-03 20:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox