diff options
author | rofl0r <retnyg@gmx.net> | 2012-12-06 20:51:32 +0100 |
---|---|---|
committer | rofl0r <retnyg@gmx.net> | 2012-12-06 20:51:32 +0100 |
commit | a1990e1e833624b26b0ca55aa7fce56bb594f814 (patch) | |
tree | af29621ea66bbf70de42e531669e892bf634562f /src/signal | |
parent | 0182c287ca223f7f881c6a9f1d2413cc747460d9 (diff) | |
download | musl-a1990e1e833624b26b0ca55aa7fce56bb594f814.tar.gz musl-a1990e1e833624b26b0ca55aa7fce56bb594f814.tar.bz2 musl-a1990e1e833624b26b0ca55aa7fce56bb594f814.tar.xz musl-a1990e1e833624b26b0ca55aa7fce56bb594f814.zip |
add sigandset and sigorset (needed for qemu)
Diffstat (limited to 'src/signal')
-rw-r--r-- | src/signal/sigandset.c | 17 | ||||
-rw-r--r-- | src/signal/sigorset.c | 17 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/signal/sigandset.c b/src/signal/sigandset.c new file mode 100644 index 00000000..f62c7fec --- /dev/null +++ b/src/signal/sigandset.c @@ -0,0 +1,17 @@ +#define _GNU_SOURCE +#include <signal.h> +#include <errno.h> + +#define SST_SIZE (sizeof(sigset_t) / sizeof(long)) + +int sigandset(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; +} + diff --git a/src/signal/sigorset.c b/src/signal/sigorset.c new file mode 100644 index 00000000..232075b1 --- /dev/null +++ b/src/signal/sigorset.c @@ -0,0 +1,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; +} + |