summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/signal/sigismember.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/signal/sigismember.c')
-rw-r--r--libc-top-half/musl/src/signal/sigismember.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/signal/sigismember.c b/libc-top-half/musl/src/signal/sigismember.c
new file mode 100644
index 0000000..ab87d62
--- /dev/null
+++ b/libc-top-half/musl/src/signal/sigismember.c
@@ -0,0 +1,8 @@
+#include <signal.h>
+
+int sigismember(const sigset_t *set, int sig)
+{
+ unsigned s = sig-1;
+ if (s >= _NSIG-1) return 0;
+ return !!(set->__bits[s/8/sizeof *set->__bits] & 1UL<<(s&8*sizeof *set->__bits-1));
+}