From 5ed7dea44c3c8564f41807299e6844d6d3adc3fe Mon Sep 17 00:00:00 2001 From: deischen Date: Tue, 14 Nov 2000 20:00:19 +0000 Subject: When entering the scheduler from the signal handler, tell the kernel to (re)use the alternate signal stack. In this case, we don't return normally from the signal handler, so the kernel still thinks we are using the signal stack. The fixes a nasty bug where the signal handler can start fiddling with the stack of a thread while the handler is actually running on the same stack. MFC candidate --- lib/libpthread/thread/thr_private.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/libpthread/thread/thr_private.h') diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h index e8fff12..9d6bc31 100644 --- a/lib/libpthread/thread/thr_private.h +++ b/lib/libpthread/thread/thr_private.h @@ -1127,6 +1127,9 @@ SCLASS volatile int _sigq_check_reqd #endif ; +/* The signal stack. */ +SCLASS struct sigaltstack _thread_sigstack; + /* Thread switch hook. */ SCLASS pthread_switch_routine_t _sched_switch_hook #ifdef GLOBAL_PTHREAD_PRIVATE @@ -1268,7 +1271,7 @@ int _thread_sys_sigsuspend(const sigset_t *); int _thread_sys_siginterrupt(int, int); int _thread_sys_sigpause(int); int _thread_sys_sigreturn(ucontext_t *); -int _thread_sys_sigaltstack(const struct sigaltstack *, struct sigstack *); +int _thread_sys_sigaltstack(const struct sigaltstack *, struct sigaltstack *); int _thread_sys_sigstack(const struct sigstack *, struct sigstack *); int _thread_sys_sigvec(int, struct sigvec *, struct sigvec *); void _thread_sys_psignal(unsigned int, const char *); -- cgit v1.1