|
|
@@ -2318,6 +2318,27 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,
|
|
|
return signr;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * block_sigmask - add @ka's signal mask to current->blocked
|
|
|
+ * @ka: action for @signr
|
|
|
+ * @signr: signal that has been successfully delivered
|
|
|
+ *
|
|
|
+ * This function should be called when a signal has succesfully been
|
|
|
+ * delivered. It adds the mask of signals for @ka to current->blocked
|
|
|
+ * so that they are blocked during the execution of the signal
|
|
|
+ * handler. In addition, @signr will be blocked unless %SA_NODEFER is
|
|
|
+ * set in @ka->sa.sa_flags.
|
|
|
+ */
|
|
|
+void block_sigmask(struct k_sigaction *ka, int signr)
|
|
|
+{
|
|
|
+ sigset_t blocked;
|
|
|
+
|
|
|
+ sigorsets(&blocked, ¤t->blocked, &ka->sa.sa_mask);
|
|
|
+ if (!(ka->sa.sa_flags & SA_NODEFER))
|
|
|
+ sigaddset(&blocked, signr);
|
|
|
+ set_current_blocked(&blocked);
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* It could be that complete_signal() picked us to notify about the
|
|
|
* group-wide signal. Other threads should be notified now to take
|