| @@ -1,239 +1,241 @@ | | | @@ -1,239 +1,241 @@ |
1 | /* $NetBSD: signal.h,v 1.65 2009/12/09 20:26:12 drochner Exp $ */ | | 1 | /* $NetBSD: signal.h,v 1.66 2011/01/10 04:38:37 christos Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1982, 1986, 1989, 1991, 1993 | | 4 | * Copyright (c) 1982, 1986, 1989, 1991, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * (c) UNIX System Laboratories, Inc. | | 6 | * (c) UNIX System Laboratories, Inc. |
7 | * All or some portions of this file are derived from material licensed | | 7 | * All or some portions of this file are derived from material licensed |
8 | * to the University of California by American Telephone and Telegraph | | 8 | * to the University of California by American Telephone and Telegraph |
9 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | | 9 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with |
10 | * the permission of UNIX System Laboratories, Inc. | | 10 | * the permission of UNIX System Laboratories, Inc. |
11 | * | | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | | 12 | * Redistribution and use in source and binary forms, with or without |
13 | * modification, are permitted provided that the following conditions | | 13 | * modification, are permitted provided that the following conditions |
14 | * are met: | | 14 | * are met: |
15 | * 1. Redistributions of source code must retain the above copyright | | 15 | * 1. Redistributions of source code must retain the above copyright |
16 | * notice, this list of conditions and the following disclaimer. | | 16 | * notice, this list of conditions and the following disclaimer. |
17 | * 2. Redistributions in binary form must reproduce the above copyright | | 17 | * 2. Redistributions in binary form must reproduce the above copyright |
18 | * notice, this list of conditions and the following disclaimer in the | | 18 | * notice, this list of conditions and the following disclaimer in the |
19 | * documentation and/or other materials provided with the distribution. | | 19 | * documentation and/or other materials provided with the distribution. |
20 | * 3. Neither the name of the University nor the names of its contributors | | 20 | * 3. Neither the name of the University nor the names of its contributors |
21 | * may be used to endorse or promote products derived from this software | | 21 | * may be used to endorse or promote products derived from this software |
22 | * without specific prior written permission. | | 22 | * without specific prior written permission. |
23 | * | | 23 | * |
24 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | | 24 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | * SUCH DAMAGE. | | 34 | * SUCH DAMAGE. |
35 | * | | 35 | * |
36 | * @(#)signal.h 8.4 (Berkeley) 5/4/95 | | 36 | * @(#)signal.h 8.4 (Berkeley) 5/4/95 |
37 | */ | | 37 | */ |
38 | | | 38 | |
39 | #ifndef _SYS_SIGNAL_H_ | | 39 | #ifndef _SYS_SIGNAL_H_ |
40 | #define _SYS_SIGNAL_H_ | | 40 | #define _SYS_SIGNAL_H_ |
41 | | | 41 | |
42 | #include <sys/featuretest.h> | | 42 | #include <sys/featuretest.h> |
43 | #include <sys/sigtypes.h> | | 43 | #include <sys/sigtypes.h> |
44 | | | 44 | |
45 | #define _NSIG 64 | | 45 | #define _NSIG 64 |
46 | | | 46 | |
47 | #if defined(_NETBSD_SOURCE) | | 47 | #if defined(_NETBSD_SOURCE) |
48 | #define NSIG _NSIG | | 48 | #define NSIG _NSIG |
49 | | | 49 | |
50 | #endif /* _NETBSD_SOURCE */ | | 50 | #endif /* _NETBSD_SOURCE */ |
51 | | | 51 | |
52 | #define SIGHUP 1 /* hangup */ | | 52 | #define SIGHUP 1 /* hangup */ |
53 | #define SIGINT 2 /* interrupt */ | | 53 | #define SIGINT 2 /* interrupt */ |
54 | #define SIGQUIT 3 /* quit */ | | 54 | #define SIGQUIT 3 /* quit */ |
55 | #define SIGILL 4 /* illegal instruction (not reset when caught) */ | | 55 | #define SIGILL 4 /* illegal instruction (not reset when caught) */ |
56 | #define SIGTRAP 5 /* trace trap (not reset when caught) */ | | 56 | #define SIGTRAP 5 /* trace trap (not reset when caught) */ |
57 | #define SIGABRT 6 /* abort() */ | | 57 | #define SIGABRT 6 /* abort() */ |
58 | #define SIGIOT SIGABRT /* compatibility */ | | 58 | #define SIGIOT SIGABRT /* compatibility */ |
59 | #define SIGEMT 7 /* EMT instruction */ | | 59 | #define SIGEMT 7 /* EMT instruction */ |
60 | #define SIGFPE 8 /* floating point exception */ | | 60 | #define SIGFPE 8 /* floating point exception */ |
61 | #define SIGKILL 9 /* kill (cannot be caught or ignored) */ | | 61 | #define SIGKILL 9 /* kill (cannot be caught or ignored) */ |
62 | #define SIGBUS 10 /* bus error */ | | 62 | #define SIGBUS 10 /* bus error */ |
63 | #define SIGSEGV 11 /* segmentation violation */ | | 63 | #define SIGSEGV 11 /* segmentation violation */ |
64 | #define SIGSYS 12 /* bad argument to system call */ | | 64 | #define SIGSYS 12 /* bad argument to system call */ |
65 | #define SIGPIPE 13 /* write on a pipe with no one to read it */ | | 65 | #define SIGPIPE 13 /* write on a pipe with no one to read it */ |
66 | #define SIGALRM 14 /* alarm clock */ | | 66 | #define SIGALRM 14 /* alarm clock */ |
67 | #define SIGTERM 15 /* software termination signal from kill */ | | 67 | #define SIGTERM 15 /* software termination signal from kill */ |
68 | #define SIGURG 16 /* urgent condition on IO channel */ | | 68 | #define SIGURG 16 /* urgent condition on IO channel */ |
69 | #define SIGSTOP 17 /* sendable stop signal not from tty */ | | 69 | #define SIGSTOP 17 /* sendable stop signal not from tty */ |
70 | #define SIGTSTP 18 /* stop signal from tty */ | | 70 | #define SIGTSTP 18 /* stop signal from tty */ |
71 | #define SIGCONT 19 /* continue a stopped process */ | | 71 | #define SIGCONT 19 /* continue a stopped process */ |
72 | #define SIGCHLD 20 /* to parent on child stop or exit */ | | 72 | #define SIGCHLD 20 /* to parent on child stop or exit */ |
73 | #define SIGTTIN 21 /* to readers pgrp upon background tty read */ | | 73 | #define SIGTTIN 21 /* to readers pgrp upon background tty read */ |
74 | #define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ | | 74 | #define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ |
75 | #define SIGIO 23 /* input/output possible signal */ | | 75 | #define SIGIO 23 /* input/output possible signal */ |
76 | #define SIGXCPU 24 /* exceeded CPU time limit */ | | 76 | #define SIGXCPU 24 /* exceeded CPU time limit */ |
77 | #define SIGXFSZ 25 /* exceeded file size limit */ | | 77 | #define SIGXFSZ 25 /* exceeded file size limit */ |
78 | #define SIGVTALRM 26 /* virtual time alarm */ | | 78 | #define SIGVTALRM 26 /* virtual time alarm */ |
79 | #define SIGPROF 27 /* profiling time alarm */ | | 79 | #define SIGPROF 27 /* profiling time alarm */ |
80 | #define SIGWINCH 28 /* window size changes */ | | 80 | #define SIGWINCH 28 /* window size changes */ |
81 | #define SIGINFO 29 /* information request */ | | 81 | #define SIGINFO 29 /* information request */ |
82 | #define SIGUSR1 30 /* user defined signal 1 */ | | 82 | #define SIGUSR1 30 /* user defined signal 1 */ |
83 | #define SIGUSR2 31 /* user defined signal 2 */ | | 83 | #define SIGUSR2 31 /* user defined signal 2 */ |
84 | #define SIGPWR 32 /* power fail/restart (not reset when caught) */ | | 84 | #define SIGPWR 32 /* power fail/restart (not reset when caught) */ |
85 | #ifdef _KERNEL | | 85 | #ifdef _KERNEL |
86 | #define SIGRTMIN 33 /* Kernel only; not exposed to userland yet */ | | 86 | #define SIGRTMIN 33 /* Kernel only; not exposed to userland yet */ |
87 | #define SIGRTMAX 63 /* Kernel only; not exposed to userland yet */ | | 87 | #define SIGRTMAX 63 /* Kernel only; not exposed to userland yet */ |
88 | #endif | | 88 | #endif |
89 | | | 89 | |
90 | #ifndef _KERNEL | | 90 | #ifndef _KERNEL |
91 | #include <sys/cdefs.h> | | 91 | #include <sys/cdefs.h> |
92 | #endif | | 92 | #endif |
93 | | | 93 | |
94 | #define SIG_DFL ((void (*)(int)) 0) | | 94 | #define SIG_DFL ((void (*)(int)) 0) |
95 | #define SIG_IGN ((void (*)(int)) 1) | | 95 | #define SIG_IGN ((void (*)(int)) 1) |
96 | #define SIG_ERR ((void (*)(int)) -1) | | 96 | #define SIG_ERR ((void (*)(int)) -1) |
97 | #define SIG_HOLD ((void (*)(int)) 3) | | 97 | #define SIG_HOLD ((void (*)(int)) 3) |
98 | | | 98 | |
99 | #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ | | 99 | #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ |
100 | defined(_NETBSD_SOURCE) | | 100 | defined(_NETBSD_SOURCE) |
101 | | | 101 | |
102 | #ifdef _KERNEL | | 102 | #ifdef _KERNEL |
103 | #define sigaddset(s, n) __sigaddset(s, n) | | 103 | #define sigaddset(s, n) __sigaddset(s, n) |
104 | #define sigdelset(s, n) __sigdelset(s, n) | | 104 | #define sigdelset(s, n) __sigdelset(s, n) |
105 | #define sigismember(s, n) __sigismember(s, n) | | 105 | #define sigismember(s, n) __sigismember(s, n) |
106 | #define sigemptyset(s) __sigemptyset(s) | | 106 | #define sigemptyset(s) __sigemptyset(s) |
107 | #define sigfillset(s) __sigfillset(s) | | 107 | #define sigfillset(s) __sigfillset(s) |
108 | #define sigplusset(s, t) __sigplusset(s, t) | | 108 | #define sigplusset(s, t) __sigplusset(s, t) |
109 | #define sigminusset(s, t) __sigminusset(s, t) | | 109 | #define sigminusset(s, t) __sigminusset(s, t) |
110 | #endif /* _KERNEL */ | | 110 | #endif /* _KERNEL */ |
111 | | | 111 | |
112 | #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \ | | 112 | #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \ |
113 | defined(_NETBSD_SOURCE) | | 113 | defined(_NETBSD_SOURCE) |
114 | #include <sys/siginfo.h> | | 114 | #include <sys/siginfo.h> |
115 | #endif | | 115 | #endif |
116 | | | 116 | |
117 | #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \ | | 117 | #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \ |
118 | (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE) | | 118 | (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE) |
119 | #include <sys/ucontext.h> | | 119 | #include <sys/ucontext.h> |
120 | #endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */ | | 120 | #endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */ |
121 | | | 121 | |
122 | /* | | 122 | /* |
123 | * Signal vector "template" used in sigaction call. | | 123 | * Signal vector "template" used in sigaction call. |
124 | */ | | 124 | */ |
125 | struct sigaction { | | 125 | struct sigaction { |
126 | union { | | 126 | union { |
127 | void (*_sa_handler)(int); | | 127 | void (*_sa_handler)(int); |
128 | #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \ | | 128 | #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \ |
129 | defined(_NETBSD_SOURCE) | | 129 | defined(_NETBSD_SOURCE) |
130 | void (*_sa_sigaction)(int, siginfo_t *, void *); | | 130 | void (*_sa_sigaction)(int, siginfo_t *, void *); |
131 | #endif | | 131 | #endif |
132 | } _sa_u; /* signal handler */ | | 132 | } _sa_u; /* signal handler */ |
133 | sigset_t sa_mask; /* signal mask to apply */ | | 133 | sigset_t sa_mask; /* signal mask to apply */ |
134 | int sa_flags; /* see signal options below */ | | 134 | int sa_flags; /* see signal options below */ |
135 | }; | | 135 | }; |
136 | | | 136 | |
137 | #define sa_handler _sa_u._sa_handler | | 137 | #define sa_handler _sa_u._sa_handler |
138 | #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \ | | 138 | #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \ |
139 | defined(_NETBSD_SOURCE) | | 139 | defined(_NETBSD_SOURCE) |
140 | #define sa_sigaction _sa_u._sa_sigaction | | 140 | #define sa_sigaction _sa_u._sa_sigaction |
141 | #endif | | 141 | #endif |
142 | | | 142 | |
143 | #include <machine/signal.h> /* sigcontext; codes for SIGILL, SIGFPE */ | | 143 | #include <machine/signal.h> /* sigcontext; codes for SIGILL, SIGFPE */ |
144 | | | 144 | |
145 | #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \ | | 145 | #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \ |
146 | (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE) | | 146 | (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE) |
147 | #define SA_ONSTACK 0x0001 /* take signal on signal stack */ | | 147 | #define SA_ONSTACK 0x0001 /* take signal on signal stack */ |
148 | #define SA_RESTART 0x0002 /* restart system call on signal return */ | | 148 | #define SA_RESTART 0x0002 /* restart system call on signal return */ |
149 | #define SA_RESETHAND 0x0004 /* reset to SIG_DFL when taking signal */ | | 149 | #define SA_RESETHAND 0x0004 /* reset to SIG_DFL when taking signal */ |
150 | #define SA_NODEFER 0x0010 /* don't mask the signal we're delivering */ | | 150 | #define SA_NODEFER 0x0010 /* don't mask the signal we're delivering */ |
151 | #endif /* _XOPEN_SOURCE_EXTENDED || XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */ | | 151 | #endif /* _XOPEN_SOURCE_EXTENDED || XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */ |
152 | /* Only valid for SIGCHLD. */ | | 152 | /* Only valid for SIGCHLD. */ |
153 | #define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */ | | 153 | #define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */ |
154 | #define SA_NOCLDWAIT 0x0020 /* do not generate zombies on unwaited child */ | | 154 | #define SA_NOCLDWAIT 0x0020 /* do not generate zombies on unwaited child */ |
155 | #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \ | | 155 | #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \ |
156 | defined(_NETBSD_SOURCE) | | 156 | defined(_NETBSD_SOURCE) |
157 | #define SA_SIGINFO 0x0040 /* take sa_sigaction handler */ | | 157 | #define SA_SIGINFO 0x0040 /* take sa_sigaction handler */ |
158 | #endif /* (_POSIX_C_SOURCE - 0) >= 199309L || ... */ | | 158 | #endif /* (_POSIX_C_SOURCE - 0) >= 199309L || ... */ |
159 | #if defined(_NETBSD_SOURCE) | | 159 | #if defined(_NETBSD_SOURCE) |
160 | #define SA_NOKERNINFO 0x0080 /* siginfo does not print kernel info on tty */ | | 160 | #define SA_NOKERNINFO 0x0080 /* siginfo does not print kernel info on tty */ |
161 | #endif /*_NETBSD_SOURCE */ | | 161 | #endif /*_NETBSD_SOURCE */ |
162 | #ifdef _KERNEL | | 162 | #ifdef _KERNEL |
163 | #define SA_ALLBITS 0x00ff | | 163 | #define SA_ALLBITS 0x00ff |
164 | #endif | | 164 | #endif |
165 | | | 165 | |
166 | /* | | 166 | /* |
167 | * Flags for sigprocmask(): | | 167 | * Flags for sigprocmask(): |
168 | */ | | 168 | */ |
169 | #define SIG_BLOCK 1 /* block specified signal set */ | | 169 | #define SIG_BLOCK 1 /* block specified signal set */ |
170 | #define SIG_UNBLOCK 2 /* unblock specified signal set */ | | 170 | #define SIG_UNBLOCK 2 /* unblock specified signal set */ |
171 | #define SIG_SETMASK 3 /* set specified signal set */ | | 171 | #define SIG_SETMASK 3 /* set specified signal set */ |
172 | | | 172 | |
173 | #if defined(_NETBSD_SOURCE) | | 173 | #if defined(_NETBSD_SOURCE) |
174 | typedef void (*sig_t)(int); /* type of signal function */ | | 174 | typedef void (*sig_t)(int); /* type of signal function */ |
175 | #endif | | 175 | #endif |
176 | | | 176 | |
177 | #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \ | | 177 | #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \ |
178 | (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE) | | 178 | (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE) |
179 | /* | | 179 | /* |
180 | * Flags used with stack_t/struct sigaltstack. | | 180 | * Flags used with stack_t/struct sigaltstack. |
181 | */ | | 181 | */ |
182 | #define SS_ONSTACK 0x0001 /* take signals on alternate stack */ | | 182 | #define SS_ONSTACK 0x0001 /* take signals on alternate stack */ |
183 | #define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ | | 183 | #define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ |
184 | #ifdef _KERNEL | | 184 | #ifdef _KERNEL |
185 | #define SS_ALLBITS 0x0005 | | 185 | #define SS_ALLBITS 0x0005 |
186 | #endif | | 186 | #endif |
187 | #define MINSIGSTKSZ 8192 /* minimum allowable stack */ | | 187 | #define MINSIGSTKSZ 8192 /* minimum allowable stack */ |
188 | #define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ | | 188 | #define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ |
189 | #endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */ | | 189 | #endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */ |
190 | | | 190 | |
191 | #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \ | | 191 | #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \ |
192 | (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE) | | 192 | (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE) |
193 | /* | | 193 | /* |
194 | * Structure used in sigstack call. | | 194 | * Structure used in sigstack call. |
195 | */ | | 195 | */ |
196 | struct sigstack { | | 196 | struct sigstack { |
197 | void *ss_sp; /* signal stack pointer */ | | 197 | void *ss_sp; /* signal stack pointer */ |
198 | int ss_onstack; /* current status */ | | 198 | int ss_onstack; /* current status */ |
199 | }; | | 199 | }; |
200 | #endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */ | | 200 | #endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */ |
201 | | | 201 | |
202 | #if defined(_NETBSD_SOURCE) && !defined(_KERNEL) | | 202 | #if defined(_NETBSD_SOURCE) && !defined(_KERNEL) |
203 | /* | | 203 | /* |
204 | * Macro for converting signal number to a mask suitable for | | 204 | * Macro for converting signal number to a mask suitable for |
205 | * sigblock(). | | 205 | * sigblock(). |
206 | */ | | 206 | */ |
207 | #define sigmask(n) __sigmask(n) | | 207 | #define sigmask(n) __sigmask(n) |
208 | | | 208 | |
209 | #define BADSIG SIG_ERR | | 209 | #define BADSIG SIG_ERR |
210 | #endif /* _NETBSD_SOURCE */ | | 210 | #endif /* _NETBSD_SOURCE */ |
211 | | | 211 | |
212 | #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \ | | 212 | #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \ |
213 | defined(_NETBSD_SOURCE) | | 213 | defined(_NETBSD_SOURCE) |
214 | struct sigevent { | | 214 | struct sigevent { |
215 | int sigev_notify; | | 215 | int sigev_notify; |
216 | int sigev_signo; | | 216 | int sigev_signo; |
217 | union sigval sigev_value; | | 217 | union sigval sigev_value; |
218 | void (*sigev_notify_function)(union sigval); | | 218 | void (*sigev_notify_function)(union sigval); |
219 | void /* pthread_attr_t */ *sigev_notify_attributes; | | 219 | void /* pthread_attr_t */ *sigev_notify_attributes; |
220 | }; | | 220 | }; |
221 | | | 221 | |
222 | #define SIGEV_NONE 0 | | 222 | #define SIGEV_NONE 0 |
223 | #define SIGEV_SIGNAL 1 | | 223 | #define SIGEV_SIGNAL 1 |
224 | #define SIGEV_THREAD 2 | | 224 | #define SIGEV_THREAD 2 |
225 | #if defined(_NETBSD_SOURCE) | | 225 | #if defined(_NETBSD_SOURCE) |
226 | #define SIGEV_SA 3 | | 226 | #define SIGEV_SA 3 |
227 | #endif | | 227 | #endif |
228 | #endif /* (_POSIX_C_SOURCE - 0) >= 199309L || ... */ | | 228 | #endif /* (_POSIX_C_SOURCE - 0) >= 199309L || ... */ |
229 | | | 229 | |
230 | #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */ | | 230 | #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */ |
231 | | | 231 | |
232 | /* | | 232 | /* |
233 | * For historical reasons; programs expect signal's return value to be | | 233 | * For historical reasons; programs expect signal's return value to be |
234 | * defined by <sys/signal.h>. | | 234 | * defined by <sys/signal.h>. |
235 | */ | | 235 | */ |
236 | __BEGIN_DECLS | | 236 | __BEGIN_DECLS |
237 | void (*signal(int, void (*)(int)))(int); | | 237 | void (*signal(int, void (*)(int)))(int); |
| | | 238 | int sigqueue(pid_t, int, const union sigval); |
| | | 239 | int sigqueueinfo(pid_t, const siginfo_t *); |
238 | __END_DECLS | | 240 | __END_DECLS |
239 | #endif /* !_SYS_SIGNAL_H_ */ | | 241 | #endif /* !_SYS_SIGNAL_H_ */ |