1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | #if !defined _SIGNAL_H && !defined __need_siginfo_t \ |
20 | && !defined __need_sigevent_t |
21 | # error "Never include this file directly. Use <signal.h> instead" |
22 | #endif |
23 | |
24 | #include <bits/wordsize.h> |
25 | |
26 | #if (!defined __have_sigval_t \ |
27 | && (defined _SIGNAL_H || defined __need_siginfo_t \ |
28 | || defined __need_sigevent_t)) |
29 | # define __have_sigval_t 1 |
30 | |
31 | |
32 | typedef union sigval |
33 | { |
34 | int sival_int; |
35 | void *sival_ptr; |
36 | } sigval_t; |
37 | #endif |
38 | |
39 | #if (!defined __have_siginfo_t \ |
40 | && (defined _SIGNAL_H || defined __need_siginfo_t)) |
41 | # define __have_siginfo_t 1 |
42 | |
43 | # define __SI_MAX_SIZE 128 |
44 | # if __WORDSIZE == 64 |
45 | # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) |
46 | # else |
47 | # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) |
48 | # endif |
49 | |
50 | # if defined __x86_64__ && __WORDSIZE == 32 |
51 | |
52 | |
53 | |
54 | |
55 | typedef __clock_t __attribute__ ((__aligned__ (4))) __sigchld_clock_t; |
56 | # define __SI_ALIGNMENT __attribute__ ((__aligned__ (8))) |
57 | # else |
58 | typedef __clock_t __sigchld_clock_t; |
59 | # define __SI_ALIGNMENT |
60 | # endif |
61 | |
62 | typedef struct |
63 | { |
64 | int si_signo; |
65 | int si_errno; |
66 | |
67 | int si_code; |
68 | |
69 | union |
70 | { |
71 | int _pad[__SI_PAD_SIZE]; |
72 | |
73 | |
74 | struct |
75 | { |
76 | __pid_t si_pid; |
77 | __uid_t si_uid; |
78 | } _kill; |
79 | |
80 | |
81 | struct |
82 | { |
83 | int si_tid; |
84 | int si_overrun; |
85 | sigval_t si_sigval; |
86 | } _timer; |
87 | |
88 | |
89 | struct |
90 | { |
91 | __pid_t si_pid; |
92 | __uid_t si_uid; |
93 | sigval_t si_sigval; |
94 | } _rt; |
95 | |
96 | |
97 | struct |
98 | { |
99 | __pid_t si_pid; |
100 | __uid_t si_uid; |
101 | int si_status; |
102 | __sigchld_clock_t si_utime; |
103 | __sigchld_clock_t si_stime; |
104 | } _sigchld; |
105 | |
106 | |
107 | struct |
108 | { |
109 | void *si_addr; |
110 | short int si_addr_lsb; |
111 | struct |
112 | { |
113 | void *_lower; |
114 | void *_upper; |
115 | } si_addr_bnd; |
116 | } _sigfault; |
117 | |
118 | |
119 | struct |
120 | { |
121 | long int si_band; |
122 | int si_fd; |
123 | } _sigpoll; |
124 | |
125 | |
126 | struct |
127 | { |
128 | void *_call_addr; |
129 | int _syscall; |
130 | unsigned int _arch; |
131 | } _sigsys; |
132 | } _sifields; |
133 | } siginfo_t __SI_ALIGNMENT; |
134 | |
135 | |
136 | |
137 | # define si_pid _sifields._kill.si_pid |
138 | # define si_uid _sifields._kill.si_uid |
139 | # define si_timerid _sifields._timer.si_tid |
140 | # define si_overrun _sifields._timer.si_overrun |
141 | # define si_status _sifields._sigchld.si_status |
142 | # define si_utime _sifields._sigchld.si_utime |
143 | # define si_stime _sifields._sigchld.si_stime |
144 | # define si_value _sifields._rt.si_sigval |
145 | # define si_int _sifields._rt.si_sigval.sival_int |
146 | # define si_ptr _sifields._rt.si_sigval.sival_ptr |
147 | # define si_addr _sifields._sigfault.si_addr |
148 | # define si_addr_lsb _sifields._sigfault.si_addr_lsb |
149 | # define si_lower _sifields._sigfault.si_addr_bnd._lower |
150 | # define si_upper _sifields._sigfault.si_addr_bnd._upper |
151 | # define si_band _sifields._sigpoll.si_band |
152 | # define si_fd _sifields._sigpoll.si_fd |
153 | # define si_call_addr _sifields._sigsys._call_addr |
154 | # define si_syscall _sifields._sigsys._syscall |
155 | # define si_arch _sifields._sigsys._arch |
156 | |
157 | |
158 | |
159 | |
160 | enum |
161 | { |
162 | SI_ASYNCNL = -60, |
163 | # define SI_ASYNCNL SI_ASYNCNL |
164 | SI_TKILL = -6, |
165 | # define SI_TKILL SI_TKILL |
166 | SI_SIGIO, |
167 | # define SI_SIGIO SI_SIGIO |
168 | SI_ASYNCIO, |
169 | # define SI_ASYNCIO SI_ASYNCIO |
170 | SI_MESGQ, |
171 | # define SI_MESGQ SI_MESGQ |
172 | SI_TIMER, |
173 | # define SI_TIMER SI_TIMER |
174 | SI_QUEUE, |
175 | # define SI_QUEUE SI_QUEUE |
176 | SI_USER, |
177 | # define SI_USER SI_USER |
178 | SI_KERNEL = 0x80 |
179 | #define SI_KERNEL SI_KERNEL |
180 | }; |
181 | |
182 | |
183 | # if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 |
184 | |
185 | enum |
186 | { |
187 | ILL_ILLOPC = 1, |
188 | # define ILL_ILLOPC ILL_ILLOPC |
189 | ILL_ILLOPN, |
190 | # define ILL_ILLOPN ILL_ILLOPN |
191 | ILL_ILLADR, |
192 | # define ILL_ILLADR ILL_ILLADR |
193 | ILL_ILLTRP, |
194 | # define ILL_ILLTRP ILL_ILLTRP |
195 | ILL_PRVOPC, |
196 | # define ILL_PRVOPC ILL_PRVOPC |
197 | ILL_PRVREG, |
198 | # define ILL_PRVREG ILL_PRVREG |
199 | ILL_COPROC, |
200 | # define ILL_COPROC ILL_COPROC |
201 | ILL_BADSTK |
202 | # define ILL_BADSTK ILL_BADSTK |
203 | }; |
204 | |
205 | |
206 | enum |
207 | { |
208 | FPE_INTDIV = 1, |
209 | # define FPE_INTDIV FPE_INTDIV |
210 | FPE_INTOVF, |
211 | # define FPE_INTOVF FPE_INTOVF |
212 | FPE_FLTDIV, |
213 | # define FPE_FLTDIV FPE_FLTDIV |
214 | FPE_FLTOVF, |
215 | # define FPE_FLTOVF FPE_FLTOVF |
216 | FPE_FLTUND, |
217 | # define FPE_FLTUND FPE_FLTUND |
218 | FPE_FLTRES, |
219 | # define FPE_FLTRES FPE_FLTRES |
220 | FPE_FLTINV, |
221 | # define FPE_FLTINV FPE_FLTINV |
222 | FPE_FLTSUB |
223 | # define FPE_FLTSUB FPE_FLTSUB |
224 | }; |
225 | |
226 | |
227 | enum |
228 | { |
229 | SEGV_MAPERR = 1, |
230 | # define SEGV_MAPERR SEGV_MAPERR |
231 | SEGV_ACCERR |
232 | # define SEGV_ACCERR SEGV_ACCERR |
233 | }; |
234 | |
235 | |
236 | enum |
237 | { |
238 | BUS_ADRALN = 1, |
239 | # define BUS_ADRALN BUS_ADRALN |
240 | BUS_ADRERR, |
241 | # define BUS_ADRERR BUS_ADRERR |
242 | BUS_OBJERR, |
243 | # define BUS_OBJERR BUS_OBJERR |
244 | BUS_MCEERR_AR, |
245 | # define BUS_MCEERR_AR BUS_MCEERR_AR |
246 | BUS_MCEERR_AO |
247 | # define BUS_MCEERR_AO BUS_MCEERR_AO |
248 | }; |
249 | # endif |
250 | |
251 | # ifdef __USE_XOPEN_EXTENDED |
252 | |
253 | enum |
254 | { |
255 | TRAP_BRKPT = 1, |
256 | # define TRAP_BRKPT TRAP_BRKPT |
257 | TRAP_TRACE |
258 | # define TRAP_TRACE TRAP_TRACE |
259 | }; |
260 | # endif |
261 | |
262 | # if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 |
263 | |
264 | enum |
265 | { |
266 | CLD_EXITED = 1, |
267 | # define CLD_EXITED CLD_EXITED |
268 | CLD_KILLED, |
269 | # define CLD_KILLED CLD_KILLED |
270 | CLD_DUMPED, |
271 | # define CLD_DUMPED CLD_DUMPED |
272 | CLD_TRAPPED, |
273 | # define CLD_TRAPPED CLD_TRAPPED |
274 | CLD_STOPPED, |
275 | # define CLD_STOPPED CLD_STOPPED |
276 | CLD_CONTINUED |
277 | # define CLD_CONTINUED CLD_CONTINUED |
278 | }; |
279 | |
280 | |
281 | enum |
282 | { |
283 | POLL_IN = 1, |
284 | # define POLL_IN POLL_IN |
285 | POLL_OUT, |
286 | # define POLL_OUT POLL_OUT |
287 | POLL_MSG, |
288 | # define POLL_MSG POLL_MSG |
289 | POLL_ERR, |
290 | # define POLL_ERR POLL_ERR |
291 | POLL_PRI, |
292 | # define POLL_PRI POLL_PRI |
293 | POLL_HUP |
294 | # define POLL_HUP POLL_HUP |
295 | }; |
296 | # endif |
297 | |
298 | # undef __need_siginfo_t |
299 | #endif |
300 | |
301 | |
302 | #if (defined _SIGNAL_H || defined __need_sigevent_t) \ |
303 | && !defined __have_sigevent_t |
304 | # define __have_sigevent_t 1 |
305 | |
306 | |
307 | # define __SIGEV_MAX_SIZE 64 |
308 | # if __WORDSIZE == 64 |
309 | # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) |
310 | # else |
311 | # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) |
312 | # endif |
313 | |
314 | |
315 | # ifndef __have_pthread_attr_t |
316 | typedef union pthread_attr_t pthread_attr_t; |
317 | # define __have_pthread_attr_t 1 |
318 | # endif |
319 | |
320 | typedef struct sigevent |
321 | { |
322 | sigval_t sigev_value; |
323 | int sigev_signo; |
324 | int sigev_notify; |
325 | |
326 | union |
327 | { |
328 | int _pad[__SIGEV_PAD_SIZE]; |
329 | |
330 | |
331 | |
332 | __pid_t _tid; |
333 | |
334 | struct |
335 | { |
336 | void (*_function) (sigval_t); |
337 | pthread_attr_t *_attribute; |
338 | } _sigev_thread; |
339 | } _sigev_un; |
340 | } sigevent_t; |
341 | |
342 | |
343 | # define sigev_notify_function _sigev_un._sigev_thread._function |
344 | # define sigev_notify_attributes _sigev_un._sigev_thread._attribute |
345 | |
346 | |
347 | enum |
348 | { |
349 | SIGEV_SIGNAL = 0, |
350 | # define SIGEV_SIGNAL SIGEV_SIGNAL |
351 | SIGEV_NONE, |
352 | # define SIGEV_NONE SIGEV_NONE |
353 | SIGEV_THREAD, |
354 | # define SIGEV_THREAD SIGEV_THREAD |
355 | |
356 | SIGEV_THREAD_ID = 4 |
357 | #define SIGEV_THREAD_ID SIGEV_THREAD_ID |
358 | }; |
359 | |
360 | #endif |
361 | |