diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-12-26 17:57:52 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-12-26 18:03:31 +0100 |
commit | e42efa01c9305eb27616bae2bc314d8e44d129e0 (patch) | |
tree | fb3768a7fa119aba0d9e51cceb400579f2834865 /sysdeps | |
parent | a39b95b975929f12359d4bc55f25bd88c3ec02c5 (diff) | |
download | glibc-e42efa01c9305eb27616bae2bc314d8e44d129e0.tar.gz glibc-e42efa01c9305eb27616bae2bc314d8e44d129e0.tar.xz glibc-e42efa01c9305eb27616bae2bc314d8e44d129e0.zip |
hurd: set sigaction for signal preemptors in arch-independent file
Instead of having the arch-specific trampoline setup code detect whether preemption happened or not, we'd rather pass it the sigaction. In the future, this may also allow to change sa_flags from post_signal().
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/mach/hurd/i386/trampoline.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/sysdeps/mach/hurd/i386/trampoline.c b/sysdeps/mach/hurd/i386/trampoline.c index 1777d0769d..a47bbe9667 100644 --- a/sysdeps/mach/hurd/i386/trampoline.c +++ b/sysdeps/mach/hurd/i386/trampoline.c @@ -80,7 +80,8 @@ static void fill_ucontext (ucontext_t *uc, const struct sigcontext *sc) } struct sigcontext * -_hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, +_hurd_setup_sighandler (struct hurd_sigstate *ss, const struct sigaction *action, + __sighandler_t handler, int signo, struct hurd_signal_detail *detail, volatile int rpc_wait, struct machine_thread_all_state *state) @@ -90,7 +91,6 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, void firewall (void); extern const void _hurd_intr_rpc_msg_cx_sp; extern const void _hurd_intr_rpc_msg_sp_restored; - const struct sigaction *action; void *volatile sigsp; struct sigcontext *scp; struct @@ -123,11 +123,6 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, siginfo_t siginfo; } *stackframe; - /* sigaction for preemptors */ - static const struct sigaction legacy_sigaction = { - .sa_flags = SA_RESTART - }; - if (ss->context) { /* We have a previous sigcontext that sigreturn was about @@ -170,14 +165,6 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, the SP on sigreturn. */ state->basic.uesp = state->basic.ecx; - action = & _hurd_sigstate_actions (ss) [signo]; - if ( (action->sa_flags & SA_SIGINFO) - && handler != (__sighandler_t) action->sa_sigaction - || !(action->sa_flags & SA_SIGINFO) - && handler != action->sa_handler) - /* A signal preemptor took over, use legacy semantic. */ - action = &legacy_sigaction; - if ((action->sa_flags & SA_ONSTACK) && !(ss->sigaltstack.ss_flags & (SS_DISABLE|SS_ONSTACK))) { |