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
49
50 #define SIGWINCH 28
51
52
53
54
55
56
57 #define SA_NOCLDSTOP 1
58 #define SA_INTERRUPT 0x20000000
59 #define SA_NOMASK 0x40000000
60 #define SA_ONESHOT 0x80000000
61
62 #define SIG_BLOCK 0
63 #define SIG_UNBLOCK 1
64 #define SIG_SETMASK 2
65
66 #define SIG_DFL ((void (*)(int))0)
67 #define SIG_IGN ((void (*)(int))1)
68 #define SIG_ERR ((void (*)(int))-1)
69
70 #ifdef notdef
71 #define sigemptyset(mask) ((*(mask) = 0), 1)
72 #define sigfillset(mask) ((*(mask) = ~0), 1)
73 #endif
74
75 struct sigaction {
76 void (*sa_handler)(int);
77 sigset_t sa_mask;
78 int sa_flags;
79 void (*sa_restorer)(void);
80 };
81
82 void (*signal(int _sig, void (*_func)(int)))(int);
83 int raise(int sig);
84 int kill(pid_t pid, int sig);
85 int sigaddset(sigset_t *mask, int signo);
86 int sigdelset(sigset_t *mask, int signo);
87 int sigemptyset(sigset_t *mask);
88 int sigfillset(sigset_t *mask);
89 int sigismember(sigset_t *mask, int signo);
90 int sigpending(sigset_t *set);
91 int sigprocmask(int how, sigset_t *set, sigset_t *oldset);
92 int sigsuspend(sigset_t *sigmask);
93 int sigaction(int sig, struct sigaction *act, struct sigaction *oldact);
94
95 #endif