summaryrefslogtreecommitdiff
path: root/src/signal/sigaddset.c
blob: fae413e116c8dfa07115d9bb1c450ebdd4750eb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "sys/types.h"
#include <signal.h>
#include "limits.h"

int sigaddset(sigset_t * set, int 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;
}
/*
POSIX(1)
*/