1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

linux: Use pthread_sigmask on sigprocmask

With pthread_sigmask on libc.so, it allows implement sigprocmask
on top of pthread_sigmask.

Checked on x86_64-linux-gnu.
This commit is contained in:
Adhemerval Zanella
2020-03-11 15:21:59 -03:00
parent 34d49f120d
commit 2f6fa80147
4 changed files with 27 additions and 15 deletions

View File

@ -22,21 +22,11 @@
int
__sigprocmask (int how, const sigset_t *set, sigset_t *oset)
{
sigset_t local_newmask;
/* The only thing we have to make sure here is that SIGCANCEL and
SIGSETXID are not blocked. */
if (set != NULL
&& __glibc_unlikely (__sigismember (set, SIGCANCEL)
|| __glibc_unlikely (__sigismember (set, SIGSETXID))))
{
local_newmask = *set;
__sigdelset (&local_newmask, SIGCANCEL);
__sigdelset (&local_newmask, SIGSETXID);
set = &local_newmask;
}
return INLINE_SYSCALL_CALL (rt_sigprocmask, how, set, oset, _NSIG / 8);
int result = __pthread_sigmask (how, set, oset);
if (result == 0)
return 0;
__set_errno (result);
return -1;
}
libc_hidden_def (__sigprocmask)
weak_alias (__sigprocmask, sigprocmask)