diff options
Diffstat (limited to 'src/signal/sigismember.c')
| -rw-r--r-- | src/signal/sigismember.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/signal/sigismember.c b/src/signal/sigismember.c index 5e21cb5c..6d3c1512 100644 --- a/src/signal/sigismember.c +++ b/src/signal/sigismember.c @@ -1,9 +1,16 @@ #include "sys/types.h" #include <signal.h> +#include "limits.h" int sigismember(const sigset_t * set, int signo) { - (void)set; (void)signo; + /* TODO: fail with EINVAL if signo is not a valid signal number */ + + size_t byte = signo % CHAR_BIT; + int bit = signo / CHAR_BIT; + if (set->__bits[byte] & (1 << bit)) { + return 1; + } return 0; } /* |
