summaryrefslogtreecommitdiff
path: root/lib/sigevent.h
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-09-02 16:25:00 -0400
committerMark Stapp <mjs@voltanet.io>2020-10-26 16:46:40 -0400
commit976c5cc134bb96f309479d281d771d70dbe41f13 (patch)
treec1ec4e9566e8844566afa1e220b52257a415e500 /lib/sigevent.h
parentd878460c8cc9a60200843f127b2d22cebfb42229 (diff)
lib: add sigevent_check api
Add an api that blocks application-handled signals (SIGINT, SIGTERM, e.g.) then tests whether any signals have been received. This helps to manage a race between signal reception and the poll call in the main event loop. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'lib/sigevent.h')
-rw-r--r--lib/sigevent.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sigevent.h b/lib/sigevent.h
index a0ad88fcaa..4a39b22889 100644
--- a/lib/sigevent.h
+++ b/lib/sigevent.h
@@ -48,6 +48,15 @@ struct quagga_signal_t {
extern void signal_init(struct thread_master *m, int sigc,
struct quagga_signal_t *signals);
+
+/*
+ * Check whether any signals have been received and are pending. This is done
+ * with the application's key signals blocked. The complete set of signals
+ * is returned in 'setp', so the caller can restore them when appropriate.
+ * If there are pending signals, returns 'true', 'false' otherwise.
+ */
+bool frr_sigevent_check(sigset_t *setp);
+
/* check whether there are signals to handle, process any found */
extern int quagga_sigevent_process(void);