math cleanup: use 1.0f instead of (float)1.0
[musl] / src / signal / sigaction.c
index 3d374e1..5bc9383 100644 (file)
@@ -3,9 +3,13 @@
 #include <errno.h>
 #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;
        }