linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why does sys_rt_sigreturn call do_sigaltstack?
@ 2002-11-12  4:28 Paul Mackerras
  0 siblings, 0 replies; only message in thread
From: Paul Mackerras @ 2002-11-12  4:28 UTC (permalink / raw)
  To: linux-kernel

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-11-12  4:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-12  4:28 Why does sys_rt_sigreturn call do_sigaltstack? Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).