diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-07 15:11:25 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-03 15:09:26 -0500 |
commit | 2ce5da17570771330f44ac993b77749debf7954b (patch) | |
tree | 4ee9e964ed69b5ae4c8d05a5c33fe2237c9e23b2 | |
parent | ca86b5dce213f52c7538932740f83cafb2c34547 (diff) |
new helper: signal_setup_done()
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>
-rw-r--r-- | include/linux/signal.h | 1 | ||||
-rw-r--r-- | kernel/signal.c | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/signal.h b/include/linux/signal.h index 7c2744198dba..a2dcb94ea49d 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -286,6 +286,7 @@ struct ksignal { | |||
286 | }; | 286 | }; |
287 | 287 | ||
288 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | 288 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); |
289 | extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping); | ||
289 | extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping); | 290 | extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping); |
290 | extern void exit_signals(struct task_struct *tsk); | 291 | extern void exit_signals(struct task_struct *tsk); |
291 | 292 | ||
diff --git a/kernel/signal.c b/kernel/signal.c index 79998f5b0f11..775f5552fa0e 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -2396,6 +2396,15 @@ void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, | |||
2396 | tracehook_signal_handler(sig, info, ka, regs, stepping); | 2396 | tracehook_signal_handler(sig, info, ka, regs, stepping); |
2397 | } | 2397 | } |
2398 | 2398 | ||
2399 | void signal_setup_done(int failed, struct ksignal *ksig, int stepping) | ||
2400 | { | ||
2401 | if (failed) | ||
2402 | force_sigsegv(ksig->sig, current); | ||
2403 | else | ||
2404 | signal_delivered(ksig->sig, &ksig->info, &ksig->ka, | ||
2405 | signal_pt_regs(), stepping); | ||
2406 | } | ||
2407 | |||
2399 | /* | 2408 | /* |
2400 | * It could be that complete_signal() picked us to notify about the | 2409 | * It could be that complete_signal() picked us to notify about the |
2401 | * group-wide signal. Other threads should be notified now to take | 2410 | * group-wide signal. Other threads should be notified now to take |