fix (hopefully) all hard-coded 8's for kernel sigset_t size
[musl] / src / signal / raise.c
index 52f8b42..c0814fa 100644 (file)
@@ -1,7 +1,17 @@
 #include <signal.h>
+#include <errno.h>
+#include <stdint.h>
 #include "syscall.h"
+#include "pthread_impl.h"
 
 int raise(int sig)
 {
-       return __syscall_kill(__syscall_getpid(), sig);
+       int pid, tid, ret;
+       sigset_t set;
+       __syscall(SYS_rt_sigprocmask, SIG_BLOCK, SIGALL_SET, &set, __SYSCALL_SSLEN);
+       tid = syscall(SYS_gettid);
+       pid = syscall(SYS_getpid);
+       ret = syscall(SYS_tgkill, pid, tid, sig);
+       __syscall(SYS_rt_sigprocmask, SIG_SETMASK, &set, 0, __SYSCALL_SSLEN);
+       return ret;
 }