- sp = ps->ps_sigstk.ss_sp;
- sp += ps->ps_sigstk.ss_size;
- stack_size = ps->ps_sigstk.ss_size;
- ps->ps_sigstk.ss_flags |= SA_ONSTACK;
+ if (uthsigaltstack != 0) {
+ sp = ut->uu_sigstk.ss_sp;
+ sp += ut->uu_sigstk.ss_size;
+ stack_size = ut->uu_sigstk.ss_size;
+ ut->uu_sigstk.ss_flags |= SA_ONSTACK;
+ } else {
+ sp = ps->ps_sigstk.ss_sp;
+ sp += ps->ps_sigstk.ss_size;
+ stack_size = ps->ps_sigstk.ss_size;
+ ps->ps_sigstk.ss_flags |= SA_ONSTACK;
+ }