diff options
author | knu <knu@FreeBSD.org> | 2001-05-07 18:07:29 +0000 |
---|---|---|
committer | knu <knu@FreeBSD.org> | 2001-05-07 18:07:29 +0000 |
commit | fa8314227c51816057f11e1672444bbae7baed35 (patch) | |
tree | 9e378daa5d9b1952f2899a84d55c20c4b1faaf26 /lib/libpthread | |
parent | 04a6a52217ab308220e97946befc2943eb93f68c (diff) | |
download | FreeBSD-src-fa8314227c51816057f11e1672444bbae7baed35.zip FreeBSD-src-fa8314227c51816057f11e1672444bbae7baed35.tar.gz |
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 <fwkg7679@mb.infoweb.ne.jp>
Tested by: knu, GOTOU Yuuzou <gotoyuzo@notwork.org>,
and some other people
Not objected by: hackers
MFC in: 3 days
Diffstat (limited to 'lib/libpthread')
-rw-r--r-- | lib/libpthread/thread/thr_fork.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/libpthread/thread/thr_fork.c b/lib/libpthread/thread/thr_fork.c index a2aabbe..4437d88 100644 --- a/lib/libpthread/thread/thr_fork.c +++ b/lib/libpthread/thread/thr_fork.c @@ -32,7 +32,6 @@ * $FreeBSD$ */ #include <errno.h> -#include <signal.h> #include <string.h> #include <stdlib.h> #include <unistd.h> @@ -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: |