From fa8314227c51816057f11e1672444bbae7baed35 Mon Sep 17 00:00:00 2001 From: knu Date: Mon, 7 May 2001 18:07:29 +0000 Subject: Properly copy the P_ALTSTACK flag in struct proc::p_flag to the child process on fork(2). It is the supposed behavior stated in the manpage of sigaction(2), and Solaris, NetBSD and FreeBSD 3-STABLE correctly do so. The previous fix against libc_r/uthread/uthread_fork.c fixed the problem only for the programs linked with libc_r, so back it out and fix fork(2) itself to help those not linked with libc_r as well. PR: kern/26705 Submitted by: KUROSAWA Takahiro Tested by: knu, GOTOU Yuuzou , and some other people Not objected by: hackers MFC in: 3 days --- lib/libc_r/uthread/uthread_fork.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'lib/libc_r') diff --git a/lib/libc_r/uthread/uthread_fork.c b/lib/libc_r/uthread/uthread_fork.c index a2aabbe..4437d88 100644 --- a/lib/libc_r/uthread/uthread_fork.c +++ b/lib/libc_r/uthread/uthread_fork.c @@ -32,7 +32,6 @@ * $FreeBSD$ */ #include -#include #include #include #include @@ -113,16 +112,7 @@ _fork(void) else if (_pq_init(&_readyq) != 0) { /* Abort this application: */ PANIC("Cannot initialize priority ready queue."); - } 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 (__sys_sigaltstack(&_thread_sigstack, NULL) != 0) - PANIC("Unable to install alternate signal stack"); - + } else { /* * Enter a loop to remove all threads other than * the running thread from the thread list: -- cgit v1.1