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.
This commit is contained in:
parent
c990f469a7
commit
c53cdbeb95
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user