X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fsignal%2Fsigaction.c;h=5bc9383b66f34ed6f57e6d1f6a56bc57b8a8dc3c;hb=6255c4c6a5599724d18311a7776aebe67f8e6d4a;hp=3d374e1f45bf661a7a278fc1ba060ada8e3e6735;hpb=aa398f56fa398f2202b04e82c67f822f3233786f;p=musl diff --git a/src/signal/sigaction.c b/src/signal/sigaction.c index 3d374e1f..5bc9383b 100644 --- a/src/signal/sigaction.c +++ b/src/signal/sigaction.c @@ -3,9 +3,13 @@ #include #include "syscall.h" #include "pthread_impl.h" +#include "libc.h" void __restore(), __restore_rt(); +static pthread_t dummy(void) { return 0; } +weak_alias(dummy, __pthread_self_def); + int __libc_sigaction(int sig, const struct sigaction *sa, struct sigaction *old) { struct { @@ -23,6 +27,7 @@ int __libc_sigaction(int sig, const struct sigaction *sa, struct sigaction *old) pksa = (long)&ksa; } if (old) pkold = (long)&kold; + __pthread_self_def(); if (syscall(SYS_rt_sigaction, sig, pksa, pkold, 8)) return -1; if (old) { @@ -35,7 +40,7 @@ int __libc_sigaction(int sig, const struct sigaction *sa, struct sigaction *old) int __sigaction(int sig, const struct sigaction *sa, struct sigaction *old) { - if (sig == SIGCANCEL || sig == SIGSYSCALL) { + if (sig-32U < 3) { errno = EINVAL; return -1; }