From fb80e047cc7d0b900445ca6ce38f10199dafd98b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 12 Sep 2011 00:00:30 -0400 Subject: [PATCH] implement gnu sigisemptyset --- include/signal.h | 1 + src/signal/sigisemptyset.c | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 src/signal/sigisemptyset.c diff --git a/include/signal.h b/include/signal.h index 5f39ddbd..9cebddd9 100644 --- a/include/signal.h +++ b/include/signal.h @@ -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 index 00000000..e2410514 --- /dev/null +++ b/src/signal/sigisemptyset.c @@ -0,0 +1,9 @@ +#define _GNU_SOURCE +#include +#include + +int sigisemptyset(const sigset_t *set) +{ + static const sigset_t zeroset; + return !memcmp(set, &zeroset, 8); +} -- 2.25.1