diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-28 02:04:15 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 12:58:52 -0400 |
commit | efee984c27b67e3ebef40410f35671997441b57c (patch) | |
tree | 53457dba2338f853d34e1754e7f7f960e4a29482 /kernel/signal.c | |
parent | 17440f171e28e86cc21a4c8fd1fa3c561503f80e (diff) |
new helper: signal_delivered()
Does block_sigmask() + tracehook_signal_handler(); called when
sigframe has been successfully built. All architectures converted
to it; block_sigmask() itself is gone now (merged into this one).
I'm still not too happy with the signature, but that's a separate
story (IMO we need a structure that would contain signal number +
siginfo + k_sigaction, so that get_signal_to_deliver() would fill one,
signal_delivered(), handle_signal() and probably setup...frame() -
take one).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index df8d721a9e6f..677102789cf2 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -2368,17 +2368,20 @@ relock: | |||
2368 | } | 2368 | } |
2369 | 2369 | ||
2370 | /** | 2370 | /** |
2371 | * block_sigmask - add @ka's signal mask to current->blocked | 2371 | * signal_delivered - |
2372 | * @ka: action for @signr | 2372 | * @sig: number of signal being delivered |
2373 | * @signr: signal that has been successfully delivered | 2373 | * @info: siginfo_t of signal being delivered |
2374 | * @ka: sigaction setting that chose the handler | ||
2375 | * @regs: user register state | ||
2376 | * @stepping: nonzero if debugger single-step or block-step in use | ||
2374 | * | 2377 | * |
2375 | * This function should be called when a signal has succesfully been | 2378 | * This function should be called when a signal has succesfully been |
2376 | * delivered. It adds the mask of signals for @ka to current->blocked | 2379 | * delivered. It updates the blocked signals accordingly (@ka->sa.sa_mask |
2377 | * so that they are blocked during the execution of the signal | 2380 | * is always blocked, and the signal itself is blocked unless %SA_NODEFER |
2378 | * handler. In addition, @signr will be blocked unless %SA_NODEFER is | 2381 | * is set in @ka->sa.sa_flags. Tracing is notified. |
2379 | * set in @ka->sa.sa_flags. | ||
2380 | */ | 2382 | */ |
2381 | void block_sigmask(struct k_sigaction *ka, int signr) | 2383 | void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, |
2384 | struct pt_regs *regs, int stepping) | ||
2382 | { | 2385 | { |
2383 | sigset_t blocked; | 2386 | sigset_t blocked; |
2384 | 2387 | ||
@@ -2390,8 +2393,9 @@ void block_sigmask(struct k_sigaction *ka, int signr) | |||
2390 | 2393 | ||
2391 | sigorsets(&blocked, ¤t->blocked, &ka->sa.sa_mask); | 2394 | sigorsets(&blocked, ¤t->blocked, &ka->sa.sa_mask); |
2392 | if (!(ka->sa.sa_flags & SA_NODEFER)) | 2395 | if (!(ka->sa.sa_flags & SA_NODEFER)) |
2393 | sigaddset(&blocked, signr); | 2396 | sigaddset(&blocked, sig); |
2394 | set_current_blocked(&blocked); | 2397 | set_current_blocked(&blocked); |
2398 | tracehook_signal_handler(sig, info, ka, regs, stepping); | ||
2395 | } | 2399 | } |
2396 | 2400 | ||
2397 | /* | 2401 | /* |