mirror of
https://github.com/fluencelabs/musl
synced 2025-07-16 23:11:59 +00:00
prevent sigprocmask/pthread_sigmask from blocking implementation signals
this code was wrongly disabled because the old version was trying to be too clever and didn't work. replaced it with a simple version for now.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "syscall.h"
|
#include "syscall.h"
|
||||||
#include "libc.h"
|
#include "libc.h"
|
||||||
|
#include "pthread_impl.h"
|
||||||
|
|
||||||
int __libc_sigprocmask(int how, const sigset_t *set, sigset_t *old)
|
int __libc_sigprocmask(int how, const sigset_t *set, sigset_t *old)
|
||||||
{
|
{
|
||||||
@@ -10,11 +11,12 @@ int __libc_sigprocmask(int how, const sigset_t *set, sigset_t *old)
|
|||||||
int __sigprocmask(int how, const sigset_t *set, sigset_t *old)
|
int __sigprocmask(int how, const sigset_t *set, sigset_t *old)
|
||||||
{
|
{
|
||||||
sigset_t tmp;
|
sigset_t tmp;
|
||||||
/* Quickly mask out bits 32 and 33 (thread control signals) */
|
/* Disallow blocking thread control signals */
|
||||||
if (0 && how != SIG_UNBLOCK && (set->__bits[4/sizeof *set->__bits] & 3UL<<(32&8*sizeof *set->__bits-1))) {
|
if (how != SIG_UNBLOCK) {
|
||||||
tmp = *set;
|
tmp = *set;
|
||||||
set = &tmp;
|
set = &tmp;
|
||||||
tmp.__bits[4/sizeof *set->__bits] &= ~(3UL<<(32&8*sizeof *set->__bits-1));
|
sigdelset(&tmp, SIGCANCEL);
|
||||||
|
sigdelset(&tmp, SIGSYSCALL);
|
||||||
}
|
}
|
||||||
return __libc_sigprocmask(how, set, old);
|
return __libc_sigprocmask(how, set, old);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user