# Handle signals valid on all Unix systems.
addsig() {
- echo " $1: $2,"
# Get the signal number and add it to SIGLIST
signum=`grep "const $1 = " gen-sysinfo.go | sed -e 's/.* = //'`
if echo "$signum" | grep '^_SIG[A-Z0-9_]*$' >/dev/null 2>&1; then
# This is needed for some MIPS signals defined as aliases of other signals
signum=`grep "const $signum = " gen-sysinfo.go | sed -e 's/.* = //'`
fi
- SIGLIST=$SIGLIST"_${signum}_"
+ # Only add signal if the signal number isn't in the list yet.
+ # For example, musl libc uses signal 29 for both SIGIO and SIGPOLL.
+ if ! echo "$SIGLIST" | grep "_${signum}_" >/dev/null 2>&1; then
+ echo " $1: $2,"
+ SIGLIST=$SIGLIST"_${signum}_"
+ fi
}
echo ' 0: {0, "SIGNONE: no trap"},'
checksig _SIGXRES '{_SigNotify, "SIGXRES: resource control exceeded"}'
checksig _SIGJVM1 '{_SigNotify, "SIGJVM1: reserved signal for Java Virtual Machine"}'
checksig _SIGJVM2 '{_SigNotify, "SIGJVM2: reserved signal for Java Virtual Machine"}'
+checksig _SIGLOST ' {_SigNotify, "SIGLOST: resource lost (Sun); server died (GNU)"}'
# Special handling of signals 32 and 33 on GNU/Linux systems,
# because they are special to glibc.
+# Signal 34 is additionally special to Linux systems with musl.
if test "${GOOS}" = "linux"; then
- SIGLIST=$SIGLIST"_32__33_"
+ SIGLIST=$SIGLIST"_32__33__34_"
echo ' 32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
echo ' 33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
+ echo ' 34: {_SigSetStack + _SigUnblock, "signal 34"}, /* musl SIGSYNCCALL; see issue 39343 */'
fi
if test "${GOOS}" = "aix"; then
rtmax=`grep 'const _*SIGRTMAX = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
if test -n "$rtmax"; then
nsig=`expr $rtmax + 1`
+ elif grep 'const _*SIGRTMAX = [ (]*_*SIGRTMIN[ )]*' gen-sysinfo.go >/dev/null 2>&1; then
+ rtmin=`grep 'const _*SIGRTMIN = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
+ if test -n "$rtmin"; then
+ nsig=`expr $rtmin + 1`
+ fi
fi
fi
fi