diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-08-10 23:39:43 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-08-10 23:39:43 -0400 |
commit | 7c440977db9444d7e6b1c3dcb1fdf4ee49ca4158 (patch) | |
tree | 7d4156fff86dfa1d75dba61465baad792088dc2b /src | |
parent | 41c632824c08ac2c9eea43b30d1b3515dd910df6 (diff) | |
download | musl-7c440977db9444d7e6b1c3dcb1fdf4ee49ca4158.zip musl-7c440977db9444d7e6b1c3dcb1fdf4ee49ca4158.tar.gz musl-7c440977db9444d7e6b1c3dcb1fdf4ee49ca4158.tar.bz2 |
fix _NSIG and SIGRTMAX on mips
a mips signal mask contains 128 bits, enough for signals 1 through
128. however, the exit status obtained from the wait-family functions
only has room for values up to 127. reportedly signal 128 was causing
kernelspace bugs, so it was removed from the kernel recently; even
without that issue, however, it was impossible to support it correctly
in userspace.
at the same time, the bug was masked on musl by SIGRTMAX incorrectly
yielding 64 on mips, rather than the "correct" value of 128. now that
the _NSIG issue is fixed, SIGRTMAX can be fixed at the same time,
exposing the full range of signals for application use.
note that the (nonstandardized) libc _NSIG value is actually one
greater than the max signal number, and also one greater than the
kernel headers' idea of _NSIG. this is the reason for the discrepency
with the recent kernel changes. since reducing _NSIG by one brought it
down from 129 to 128, rather than from 128 to 127, _NSIG/8, used
widely in the musl sources, is unchanged.
Diffstat (limited to 'src')
-rw-r--r-- | src/signal/sigrtmax.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/signal/sigrtmax.c b/src/signal/sigrtmax.c index 0ef2987..44dc88f 100644 --- a/src/signal/sigrtmax.c +++ b/src/signal/sigrtmax.c @@ -1,4 +1,6 @@ +#include <signal.h> + int __libc_current_sigrtmax() { - return 64; + return _NSIG-1; } |