X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_sigmask.c;h=f6102ad4dc6b76eb79c19a46a9828f76266e5c81;hb=dd959163828bda8b03e699de95298fffb2329bb9;hp=6cc21d223302ed473f4e0997342014ca3346aa5e;hpb=500c969f059dc1b12dc3809d270cb169abbd57d3;p=musl diff --git a/src/thread/pthread_sigmask.c b/src/thread/pthread_sigmask.c index 6cc21d22..f6102ad4 100644 --- a/src/thread/pthread_sigmask.c +++ b/src/thread/pthread_sigmask.c @@ -1,10 +1,20 @@ #include #include #include +#include "syscall.h" -int pthread_sigmask(int how, const sigset_t *set, sigset_t *old) +int pthread_sigmask(int how, const sigset_t *restrict set, sigset_t *restrict old) { - int ret = sigprocmask(how, set, old); - if (ret) return errno; - return 0; + int ret; + if ((unsigned)how - SIG_BLOCK > 2U) return EINVAL; + ret = -__syscall(SYS_rt_sigprocmask, how, set, old, __SYSCALL_SSLEN); + if (!ret && old) { + if (sizeof old->__bits[0] == 8) { + old->__bits[0] &= ~0x380000000ULL; + } else { + old->__bits[0] &= ~0x80000000UL; + old->__bits[1] &= ~0x3UL; + } + } + return ret; }