Merge branch 'signal-dev'
[lunaix-os.git] / lunaix-os / includes / lunaix / signal.h
1 #ifndef __LUNAIX_SIGNAL_H
2 #define __LUNAIX_SIGNAL_H
3
4 #include <lunaix/syscall.h>
5
6 #define _SIG_NUM 8
7
8 #define _SIG_PENDING(bitmap, sig) ((bitmap) & (1 << (sig)))
9
10 #define _SIGSEGV 0
11 #define _SIGALRM 1
12 #define _SIGCHLD 2
13 #define _SIGCLD _SIGCHLD
14 #define _SIGINT 3
15 #define _SIGKILL 4
16 #define _SIGSTOP 5
17 #define _SIGCONT 6
18
19 #define __SIGNAL(num) (1 << (num))
20 #define __SET_SIGNAL(bitmap, num) (bitmap = bitmap | __SIGNAL(num))
21
22 #define _SIGNAL_UNMASKABLE (__SIGNAL(_SIGKILL) | __SIGNAL(_SIGSTOP))
23
24 #define _SIG_BLOCK 1
25 #define _SIG_UNBLOCK 2
26 #define _SIG_SETMASK 3
27
28 typedef unsigned int sigset_t;
29 typedef void (*sighandler_t)(int);
30
31 __LXSYSCALL2(int, signal, int, signum, sighandler_t, handler);
32
33 #endif /* __LUNAIX_SIGNAL_H */