aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps/pthread
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/pthread')
-rw-r--r--nptl/sysdeps/pthread/posix-timer.h7
-rw-r--r--nptl/sysdeps/pthread/pthread_sigmask.c35
-rw-r--r--nptl/sysdeps/pthread/sigaction.c7
3 files changed, 39 insertions, 10 deletions
diff --git a/nptl/sysdeps/pthread/posix-timer.h b/nptl/sysdeps/pthread/posix-timer.h
index 6710291b9b..bc0c57f63b 100644
--- a/nptl/sysdeps/pthread/posix-timer.h
+++ b/nptl/sysdeps/pthread/posix-timer.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX timer implementation on top of LinuxThreads.
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
@@ -94,6 +94,7 @@ extern struct thread_node __timer_signal_thread_tclk;
/* Return pointer to timer structure corresponding to ID. */
+#if 0
static inline struct timer_node *
timer_id2ptr (timer_t timerid)
{
@@ -109,6 +110,10 @@ timer_ptr2id (struct timer_node *timer)
{
return timer - __timer_array;
}
+#else
+# define timer_id2ptr(timerid) ((struct timed_node *) timerid)
+# define timer_ptr2id(timerid) ((void *) timerid)
+#endif
/* Check whether timer is valid; global mutex must be held. */
static inline int
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
diff --git a/nptl/sysdeps/pthread/sigaction.c b/nptl/sysdeps/pthread/sigaction.c
index e3554ddb44..d69abf09ae 100644
--- a/nptl/sysdeps/pthread/sigaction.c
+++ b/nptl/sysdeps/pthread/sigaction.c
@@ -22,9 +22,10 @@
exact file anyway. */
#ifndef LIBC_SIGACTION
+#include <nptl/pthreadP.h>
+
/* We use the libc implementation but we tell it to not allow
- SIGCANCEL to be handled. */
-# define SIGCANCEL __SIGRTMIN
+ SIGCANCEL or SIGTIMER to be handled. */
# define LIBC_SIGACTION 1
# include <nptl/sysdeps/pthread/sigaction.c>
@@ -35,7 +36,7 @@ __sigaction (sig, act, oact)
const struct sigaction *act;
struct sigaction *oact;
{
- if (sig == SIGCANCEL)
+ if (sig == SIGCANCEL || sig == SIGTIMER)
{
__set_errno (EINVAL);
return -1;