mirror of https://git.musl-libc.org/git/musl
Browse Source
it's nicer for the function that doesn't use errno to be independent, and have the other one call it. saves some time and avoids clobbering errno.rs-1.0
2 changed files with 7 additions and 11 deletions
@ -1,14 +1,10 @@ |
|||||
#include <signal.h> |
#include <signal.h> |
||||
#include <errno.h> |
#include <errno.h> |
||||
#include "syscall.h" |
|
||||
#include "libc.h" |
|
||||
#include "pthread_impl.h" |
|
||||
|
|
||||
int sigprocmask(int how, const sigset_t *set, sigset_t *old) |
int sigprocmask(int how, const sigset_t *set, sigset_t *old) |
||||
{ |
{ |
||||
if (how > 2U) { |
int r = pthread_sigmask(how, set, old); |
||||
errno = EINVAL; |
if (!r) return r; |
||||
return -1; |
errno = r; |
||||
} |
return -1; |
||||
return syscall(SYS_rt_sigprocmask, how, set, old, 8); |
|
||||
} |
} |
||||
|
|||||
@ -1,10 +1,10 @@ |
|||||
#include <signal.h> |
#include <signal.h> |
||||
#include <errno.h> |
#include <errno.h> |
||||
#include <pthread.h> |
#include <pthread.h> |
||||
|
#include "syscall.h" |
||||
|
|
||||
int pthread_sigmask(int how, const sigset_t *set, sigset_t *old) |
int pthread_sigmask(int how, const sigset_t *set, sigset_t *old) |
||||
{ |
{ |
||||
int ret = sigprocmask(how, set, old); |
if (how > 2U) return EINVAL; |
||||
if (ret) return errno; |
return -__syscall(SYS_rt_sigprocmask, how, set, old, 8); |
||||
return 0; |
|
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue