implement gnu sigisemptyset
authorRich Felker <dalias@aerifal.cx>
Mon, 12 Sep 2011 04:00:30 +0000 (00:00 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 12 Sep 2011 04:00:30 +0000 (00:00 -0400)
include/signal.h
src/signal/sigisemptyset.c [new file with mode: 0644]

index 5f39ddbd3943e65fa7b2cb11e7c3b8fea402a056..9cebddd976133a4d980d8ab3d72a1442a4bbc00b 100644 (file)
@@ -106,6 +106,7 @@ void (*sigset(int, void (*)(int)))(int);
 #ifdef _GNU_SOURCE
 typedef void (*sighandler_t)(int);
 void (*bsd_signal(int, void (*)(int)))(int);
+int sigisemptyset(const sigset_t *);
 #define SA_NOMASK SA_NODEFER
 #endif
 
diff --git a/src/signal/sigisemptyset.c b/src/signal/sigisemptyset.c
new file mode 100644 (file)
index 0000000..e241051
--- /dev/null
@@ -0,0 +1,9 @@
+#define _GNU_SOURCE
+#include <signal.h>
+#include <string.h>
+
+int sigisemptyset(const sigset_t *set)
+{
+       static const sigset_t zeroset;
+       return !memcmp(set, &zeroset, 8);
+}