From: Yu Watanabe Date: Sat, 6 Sep 2025 23:53:07 +0000 (+0900) Subject: musl: core: there is one less usable signal when built with musl X-Git-Tag: v259-rc1~71^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3866923a6831a95a2aeca9b6f25694ec18440951;p=thirdparty%2Fsystemd.git musl: core: there is one less usable signal when built with musl musl internally reserves one more signal, hence we can only use 29 signals. --- diff --git a/src/core/manager.c b/src/core/manager.c index b501d3f1c5b..deed863e188 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -526,8 +526,9 @@ static int manager_setup_signals(Manager *m) { assert_se(sigaction(SIGCHLD, &sa, NULL) == 0); - /* We make liberal use of realtime signals here. On Linux/glibc we have 30 of them, between - * SIGRTMIN+0 ... SIGRTMIN+30 (aka SIGRTMAX). */ + /* We make liberal use of realtime signals here. On Linux we have 29 of them, between + * SIGRTMIN+0 ... SIGRTMIN+29. The glibc has one more (SIGRTMAX is SIGRTMIN+30), + * but musl does not (SIGRTMAX is SIGRTMIN+29). */ assert_se(sigemptyset(&mask) == 0); sigset_add_many(&mask, @@ -572,7 +573,7 @@ static int manager_setup_signals(Manager *m) { SIGRTMIN+28, /* systemd: set log target to kmsg */ SIGRTMIN+29, /* systemd: set log target to syslog-or-kmsg (obsolete) */ - /* ... one free signal here SIGRTMIN+30 ... */ + /* ... one free signal here SIGRTMIN+30 (glibc only) ... */ -1); assert_se(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); diff --git a/src/test/test-signal-util.c b/src/test/test-signal-util.c index 7d069a7fb24..822556022d9 100644 --- a/src/test/test-signal-util.c +++ b/src/test/test-signal-util.c @@ -13,8 +13,9 @@ TEST(rt_signals) { info(SIGRTMIN); info(SIGRTMAX); - /* We use signals SIGRTMIN+0 to SIGRTMIN+30 unconditionally */ - assert_se(SIGRTMAX - SIGRTMIN >= 30); + /* We use signals SIGRTMIN+0 to SIGRTMIN+29 unconditionally. SIGRTMIN+30 can be used only when + * built with glibc. */ + assert_se(SIGRTMAX - SIGRTMIN >= 29); } static void test_signal_to_string_one(int val) {