diff options
author | Mike Gilbert <floppym@gentoo.org> | 2024-10-24 18:24:35 +0200 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2024-10-31 18:16:58 +0100 |
commit | ff94426f8a2d6cd4ea2e370835db152917a1684e (patch) | |
tree | dbbe906922e7141a3ce3ec04c715b20ed8bb9e47 /src/basic | |
parent | mkosi: Install gdb in centos/fedora build image (diff) | |
download | systemd-ff94426f8a2d6cd4ea2e370835db152917a1684e.tar.xz systemd-ff94426f8a2d6cd4ea2e370835db152917a1684e.zip |
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.
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/process-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c index f30d9117a7..a85a1b35f0 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -2029,7 +2029,7 @@ int posix_spawn_wrapper( const char *cgroup, PidRef *ret_pidref) { - short flags = POSIX_SPAWN_SETSIGMASK|POSIX_SPAWN_SETSIGDEF; + short flags = POSIX_SPAWN_SETSIGMASK; posix_spawnattr_t attr; sigset_t mask; int r; |