1 /* This file is to be kept in sync (well, reasonably so, it's quite
2    different) with newlib/libc/include/sys/signal.h on which it is
3    based, except values used or returned by syscalls must be those of
4    the Linux/CRIS kernel.  */
5 
6 /* sys/signal.h */
7 
8 #ifndef _SYS_SIGNAL_H
9 #define _SYS_SIGNAL_H
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include "_ansi.h"
15 
16 typedef unsigned long sigset_t;
17 
18 /* Adjusted to linux, has unused sa_restorer field and unsigned long
19    sa_flags; relatively unimportant though.  */
20 /* Type of a signal handler.  */
21 typedef void (*__sighandler_t)(int);
22 
23 /* The type used in newlib sources.  */
24 typedef __sighandler_t _sig_func_ptr;
25 
26 struct sigaction {
27 	__sighandler_t sa_handler;
28 	sigset_t sa_mask;
29 	unsigned long sa_flags;
30 	void (*sa_restorer)(void);
31 };
32 
33 /* Adjusted to glibc; other values.  */
34 #define SA_NOCLDSTOP 1	/* only value supported now for sa_flags */
35 #define SIG_SETMASK 2	/* set mask with sigprocmask() */
36 #define SIG_BLOCK 0	/* set of signals to block */
37 #define SIG_UNBLOCK 1	/* set of signals to, well, unblock */
38 
39 /* These depend upon the type of sigset_t, which right now
40    is always a long.. They're in the POSIX namespace, but
41    are not ANSI. */
42 #define sigaddset(what,sig) (*(what) |= (1<<(sig)))
43 #define sigemptyset(what)   (*(what) = 0)
44 
45 int sigprocmask (int __how, const sigset_t *__a, sigset_t *__b);
46 
47 /* The first argument is really a pid_t, but that's just a typedef'd
48    int, so let's avoid requiring sys/types only for this declaration.  */
49 int kill (int, int);
50 
51 #define SIGHUP		 1
52 #define SIGINT		 2
53 #define SIGQUIT		 3
54 #define SIGILL		 4
55 #define SIGTRAP		 5
56 #define SIGABRT		 6
57 #define SIGIOT		 6
58 #define SIGBUS		 7
59 #define SIGFPE		 8
60 #define SIGKILL		 9
61 #define SIGUSR1		10
62 #define SIGSEGV		11
63 #define SIGUSR2		12
64 #define SIGPIPE		13
65 #define SIGALRM		14
66 #define SIGTERM		15
67 #define SIGSTKFLT	16
68 #define SIGCHLD		17
69 #define SIGCONT		18
70 #define SIGSTOP		19
71 #define SIGTSTP		20
72 #define SIGTTIN		21
73 #define SIGTTOU		22
74 #define SIGURG		23
75 #define SIGXCPU		24
76 #define SIGXFSZ		25
77 #define SIGVTALRM	26
78 #define SIGPROF		27
79 #define SIGWINCH	28
80 #define SIGIO		29
81 #define SIGPOLL		SIGIO
82 #define SIGPWR		30
83 #define	NSIG 31
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 #ifndef _SIGNAL_H_
89 /* Some applications take advantage of the fact that <sys/signal.h>
90  * and <signal.h> are equivalent in glibc.  Allow for that here.  */
91 #include <signal.h>
92 #endif
93 #endif /* _SYS_SIGNAL_H */
94