aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps/pthread/pthread_sigmask.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/pthread/pthread_sigmask.c')
-rw-r--r--nptl/sysdeps/pthread/pthread_sigmask.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/nptl/sysdeps/pthread/pthread_sigmask.c b/nptl/sysdeps/pthread/pthread_sigmask.c
index 4114e0be2f..df6ac64ddb 100644
--- a/nptl/sysdeps/pthread/pthread_sigmask.c
+++ b/nptl/sysdeps/pthread/pthread_sigmask.c
@@ -32,13 +32,36 @@ pthread_sigmask (how, newmask, oldmask)
sigset_t local_newmask;
/* The only thing we have to make sure here is that SIGCANCEL is not
- blocked. */
- if (newmask != NULL
- && __builtin_expect (__sigismember (newmask, SIGCANCEL), 0))
+ blocked and that SIGTIMER is not unblocked. */
+ if (newmask != NULL)
{
- local_newmask = *newmask;
- sigdelset (&local_newmask, SIGCANCEL);
- newmask = &local_newmask;
+ if (__builtin_expect (__sigismember (newmask, SIGCANCEL), 0))
+ {
+ local_newmask = *newmask;
+ __sigdelset (&local_newmask, SIGCANCEL);
+ newmask = &local_newmask;
+ }
+
+ if (__builtin_expect (__sigismember (newmask, SIGTIMER), 0))
+ {
+ if (how == SIG_UNBLOCK)
+ {
+ if (newmask != &local_newmask)
+ local_newmask = *newmask;
+ __sigdelset (&local_newmask, SIGTIMER);
+ newmask = &local_newmask;
+ }
+ }
+ else
+ {
+ if (how == SIG_SETMASK)
+ {
+ if (newmask != &local_newmask)
+ local_newmask = *newmask;
+ __sigaddset (&local_newmask, SIGTIMER);
+ newmask = &local_newmask;
+ }
+ }
}
#ifdef INTERNAL_SYSCALL