diff options
Diffstat (limited to 'src/signal')
-rw-r--r-- | src/signal/siglongjmp.c | 9 | ||||
-rw-r--r-- | src/signal/sigsetjmp.c | 8 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/signal/siglongjmp.c b/src/signal/siglongjmp.c index 600d560c..9b4a5398 100644 --- a/src/signal/siglongjmp.c +++ b/src/signal/siglongjmp.c @@ -1,12 +1,11 @@ #include <setjmp.h> #include <signal.h> #include <stdlib.h> +#include "syscall.h" void siglongjmp(sigjmp_buf buf, int ret) { - unsigned long *flag = buf + sizeof(jmp_buf)/sizeof(long) - 1; - sigset_t *mask = (void *)(flag + 1); - if (*flag) - sigprocmask (SIG_SETMASK, mask, NULL); - longjmp((void *)buf, ret); + if (buf->__fl) + __syscall(SYS_rt_sigprocmask, SIG_SETMASK, buf->__ss, 0, 8); + longjmp(buf->__jb, ret); } diff --git a/src/signal/sigsetjmp.c b/src/signal/sigsetjmp.c index 5c937074..01ba0dff 100644 --- a/src/signal/sigsetjmp.c +++ b/src/signal/sigsetjmp.c @@ -9,9 +9,7 @@ int sigsetjmp(sigjmp_buf buf, int save) { - unsigned long *flag = buf + sizeof(jmp_buf)/sizeof(long); - sigset_t *mask = (void *)(flag + 1); - if ((*flag = save)) - sigprocmask (SIG_SETMASK, NULL, mask); - return setjmp((void *)buf); + if ((buf->__fl = save)) + pthread_sigmask(SIG_SETMASK, 0, (sigset_t *)buf->__ss); + return setjmp(buf->__jb); } |