This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author izbyshev
Recipients Yonatan Goldschmidt, gregory.p.smith, izbyshev, koobs, pablogsal, ronaldoussoren
Date 2020-10-24.19:12:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1603566762.74.0.687553303716.issue35823@roundup.psfhosted.org>
In-reply-to
Content
> regarding excluding the setsid() case: I was being conservative as I couldn't find a reference of what was and wasn't allowed after vfork.

Yes, there is no list of functions allowed after vfork(), except for the conservative POSIX.1 list consisting only of _exit() and execve(), so we can only take async-signal-safe functions as a first approximation and work from there. Thankfully, on Linux, C libraries don't do anything fancy in most cases. But, for example, it appears that on FreeBSD we wouldn't be able to use sigprocmask()/sigaction()[1]. BTW, commit[2] and the linked review are an interesting reading for anybody who would like to support posix_spawn() and/or vfork() in subprocess on FreeBSD.

> Confirming, in glibc is appears to be a shim for the setsid syscall (based on not finding any code implementing anything special for it) and in uclibc (*much* easier to read) it is clearly just a setsid syscall shim.

I also recommend musl[3] when simplicity (and correctness) is required :)

[1] https://svnweb.freebsd.org/base/head/lib/libc/gen/posix_spawn.c?view=markup&pathrev=362111#l126
[2] https://svnweb.freebsd.org/base?view=revision&revision=352712
[3] https://git.musl-libc.org/cgit/musl/tree/src/unistd/setsid.c?id=a5aff1972c9e3981566414b09a28e331ccd2be5d
History
Date User Action Args
2020-10-24 19:12:42izbyshevsetrecipients: + izbyshev, gregory.p.smith, ronaldoussoren, koobs, pablogsal, Yonatan Goldschmidt
2020-10-24 19:12:42izbyshevsetmessageid: <1603566762.74.0.687553303716.issue35823@roundup.psfhosted.org>
2020-10-24 19:12:42izbyshevlinkissue35823 messages
2020-10-24 19:12:42izbyshevcreate