summaryrefslogtreecommitdiff
path: root/src/libstddjb/sig_block.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/sig_block.c')
-rw-r--r--src/libstddjb/sig_block.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstddjb/sig_block.c b/src/libstddjb/sig_block.c
new file mode 100644
index 0000000..89ae51f
--- /dev/null
+++ b/src/libstddjb/sig_block.c
@@ -0,0 +1,12 @@
+/* ISC license. */
+
+#include <signal.h>
+#include <skalibs/sig.h>
+
+void sig_block (int sig)
+{
+ sigset_t ss ;
+ sigemptyset(&ss) ;
+ sigaddset(&ss, sig) ;
+ sigprocmask(SIG_BLOCK, &ss, 0) ;
+}