diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-08-19 18:35:13 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-08-19 18:35:13 +0000 |
commit | 70aea399c8b3661f238b947c3f151866d3260c24 (patch) | |
tree | cc0007b11439922ed022b52fd7ef95db4b35ed7e /linuxthreads | |
parent | e1b13a63d06d2ec8b122db5c76b920544b32314a (diff) | |
download | glibc-70aea399c8b3661f238b947c3f151866d3260c24.tar glibc-70aea399c8b3661f238b947c3f151866d3260c24.tar.gz glibc-70aea399c8b3661f238b947c3f151866d3260c24.tar.bz2 glibc-70aea399c8b3661f238b947c3f151866d3260c24.zip |
Update.
1999-08-19 Ulrich Drepper <drepper@cygnus.com>
* signals.c: Pass sigcontext through wrapper to the user function.
Diffstat (limited to 'linuxthreads')
-rw-r--r-- | linuxthreads/ChangeLog | 4 | ||||
-rw-r--r-- | linuxthreads/signals.c | 18 |
2 files changed, 14 insertions, 8 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 50c9e01280..d9f5d7d9ff 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,7 @@ +1999-08-19 Ulrich Drepper <drepper@cygnus.com> + + * signals.c: Pass sigcontext through wrapper to the user function. + 1999-08-01 Ulrich Drepper <drepper@cygnus.com> * Versions [ld.so] (GLIBC_2.0): Export __libc_internal_tsd_get and diff --git a/linuxthreads/signals.c b/linuxthreads/signals.c index a352eb951d..8afb6738e6 100644 --- a/linuxthreads/signals.c +++ b/linuxthreads/signals.c @@ -19,6 +19,7 @@ #include "pthread.h" #include "internals.h" #include "spinlock.h" +#include <sigcontextinfo.h> int pthread_sigmask(int how, const sigset_t * newmask, sigset_t * oldmask) { @@ -67,10 +68,11 @@ int pthread_kill(pthread_t thread, int signo) } /* User-provided signal handlers */ -static __sighandler_t sighandler[NSIG]; +typedef void (*arch_sighandler_t) __PMT ((int, SIGCONTEXT)); +static arch_sighandler_t sighandler[NSIG]; /* The wrapper around user-provided signal handlers */ -static void pthread_sighandler(int signo) +static void pthread_sighandler(int signo, SIGCONTEXT ctx) { pthread_descr self = thread_self(); char * in_sighandler; @@ -86,7 +88,7 @@ static void pthread_sighandler(int signo) in_sighandler = THREAD_GETMEM(self, p_in_sighandler); if (in_sighandler == NULL) THREAD_SETMEM(self, p_in_sighandler, CURRENT_STACK_FRAME); - sighandler[signo](signo); + sighandler[signo](signo, ctx); if (in_sighandler == NULL) THREAD_SETMEM(self, p_in_sighandler, NULL); } @@ -108,7 +110,7 @@ int sigaction(int sig, const struct sigaction * act, newact = *act; if (act->sa_handler != SIG_IGN && act->sa_handler != SIG_DFL && sig > 0 && sig < NSIG) - newact.sa_handler = pthread_sighandler; + newact.sa_handler = (__sighandler_t) pthread_sighandler; newactp = &newact; } else @@ -118,9 +120,9 @@ int sigaction(int sig, const struct sigaction * act, if (sig > 0 && sig < NSIG) { if (oact != NULL) - oact->sa_handler = sighandler[sig]; + oact->sa_handler = (__sighandler_t) sighandler[sig]; if (act) - sighandler[sig] = act->sa_handler; + sighandler[sig] = (arch_sighandler_t) act->sa_handler; } return 0; } @@ -152,8 +154,8 @@ int sigwait(const sigset_t * set, int * sig) s != __pthread_sig_debug) { sigdelset(&mask, s); if (sighandler[s] == NULL || - sighandler[s] == SIG_DFL || - sighandler[s] == SIG_IGN) { + sighandler[s] == (arch_sighandler_t) SIG_DFL || + sighandler[s] == (arch_sighandler_t) SIG_IGN) { sa.sa_handler = pthread_null_sighandler; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; |