new helper: signal_setup_done()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 7 Nov 2012 20:11:25 +0000 (15:11 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 3 Feb 2013 20:09:26 +0000 (15:09 -0500)
usual "call force_sigsegv or signal_delivered" logics.  Takes
ksignal instead of separate siginfo/k_sigaction.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
include/linux/signal.h
kernel/signal.c

index 7c2744198dbaac1b0a8e8061f539a69fcd95b335..a2dcb94ea49de76e81bc6c9d200b555d4cbbba04 100644 (file)
@@ -286,6 +286,7 @@ struct ksignal {
 };
 
 extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
+extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping);
 extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping);
 extern void exit_signals(struct task_struct *tsk);
 
index 79998f5b0f1186193ca89b3c86880b40009ac42a..775f5552fa0ef410eef655e8c857545c595faf74 100644 (file)
@@ -2396,6 +2396,15 @@ void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka,
        tracehook_signal_handler(sig, info, ka, regs, stepping);
 }
 
+void signal_setup_done(int failed, struct ksignal *ksig, int stepping)
+{
+       if (failed)
+               force_sigsegv(ksig->sig, current);
+       else
+               signal_delivered(ksig->sig, &ksig->info, &ksig->ka,
+                       signal_pt_regs(), stepping);
+}
+
 /*
  * It could be that complete_signal() picked us to notify about the
  * group-wide signal. Other threads should be notified now to take