1 #ifndef _SIGNAL_H
2 #define _SIGNAL_H
3
4 #include <sys/types.h>
5
6 typedef int sig_atomic_t;
7 typedef unsigned int sigset_t;
8
9 #define _NSIG 32
10 #define NSIG _NSIG
11
12 #define SIGHUP 1
13 #define SIGINT 2
14 #define SIGQUIT 3
15 #define SIGILL 4
16 #define SIGTRAP 5
17 #define SIGABRT 6
18 #define SIGIOT 6
19 #define SIGUNUSED 7
20 #define SIGFPE 8
21 #define SIGKILL 9
22 #define SIGUSR1 10
23 #define SIGSEGV 11
24 #define SIGUSR2 12
25 #define SIGPIPE 13
26 #define SIGALRM 14
27 #define SIGTERM 15
28 #define SIGSTKFLT 16
29 #define SIGCHLD 17
30 #define SIGCONT 18
31 #define SIGSTOP 19
32 #define SIGTSTP 20
33 #define SIGTTIN 21
34 #define SIGTTOU 22
35
36
37
38
39
40
41
42
43
44
45
46
47
48 #define SIGVTALRM 26
49 #define SIGPROF 27
50
51 #define SIGWINCH 28
52
53
54
55
56
57
58 #define SA_NOCLDSTOP 1
59 #define SA_INTERRUPT 0x20000000
60 #define SA_NOMASK 0x40000000
61 #define SA_ONESHOT 0x80000000
62
63 #define SIG_BLOCK 0
64 #define SIG_UNBLOCK 1
65 #define SIG_SETMASK 2
66
67 #define SIG_DFL ((void (*)(int))0)
68 #define SIG_IGN ((void (*)(int))1)
69 #define SIG_ERR ((void (*)(int))-1)
70
71 #ifdef notdef
72 #define sigemptyset(mask) ((*(mask) = 0), 1)
73 #define sigfillset(mask) ((*(mask) = ~0), 1)
74 #endif
75
76 struct sigaction {
77 void (*sa_handler)(int);
78 sigset_t sa_mask;
79 int sa_flags;
80 void (*sa_restorer)(void);
81 };
82
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
86
87 void (*signal(int _sig, void (*_func)(int)))(int);
88 int raise(int sig);
89 int kill(pid_t pid, int sig);
90 int sigaddset(sigset_t *mask, int signo);
91 int sigdelset(sigset_t *mask, int signo);
92 int sigemptyset(sigset_t *mask);
93 int sigfillset(sigset_t *mask);
94 int sigismember(sigset_t *mask, int signo);
95 int sigpending(sigset_t *set);
96 int sigprocmask(int how, sigset_t *set, sigset_t *oldset);
97 int sigsuspend(sigset_t *sigmask);
98 int sigaction(int sig, struct sigaction *act, struct sigaction *oldact);
99
100 #ifdef __cplusplus
101 }
102 #endif
103
104 #endif