diff options
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index bb0efa5705ed..d532f1709fbf 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -2318,6 +2318,27 @@ relock: | |||
2318 | return signr; | 2318 | return signr; |
2319 | } | 2319 | } |
2320 | 2320 | ||
2321 | /** | ||
2322 | * block_sigmask - add @ka's signal mask to current->blocked | ||
2323 | * @ka: action for @signr | ||
2324 | * @signr: signal that has been successfully delivered | ||
2325 | * | ||
2326 | * This function should be called when a signal has succesfully been | ||
2327 | * delivered. It adds the mask of signals for @ka to current->blocked | ||
2328 | * so that they are blocked during the execution of the signal | ||
2329 | * handler. In addition, @signr will be blocked unless %SA_NODEFER is | ||
2330 | * set in @ka->sa.sa_flags. | ||
2331 | */ | ||
2332 | void block_sigmask(struct k_sigaction *ka, int signr) | ||
2333 | { | ||
2334 | sigset_t blocked; | ||
2335 | |||
2336 | sigorsets(&blocked, ¤t->blocked, &ka->sa.sa_mask); | ||
2337 | if (!(ka->sa.sa_flags & SA_NODEFER)) | ||
2338 | sigaddset(&blocked, signr); | ||
2339 | set_current_blocked(&blocked); | ||
2340 | } | ||
2341 | |||
2321 | /* | 2342 | /* |
2322 | * It could be that complete_signal() picked us to notify about the | 2343 | * It could be that complete_signal() picked us to notify about the |
2323 | * group-wide signal. Other threads should be notified now to take | 2344 | * group-wide signal. Other threads should be notified now to take |