From: Chen Qi Date: Wed, 4 Jun 2025 08:27:19 +0000 (+0800) Subject: ts/kill/decode: use RTMIN from 'kill -L' instead of hardcoding 34 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c5d5e8873029d170fcab38a6fbd5d5a355574b9f;p=thirdparty%2Futil-linux.git ts/kill/decode: use RTMIN from 'kill -L' instead of hardcoding 34 glibc uses 34 as the value of SIGRTMIN: https://sourceware.org/git/?p=glibc.git;a=blob;f=signal/allocrtsig.c;h=8ed8e37dd6c41f94be6eef042ce9db1af1153228;hb=HEAD#l27 """ static int current_rtmin = __SIGRTMIN + RESERVED_SIGRT; """ musl uses 35 as the value of SIGRTMIN: https://git.musl-libc.org/cgit/musl/tree/src/signal/sigrtmin.c With the hardcoded 34, test case fails with the following difference: -Ignored: HUP QUIT TRAP PIPE ALRM +Ignored: HUP QUIT TRAP PIPE ALRM 34 Extract the value of RTMIN from 'kill -L' to avoid such hardcoding. Signed-off-by: Chen Qi --- diff --git a/tests/ts/kill/decode b/tests/ts/kill/decode index 57149899e..524b4e5e2 100755 --- a/tests/ts/kill/decode +++ b/tests/ts/kill/decode @@ -53,14 +53,19 @@ ACK= # Sending one more USR1 is for making the signal pending state. "$TS_CMD_KILL" -USR1 "$PID" "$TS_CMD_KILL" -d "$PID" | { - if [[ $("$TS_CMD_KILL" --list=34) == RT0 ]]; then + SIGRTMIN=$("$TS_CMD_KILL" -L | grep -o '[0-9]\+ RTMIN' | cut -d " " -f 1) + if [[ $("$TS_CMD_KILL" --list=$SIGRTMIN) == RT0 ]]; then # See man signal(7). # The Linux kernel supports a range of 33 different real-time signals, # numbered 32 to 64. However, the glibc POSIX threads implementation in‐ # ternally uses two (for NPTL) or three (for LinuxThreads) real-time sig‐ # nals (see pthreads(7)), and adjusts the value of SIGRTMIN suitably (to # 34 or 35). - sed -e s/' 32 33'// -e s/' 34'// + sed_cmd="sed" + for ((i=32; i<=SIGRTMIN; i++)); do + sed_cmd+=" -e s/' $i'//" + done + eval $sed_cmd else cat fi