2011-03-09 20:31:06 -05:00
|
|
|
#include <signal.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <pthread.h>
|
2011-07-30 21:09:14 -04:00
|
|
|
#include "syscall.h"
|
2011-03-09 20:31:06 -05:00
|
|
|
|
|
|
|
int pthread_sigmask(int how, const sigset_t *set, sigset_t *old)
|
|
|
|
{
|
2012-06-02 20:04:27 -04:00
|
|
|
int ret;
|
2012-08-09 22:52:13 -04:00
|
|
|
if ((unsigned)how - SIG_BLOCK > 2U) return EINVAL;
|
|
|
|
ret = -__syscall(SYS_rt_sigprocmask, how, set, old, __SYSCALL_SSLEN);
|
2012-06-02 20:04:27 -04:00
|
|
|
if (!ret && old) {
|
|
|
|
if (sizeof old->__bits[0] == 8) {
|
|
|
|
old->__bits[0] &= ~0x380000000ULL;
|
|
|
|
} else {
|
|
|
|
old->__bits[0] &= ~0x80000000UL;
|
|
|
|
old->__bits[1] &= ~0x3UL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
2011-03-09 20:31:06 -05:00
|
|
|
}
|