aboutsummaryrefslogtreecommitdiff
path: root/src/signal/sigdelset.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/signal/sigdelset.c')
-rw-r--r--src/signal/sigdelset.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/signal/sigdelset.c b/src/signal/sigdelset.c
new file mode 100644
index 0000000..14042fb
--- /dev/null
+++ b/src/signal/sigdelset.c
@@ -0,0 +1,13 @@
+#include <signal.h>
+#include <errno.h>
+
+int sigdelset(sigset_t *set, int sig)
+{
+ unsigned s = sig-1;
+ if (s >= 8*sizeof(sigset_t)) {
+ errno = EINVAL;
+ return -1;
+ }
+ set->__bits[s/8/sizeof *set->__bits] &=~(1UL<<(s&8*sizeof *set->__bits-1));
+ return 0;
+}