[project @ 1999-11-26 16:26:32 by simonmar]
[ghc-hetmet.git] / ghc / lib / posix / cbits / signal.c
1 /*
2  * (c) Juan Quintela, Universidade da Corunha 1998
3  * 
4  * wrappers for signal funcions
5  * 
6  * sigset_t is a struct in some UNIXes (LINUX/glibc for instance)
7  * and it is not posible to do the inline (_casm_). These functions 
8  * aren't inline because it causes gcc to run out of registers on x86.
9  *
10  * Ugly casting added by SUP to avoid C compiler warnings about
11  * incompatible pointer types.
12  */
13
14 #include "Rts.h"
15 #include "libposix.h"
16
17 void
18 stg_sigaddset(StgByteArray newset, StgByteArray oldset, int signum)
19 {
20         *((sigset_t *)newset) = *((sigset_t *)oldset);
21         sigaddset((sigset_t *)newset, signum);
22 }
23
24 void
25 stg_sigdelset(StgByteArray newset, StgByteArray oldset, int signum)
26 {
27         *((sigset_t *)newset) = *((sigset_t *)oldset);
28         sigdelset((sigset_t *)newset, signum);
29 }