]> git.ipfire.org Git - thirdparty/systemd.git/commit
posix_spawn_wrapper: do not set POSIX_SPAWN_SETSIGDEF flag
authorMike Gilbert <floppym@gentoo.org>
Thu, 24 Oct 2024 16:24:35 +0000 (12:24 -0400)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 13 Nov 2024 19:48:10 +0000 (19:48 +0000)
commitaa0aa1093d646f3efbcbc9cf09476ee032839bdd
tree90d1104b9ae8b22814279f0d3c7964777202d729
parent9d060fb7eb6be828c3a6a822e38dabcc627ac98d
posix_spawn_wrapper: do not set POSIX_SPAWN_SETSIGDEF flag

Setting this flag is a noop without a corresponding call to
posix_spawnattr_setsigdefault.

If we call posix_spawnattr_setsigdefault with a full signal set,
it causes glibc's posix_spawn implementation to call sigaction 63 times,
once for each signal. That seems wasteful.

This feature is really only useful for signals which have their
disposition set to SIG_IGN. Otherwise the dispostion gets set to
SIG_DFL automatically, either by clone(CLONE_CLEAR_SIGHAND) or the
subsequent execve.

As far as I can tell, systemd does not have any signals set to SIG_IGN
under normal operating conditions.

(cherry picked from commit ff94426f8a2d6cd4ea2e370835db152917a1684e)
src/basic/process-util.c