On 28/12/2025 05:50, Collin Funk wrote:
* tests/misc/kill.sh: Call getlimits_. Check for RTMIN and RTMAX in the
output of 'kill -l' if the system defines SIGRTMIN and SIGRTMAX.
---
  tests/misc/kill.sh | 13 +++++++++++++
  1 file changed, 13 insertions(+)

diff --git a/tests/misc/kill.sh b/tests/misc/kill.sh
index 4f9c11ab7..0dbe46b8f 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

All LGTM.
grep -c is POSIX specified and already used in the test suite.

cheers,
Padraig

Reply via email to