summaryrefslogblamecommitdiff
path: root/src/signal/sigorset.c
blob: 232075b1c281504c792264aa8fdc541f50a19507 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                                      
#define _GNU_SOURCE
#include <signal.h>
#include <errno.h>

#define SST_SIZE (sizeof(sigset_t) / sizeof(long))

int sigorset(sigset_t *dest, sigset_t *left, sigset_t *right)
{
	if(!dest || !left || !right) {
		errno = EINVAL;
		return -1;
	}
	unsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;
	for(; i < SST_SIZE; i++) d[i] = l[i] | r[i];
	return 0;
}