remove __SYSCALL_SSLEN arch macro in favor of using public _NSIG
[musl] / src / thread / pthread_sigmask.c
1 #include <signal.h>
2 #include <errno.h>
3 #include <pthread.h>
4 #include "syscall.h"
5
6 int pthread_sigmask(int how, const sigset_t *restrict set, sigset_t *restrict old)
7 {
8         int ret;
9         if ((unsigned)how - SIG_BLOCK > 2U) return EINVAL;
10         ret = -__syscall(SYS_rt_sigprocmask, how, set, old, _NSIG/8);
11         if (!ret && old) {
12                 if (sizeof old->__bits[0] == 8) {
13                         old->__bits[0] &= ~0x380000000ULL;
14                 } else {
15                         old->__bits[0] &= ~0x80000000UL;
16                         old->__bits[1] &= ~0x3UL;
17                 }
18         }
19         return ret;
20 }