summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAkinori MUSHA <knu@FreeBSD.org>2001-04-18 18:40:54 +0000
committerAkinori MUSHA <knu@FreeBSD.org>2001-04-18 18:40:54 +0000
commitf280165ba19eb1e579034b9aa7fdbe6cdf8b22ea (patch)
treeb69b428ddb53dba95f3b3b48ddf5d964400a6765 /lib
parent7c60d0c16fe3847b1439874b056bbd53132354c7 (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libc_r/uthread/uthread_fork.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/libc_r/uthread/uthread_fork.c b/lib/libc_r/uthread/uthread_fork.c
index 97039b3ef804..9fc17c6e4754 100644
--- a/lib/libc_r/uthread/uthread_fork.c
+++ b/lib/libc_r/uthread/uthread_fork.c
@@ -32,6 +32,7 @@
* $FreeBSD$
*/
#include <errno.h>
+#include <signal.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
@@ -108,7 +109,16 @@ _fork(void)
else if (_pq_init(&_readyq) != 0) {
/* Abort this application: */
PANIC("Cannot initialize priority ready queue.");
- } else {
+ } else if ((_thread_sigstack.ss_sp == NULL) &&
+ ((_thread_sigstack.ss_sp = malloc(SIGSTKSZ)) == NULL))
+ PANIC("Unable to allocate alternate signal stack");
+ else {
+ /* Install the alternate signal stack: */
+ _thread_sigstack.ss_size = SIGSTKSZ;
+ _thread_sigstack.ss_flags = 0;
+ if (_thread_sys_sigaltstack(&_thread_sigstack, NULL) != 0)
+ PANIC("Unable to install alternate signal stack");
+
/*
* Enter a loop to remove all threads other than
* the running thread from the thread list: