From: Collin Funk Date: Sun, 28 Dec 2025 05:48:42 +0000 (-0800) Subject: tests: kill: check that real-time signals are listed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d45598f2370d12760c3cfb07aef7d3ac9ef78e6d;p=thirdparty%2Fcoreutils.git tests: kill: check that real-time signals are listed * tests/misc/kill.sh: Call getlimits_. Check for RTMIN and RTMAX in the output of 'kill -l' if the system defines SIGRTMIN and SIGRTMAX. --- diff --git a/tests/misc/kill.sh b/tests/misc/kill.sh index 4f9c11ab71..0dbe46b8f6 100755 --- a/tests/misc/kill.sh +++ b/tests/misc/kill.sh @@ -18,6 +18,7 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ kill seq +getlimits_ # params required returns_ 1 env kill || fail=1 @@ -71,4 +72,16 @@ env kill -t -- $SIG_SEQ || fail=1 # Verify first signal number listed is 0 test $(env kill -l $(env kill -l | head -n1)) = 0 || fail=1 +# If the system's signal.h defines SIGRTMIN and SIGRTMAX, assume that real-time +# signals are supported. +if test $SIGRTMIN -gt 0 && test $SIGRTMAX -gt $SIGRTMIN; then + rtmin=$(env kill -l | grep -c '^RTMIN') + rtmax=$(env kill -l | grep -c '^RTMAX') + # We only check that at least RTMIN and RTMAX are listed in the output. + # POSIX states the range of signals between SIGRTMIN and SIGRTMAX are + # reserved for real-time signals, but does not require that all signals + # in the range are usable. + test $rtmin -gt 0 && test $rtmax -gt 0 || fail=1 +fi + Exit $fail