From c53cdbeb95ee95429b18b0a5cd9360cc2d1dafda Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Mon, 5 Jan 2004 00:29:00 +0000 Subject: [PATCH] Attempt to make the proper changes here for the proc.h commit: Make sigaltstack as per-threaded, because per-process sigaltstack state is useless for threaded programs, multiple threads can not share same stack. The alternative signal stack is private for thread, no lock is needed, the orignal P_ALTSTACK is now moved into td_pflags and renamed to TDP_ALTSTACK. For single thread or Linux clone() based threaded program, there is no semantic changed, because those programs only have one kernel thread in every process. which left out SVR4 bits. --- sys/i386/svr4/svr4_machdep.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/i386/svr4/svr4_machdep.c b/sys/i386/svr4/svr4_machdep.c index a800b43a4fd..91ad9d34667 100644 --- a/sys/i386/svr4/svr4_machdep.c +++ b/sys/i386/svr4/svr4_machdep.c @@ -206,7 +206,7 @@ svr4_setcontext(td, uc) #if defined(DONE_MORE_SIGALTSTACK_WORK) psp = p->p_sigacts; #endif - sf = &p->p_sigstk; + sf = &td->td_sigstk; /* * XXX: @@ -437,11 +437,11 @@ svr4_sendsig(catcher, sig, mask, code) /* * Allocate space for the signal handler context. */ - if ((p->p_flag & P_ALTSTACK) && !oonstack && + if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct svr4_sigframe *)(p->p_sigstk.ss_sp + - p->p_sigstk.ss_size - sizeof(struct svr4_sigframe)); - p->p_sigstk.ss_flags |= SS_ONSTACK; + fp = (struct svr4_sigframe *)(td->td_sigstk.ss_sp + + td->td_sigstk.ss_size - sizeof(struct svr4_sigframe)); + td->td_sigstk.ss_flags |= SS_ONSTACK; } else { fp = (struct svr4_sigframe *)tf->tf_esp - 1; }