Why does sys_rt_sigreturn call do_sigaltstack?

Paul Mackerras (paulus@samba.org)
Tue, 12 Nov 2002 15:28:58 +1100


Currently, in both 2.4 and 2.5, the kernel saves the current alternate
signal stack setting when invoking the handler for a real-time signal,
and restores that setting on return from the handler.

More precisely, in setup_rt_frame, the kernel saves current->sas_ss_sp
and current->sas_ss_size in the ucontext that it sets up (in
frame->uc.uc_stack). Then, in sys_rt_sigreturn, it copies
frame->uc.uc_stack back in and calls do_sigaltstack with the copy.
This is on x86; ppc does something similar too.

Why does it do this? It seems rather bizarre to me, given that
sigaltstack() is not per-signal, its effect is global. Is there some
requirement that the effect of a sigaltstack() call during a real-time
signal handler should only be allowed to persist until the handler
returns? If so, can someone please point me at where it says that in
some standards document?

Thanks,
Paul.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/