summaryrefslogtreecommitdiff
path: root/src/signal/sigaddset.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/signal/sigaddset.c')
-rw-r--r--src/signal/sigaddset.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/signal/sigaddset.c b/src/signal/sigaddset.c
index 81b408f3..fae413e1 100644
--- a/src/signal/sigaddset.c
+++ b/src/signal/sigaddset.c
@@ -1,9 +1,14 @@
#include "sys/types.h"
#include <signal.h>
+#include "limits.h"
int sigaddset(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;
+
+ set->__bits[byte] |= (1 << bit);
return 0;
}
/*