1 /*
2 Copyright (C) 2001, 2004, 2005 Axis Communications AB.
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8 
9 1. Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11 
12 2. Neither the name of Axis Communications nor the names of its
13 contributors may be used to endorse or promote products derived
14 from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
17 AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
20 COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
26 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 POSSIBILITY OF SUCH DAMAGE.
28  */
29 /* This file is to be kept in sync (well, reasonably so, it's quite
30    different) with newlib/libc/include/sys/signal.h on which it is
31    based, except values used or returned by syscalls must be those of
32    the Linux/CRIS kernel.  */
33 
34 /* sys/signal.h */
35 
36 #ifndef _SYS_SIGNAL_H
37 #define _SYS_SIGNAL_H
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 #include "_ansi.h"
43 
44 typedef unsigned long sigset_t;
45 
46 /* Adjusted to linux, has unused sa_restorer field and unsigned long
47    sa_flags; relatively unimportant though.  */
48 /* Type of a signal handler.  */
49 typedef void (*__sighandler_t)(int);
50 
51 /* The type used in newlib sources.  */
52 typedef __sighandler_t _sig_func_ptr;
53 
54 struct sigaction {
55 	__sighandler_t sa_handler;
56 	sigset_t sa_mask;
57 	unsigned long sa_flags;
58 	void (*sa_restorer)(void);
59 };
60 
61 /* Adjusted to glibc; other values.  */
62 #define SA_NOCLDSTOP 1	/* only value supported now for sa_flags */
63 #define SIG_SETMASK 2	/* set mask with sigprocmask() */
64 #define SIG_BLOCK 0	/* set of signals to block */
65 #define SIG_UNBLOCK 1	/* set of signals to, well, unblock */
66 
67 /* These depend upon the type of sigset_t, which right now
68    is always a long.. They're in the POSIX namespace, but
69    are not ANSI. */
70 #define sigaddset(what,sig) (*(what) |= (1<<(sig)))
71 #define sigemptyset(what)   (*(what) = 0)
72 
73 int sigprocmask (int __how, const sigset_t *__a, sigset_t *__b);
74 
75 /* The first argument is really a pid_t, but that's just a typedef'd
76    int, so let's avoid requiring sys/types only for this declaration.  */
77 int kill (int, int);
78 
79 #define SIGHUP		 1
80 #define SIGINT		 2
81 #define SIGQUIT		 3
82 #define SIGILL		 4
83 #define SIGTRAP		 5
84 #define SIGABRT		 6
85 #define SIGIOT		 6
86 #define SIGBUS		 7
87 #define SIGFPE		 8
88 #define SIGKILL		 9
89 #define SIGUSR1		10
90 #define SIGSEGV		11
91 #define SIGUSR2		12
92 #define SIGPIPE		13
93 #define SIGALRM		14
94 #define SIGTERM		15
95 #define SIGSTKFLT	16
96 #define SIGCHLD		17
97 #define SIGCONT		18
98 #define SIGSTOP		19
99 #define SIGTSTP		20
100 #define SIGTTIN		21
101 #define SIGTTOU		22
102 #define SIGURG		23
103 #define SIGXCPU		24
104 #define SIGXFSZ		25
105 #define SIGVTALRM	26
106 #define SIGPROF		27
107 #define SIGWINCH	28
108 #define SIGIO		29
109 #define SIGPOLL		SIGIO
110 #define SIGPWR		30
111 #define	NSIG 31
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 #ifndef _SIGNAL_H_
117 /* Some applications take advantage of the fact that <sys/signal.h>
118  * and <signal.h> are equivalent in glibc.  Allow for that here.  */
119 #include <signal.h>
120 #endif
121 #endif /* _SYS_SIGNAL_H */
122