Commit | Line | Data |
---|---|---|
c906108c | 1 | #include <signal.h> |
085dd6e6 | 2 | #include <unistd.h> |
c906108c | 3 | |
c906108c SS |
4 | |
5 | /* Signal handlers, we set breakpoints in them to make sure that the | |
6 | signals really get delivered. */ | |
7 | ||
085dd6e6 JM |
8 | void |
9 | handle_ABRT (int sig) | |
c906108c SS |
10 | { |
11 | } | |
12 | ||
085dd6e6 JM |
13 | void |
14 | handle_HUP (int sig) | |
c906108c SS |
15 | { |
16 | } | |
17 | ||
085dd6e6 JM |
18 | void |
19 | handle_QUIT (int sig) | |
c906108c SS |
20 | { |
21 | } | |
22 | ||
085dd6e6 JM |
23 | void |
24 | handle_ILL (int sig) | |
c906108c SS |
25 | { |
26 | } | |
27 | ||
085dd6e6 JM |
28 | void |
29 | handle_EMT (int sig) | |
c906108c SS |
30 | { |
31 | } | |
32 | ||
085dd6e6 JM |
33 | void |
34 | handle_FPE (int sig) | |
c906108c SS |
35 | { |
36 | } | |
37 | ||
085dd6e6 JM |
38 | void |
39 | handle_BUS (int sig) | |
c906108c SS |
40 | { |
41 | } | |
42 | ||
085dd6e6 JM |
43 | void |
44 | handle_SEGV (int sig) | |
c906108c SS |
45 | { |
46 | } | |
47 | ||
085dd6e6 JM |
48 | void |
49 | handle_SYS (int sig) | |
c906108c SS |
50 | { |
51 | } | |
52 | ||
085dd6e6 JM |
53 | void |
54 | handle_PIPE (int sig) | |
c906108c SS |
55 | { |
56 | } | |
57 | ||
085dd6e6 JM |
58 | void |
59 | handle_ALRM (int sig) | |
c906108c SS |
60 | { |
61 | } | |
62 | ||
085dd6e6 JM |
63 | void |
64 | handle_URG (int sig) | |
c906108c SS |
65 | { |
66 | } | |
67 | ||
085dd6e6 JM |
68 | void |
69 | handle_TSTP (int sig) | |
c906108c SS |
70 | { |
71 | } | |
72 | ||
085dd6e6 JM |
73 | void |
74 | handle_CONT (int sig) | |
c906108c SS |
75 | { |
76 | } | |
77 | ||
085dd6e6 JM |
78 | void |
79 | handle_CHLD (int sig) | |
c906108c SS |
80 | { |
81 | } | |
82 | ||
085dd6e6 JM |
83 | void |
84 | handle_TTIN (int sig) | |
c906108c SS |
85 | { |
86 | } | |
87 | ||
085dd6e6 JM |
88 | void |
89 | handle_TTOU (int sig) | |
c906108c SS |
90 | { |
91 | } | |
92 | ||
085dd6e6 JM |
93 | void |
94 | handle_IO (int sig) | |
c906108c SS |
95 | { |
96 | } | |
97 | ||
085dd6e6 JM |
98 | void |
99 | handle_XCPU (int sig) | |
c906108c SS |
100 | { |
101 | } | |
102 | ||
085dd6e6 JM |
103 | void |
104 | handle_XFSZ (int sig) | |
c906108c SS |
105 | { |
106 | } | |
107 | ||
085dd6e6 JM |
108 | void |
109 | handle_VTALRM (int sig) | |
c906108c SS |
110 | { |
111 | } | |
112 | ||
085dd6e6 JM |
113 | void |
114 | handle_PROF (int sig) | |
c906108c SS |
115 | { |
116 | } | |
117 | ||
085dd6e6 JM |
118 | void |
119 | handle_WINCH (int sig) | |
c906108c SS |
120 | { |
121 | } | |
122 | ||
085dd6e6 JM |
123 | void |
124 | handle_LOST (int sig) | |
c906108c SS |
125 | { |
126 | } | |
127 | ||
085dd6e6 JM |
128 | void |
129 | handle_USR1 (int sig) | |
c906108c SS |
130 | { |
131 | } | |
132 | ||
085dd6e6 JM |
133 | void |
134 | handle_USR2 (int sig) | |
c906108c SS |
135 | { |
136 | } | |
137 | ||
085dd6e6 JM |
138 | void |
139 | handle_PWR (int sig) | |
c906108c SS |
140 | { |
141 | } | |
142 | ||
085dd6e6 JM |
143 | void |
144 | handle_POLL (int sig) | |
c906108c SS |
145 | { |
146 | } | |
147 | ||
085dd6e6 JM |
148 | void |
149 | handle_WIND (int sig) | |
c906108c SS |
150 | { |
151 | } | |
152 | ||
085dd6e6 JM |
153 | void |
154 | handle_PHONE (int sig) | |
c906108c SS |
155 | { |
156 | } | |
157 | ||
085dd6e6 JM |
158 | void |
159 | handle_WAITING (int sig) | |
c906108c SS |
160 | { |
161 | } | |
162 | ||
085dd6e6 JM |
163 | void |
164 | handle_LWP (int sig) | |
c906108c SS |
165 | { |
166 | } | |
167 | ||
085dd6e6 JM |
168 | void |
169 | handle_DANGER (int sig) | |
c906108c SS |
170 | { |
171 | } | |
172 | ||
085dd6e6 JM |
173 | void |
174 | handle_GRANT (int sig) | |
c906108c SS |
175 | { |
176 | } | |
177 | ||
085dd6e6 JM |
178 | void |
179 | handle_RETRACT (int sig) | |
c906108c SS |
180 | { |
181 | } | |
182 | ||
085dd6e6 JM |
183 | void |
184 | handle_MSG (int sig) | |
c906108c SS |
185 | { |
186 | } | |
187 | ||
085dd6e6 JM |
188 | void |
189 | handle_SOUND (int sig) | |
c906108c SS |
190 | { |
191 | } | |
192 | ||
085dd6e6 JM |
193 | void |
194 | handle_SAK (int sig) | |
c906108c SS |
195 | { |
196 | } | |
197 | ||
085dd6e6 JM |
198 | void |
199 | handle_PRIO (int sig) | |
c906108c SS |
200 | { |
201 | } | |
202 | ||
085dd6e6 JM |
203 | void |
204 | handle_33 (int sig) | |
c906108c SS |
205 | { |
206 | } | |
207 | ||
085dd6e6 JM |
208 | void |
209 | handle_34 (int sig) | |
c906108c SS |
210 | { |
211 | } | |
212 | ||
085dd6e6 JM |
213 | void |
214 | handle_35 (int sig) | |
c906108c SS |
215 | { |
216 | } | |
217 | ||
085dd6e6 JM |
218 | void |
219 | handle_36 (int sig) | |
c906108c SS |
220 | { |
221 | } | |
222 | ||
085dd6e6 JM |
223 | void |
224 | handle_37 (int sig) | |
c906108c SS |
225 | { |
226 | } | |
227 | ||
085dd6e6 JM |
228 | void |
229 | handle_38 (int sig) | |
c906108c SS |
230 | { |
231 | } | |
232 | ||
085dd6e6 JM |
233 | void |
234 | handle_39 (int sig) | |
c906108c SS |
235 | { |
236 | } | |
237 | ||
085dd6e6 JM |
238 | void |
239 | handle_40 (int sig) | |
c906108c SS |
240 | { |
241 | } | |
242 | ||
085dd6e6 JM |
243 | void |
244 | handle_41 (int sig) | |
c906108c SS |
245 | { |
246 | } | |
247 | ||
085dd6e6 JM |
248 | void |
249 | handle_42 (int sig) | |
c906108c SS |
250 | { |
251 | } | |
252 | ||
085dd6e6 JM |
253 | void |
254 | handle_43 (int sig) | |
c906108c SS |
255 | { |
256 | } | |
257 | ||
085dd6e6 JM |
258 | void |
259 | handle_44 (int sig) | |
c906108c SS |
260 | { |
261 | } | |
262 | ||
085dd6e6 JM |
263 | void |
264 | handle_45 (int sig) | |
c906108c SS |
265 | { |
266 | } | |
267 | ||
085dd6e6 JM |
268 | void |
269 | handle_46 (int sig) | |
c906108c SS |
270 | { |
271 | } | |
272 | ||
085dd6e6 JM |
273 | void |
274 | handle_47 (int sig) | |
c906108c SS |
275 | { |
276 | } | |
277 | ||
085dd6e6 JM |
278 | void |
279 | handle_48 (int sig) | |
c906108c SS |
280 | { |
281 | } | |
282 | ||
085dd6e6 JM |
283 | void |
284 | handle_49 (int sig) | |
c906108c SS |
285 | { |
286 | } | |
287 | ||
085dd6e6 JM |
288 | void |
289 | handle_50 (int sig) | |
c906108c SS |
290 | { |
291 | } | |
292 | ||
085dd6e6 JM |
293 | void |
294 | handle_51 (int sig) | |
c906108c SS |
295 | { |
296 | } | |
297 | ||
085dd6e6 JM |
298 | void |
299 | handle_52 (int sig) | |
c906108c SS |
300 | { |
301 | } | |
302 | ||
085dd6e6 JM |
303 | void |
304 | handle_53 (int sig) | |
c906108c SS |
305 | { |
306 | } | |
307 | ||
085dd6e6 JM |
308 | void |
309 | handle_54 (int sig) | |
c906108c SS |
310 | { |
311 | } | |
312 | ||
085dd6e6 JM |
313 | void |
314 | handle_55 (int sig) | |
c906108c SS |
315 | { |
316 | } | |
317 | ||
085dd6e6 JM |
318 | void |
319 | handle_56 (int sig) | |
c906108c SS |
320 | { |
321 | } | |
322 | ||
085dd6e6 JM |
323 | void |
324 | handle_57 (int sig) | |
c906108c SS |
325 | { |
326 | } | |
327 | ||
085dd6e6 JM |
328 | void |
329 | handle_58 (int sig) | |
c906108c SS |
330 | { |
331 | } | |
332 | ||
085dd6e6 JM |
333 | void |
334 | handle_59 (int sig) | |
c906108c SS |
335 | { |
336 | } | |
337 | ||
085dd6e6 JM |
338 | void |
339 | handle_60 (int sig) | |
c906108c SS |
340 | { |
341 | } | |
342 | ||
085dd6e6 JM |
343 | void |
344 | handle_61 (int sig) | |
c906108c SS |
345 | { |
346 | } | |
347 | ||
085dd6e6 JM |
348 | void |
349 | handle_62 (int sig) | |
c906108c SS |
350 | { |
351 | } | |
352 | ||
085dd6e6 JM |
353 | void |
354 | handle_63 (int sig) | |
c906108c SS |
355 | { |
356 | } | |
357 | ||
085dd6e6 JM |
358 | void |
359 | handle_TERM (int sig) | |
c906108c SS |
360 | { |
361 | } | |
362 | \f | |
3657956b GB |
363 | /* Functions to send signals. These also serve as markers. |
364 | Ordered ANSI-standard signals first, other signals second, | |
365 | with signals in each block ordered by their numerical values | |
366 | on a typical POSIX platform. */ | |
367 | ||
368 | /* SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM | |
369 | are ANSI-standard signals and are always available. */ | |
370 | ||
371 | int | |
372 | gen_ILL () | |
373 | { | |
374 | kill (getpid (), SIGILL); | |
375 | return 0; | |
376 | } | |
377 | ||
c906108c SS |
378 | int |
379 | gen_ABRT () | |
380 | { | |
381 | kill (getpid (), SIGABRT); | |
085dd6e6 | 382 | return 0; |
c906108c SS |
383 | } |
384 | ||
3657956b GB |
385 | int x; |
386 | ||
387 | int | |
388 | gen_FPE () | |
389 | { | |
390 | /* The intent behind generating SIGFPE this way is to check the mapping | |
391 | from the CPU exception itself to the signals. It would be nice to | |
392 | do the same for SIGBUS, SIGSEGV, etc., but I suspect that even this | |
393 | test might turn out to be insufficiently portable. */ | |
394 | ||
395 | #if 0 | |
396 | /* Loses on the PA because after the signal handler executes we try to | |
397 | re-execute the failing instruction again. Perhaps we could siglongjmp | |
398 | out of the signal handler? */ | |
399 | /* The expect script looks for the word "kill"; don't delete it. */ | |
400 | return 5 / x; /* and we both started jumping up and down yelling kill */ | |
401 | #else | |
402 | kill (getpid (), SIGFPE); | |
403 | #endif | |
404 | return 0; | |
405 | } | |
406 | ||
407 | int | |
408 | gen_SEGV () | |
409 | { | |
410 | kill (getpid (), SIGSEGV); | |
411 | return 0; | |
412 | } | |
413 | ||
414 | int | |
415 | gen_TERM () | |
416 | { | |
417 | kill (getpid (), SIGTERM); | |
418 | return 0; | |
419 | } | |
420 | ||
421 | /* All other signals need preprocessor conditionals. */ | |
422 | ||
c906108c SS |
423 | int |
424 | gen_HUP () | |
425 | { | |
426 | #ifdef SIGHUP | |
427 | kill (getpid (), SIGHUP); | |
428 | #else | |
429 | handle_HUP (0); | |
430 | #endif | |
085dd6e6 | 431 | return 0; |
c906108c SS |
432 | } |
433 | ||
434 | int | |
435 | gen_QUIT () | |
436 | { | |
437 | #ifdef SIGQUIT | |
438 | kill (getpid (), SIGQUIT); | |
439 | #else | |
440 | handle_QUIT (0); | |
441 | #endif | |
085dd6e6 | 442 | return 0; |
c906108c SS |
443 | } |
444 | ||
c906108c SS |
445 | int |
446 | gen_EMT () | |
447 | { | |
448 | #ifdef SIGEMT | |
449 | kill (getpid (), SIGEMT); | |
450 | #else | |
451 | handle_EMT (0); | |
452 | #endif | |
085dd6e6 | 453 | return 0; |
c906108c SS |
454 | } |
455 | ||
c906108c SS |
456 | int |
457 | gen_BUS () | |
458 | { | |
459 | #ifdef SIGBUS | |
460 | kill (getpid (), SIGBUS); | |
461 | #else | |
462 | handle_BUS (0); | |
463 | #endif | |
085dd6e6 | 464 | return 0; |
c906108c SS |
465 | } |
466 | ||
c906108c SS |
467 | int |
468 | gen_SYS () | |
469 | { | |
470 | #ifdef SIGSYS | |
471 | kill (getpid (), SIGSYS); | |
472 | #else | |
473 | handle_SYS (0); | |
474 | #endif | |
085dd6e6 | 475 | return 0; |
c906108c SS |
476 | } |
477 | ||
478 | int | |
479 | gen_PIPE () | |
480 | { | |
481 | #ifdef SIGPIPE | |
482 | kill (getpid (), SIGPIPE); | |
483 | #else | |
484 | handle_PIPE (0); | |
485 | #endif | |
085dd6e6 | 486 | return 0; |
c906108c SS |
487 | } |
488 | ||
489 | int | |
490 | gen_ALRM () | |
491 | { | |
492 | #ifdef SIGALRM | |
493 | kill (getpid (), SIGALRM); | |
494 | #else | |
495 | handle_ALRM (0); | |
496 | #endif | |
085dd6e6 | 497 | return 0; |
c906108c SS |
498 | } |
499 | ||
500 | int | |
501 | gen_URG () | |
502 | { | |
503 | #ifdef SIGURG | |
504 | kill (getpid (), SIGURG); | |
505 | #else | |
506 | handle_URG (0); | |
507 | #endif | |
085dd6e6 | 508 | return 0; |
c906108c SS |
509 | } |
510 | ||
511 | int | |
512 | gen_TSTP () | |
513 | { | |
514 | #ifdef SIGTSTP | |
515 | kill (getpid (), SIGTSTP); | |
516 | #else | |
517 | handle_TSTP (0); | |
518 | #endif | |
085dd6e6 | 519 | return 0; |
c906108c SS |
520 | } |
521 | ||
522 | int | |
523 | gen_CONT () | |
524 | { | |
525 | #ifdef SIGCONT | |
526 | kill (getpid (), SIGCONT); | |
527 | #else | |
528 | handle_CONT (0); | |
529 | #endif | |
085dd6e6 | 530 | return 0; |
c906108c SS |
531 | } |
532 | ||
533 | int | |
534 | gen_CHLD () | |
535 | { | |
536 | #ifdef SIGCHLD | |
537 | kill (getpid (), SIGCHLD); | |
538 | #else | |
539 | handle_CHLD (0); | |
540 | #endif | |
085dd6e6 | 541 | return 0; |
c906108c SS |
542 | } |
543 | ||
544 | int | |
545 | gen_TTIN () | |
546 | { | |
547 | #ifdef SIGTTIN | |
548 | kill (getpid (), SIGTTIN); | |
549 | #else | |
550 | handle_TTIN (0); | |
551 | #endif | |
085dd6e6 | 552 | return 0; |
c906108c SS |
553 | } |
554 | ||
555 | int | |
556 | gen_TTOU () | |
557 | { | |
558 | #ifdef SIGTTOU | |
559 | kill (getpid (), SIGTTOU); | |
560 | #else | |
561 | handle_TTOU (0); | |
562 | #endif | |
085dd6e6 | 563 | return 0; |
c906108c SS |
564 | } |
565 | ||
566 | int | |
567 | gen_IO () | |
568 | { | |
569 | #ifdef SIGIO | |
570 | kill (getpid (), SIGIO); | |
571 | #else | |
572 | handle_IO (0); | |
573 | #endif | |
085dd6e6 | 574 | return 0; |
c906108c SS |
575 | } |
576 | ||
577 | int | |
578 | gen_XCPU () | |
579 | { | |
580 | #ifdef SIGXCPU | |
581 | kill (getpid (), SIGXCPU); | |
582 | #else | |
583 | handle_XCPU (0); | |
584 | #endif | |
085dd6e6 | 585 | return 0; |
c906108c SS |
586 | } |
587 | ||
588 | int | |
589 | gen_XFSZ () | |
590 | { | |
591 | #ifdef SIGXFSZ | |
592 | kill (getpid (), SIGXFSZ); | |
593 | #else | |
594 | handle_XFSZ (0); | |
595 | #endif | |
085dd6e6 | 596 | return 0; |
c906108c SS |
597 | } |
598 | ||
599 | int | |
600 | gen_VTALRM () | |
601 | { | |
602 | #ifdef SIGVTALRM | |
603 | kill (getpid (), SIGVTALRM); | |
604 | #else | |
605 | handle_VTALRM (0); | |
606 | #endif | |
085dd6e6 | 607 | return 0; |
c906108c SS |
608 | } |
609 | ||
610 | int | |
611 | gen_PROF () | |
612 | { | |
613 | #ifdef SIGPROF | |
614 | kill (getpid (), SIGPROF); | |
615 | #else | |
616 | handle_PROF (0); | |
617 | #endif | |
085dd6e6 | 618 | return 0; |
c906108c SS |
619 | } |
620 | ||
621 | int | |
622 | gen_WINCH () | |
623 | { | |
624 | #ifdef SIGWINCH | |
625 | kill (getpid (), SIGWINCH); | |
626 | #else | |
627 | handle_WINCH (0); | |
628 | #endif | |
085dd6e6 | 629 | return 0; |
c906108c SS |
630 | } |
631 | ||
632 | int | |
633 | gen_LOST () | |
634 | { | |
73ba372c | 635 | #if defined(SIGLOST) && SIGLOST != SIGABRT |
c906108c SS |
636 | kill (getpid (), SIGLOST); |
637 | #else | |
638 | handle_LOST (0); | |
639 | #endif | |
085dd6e6 | 640 | return 0; |
c906108c SS |
641 | } |
642 | ||
643 | int | |
644 | gen_USR1 () | |
645 | { | |
646 | #ifdef SIGUSR1 | |
647 | kill (getpid (), SIGUSR1); | |
648 | #else | |
649 | handle_USR1 (0); | |
650 | #endif | |
085dd6e6 | 651 | return 0; |
c906108c SS |
652 | } |
653 | ||
654 | int | |
655 | gen_USR2 () | |
656 | { | |
657 | #ifdef SIGUSR2 | |
658 | kill (getpid (), SIGUSR2); | |
659 | #else | |
660 | handle_USR2 (0); | |
661 | #endif | |
085dd6e6 | 662 | return 0; |
c906108c SS |
663 | } |
664 | ||
665 | int | |
666 | gen_PWR () | |
667 | { | |
f1300300 | 668 | #if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST) |
c906108c SS |
669 | kill (getpid (), SIGPWR); |
670 | #else | |
671 | handle_PWR (0); | |
672 | #endif | |
085dd6e6 | 673 | return 0; |
c906108c SS |
674 | } |
675 | ||
676 | int | |
677 | gen_POLL () | |
678 | { | |
679 | #if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO) | |
680 | kill (getpid (), SIGPOLL); | |
681 | #else | |
682 | handle_POLL (0); | |
683 | #endif | |
085dd6e6 | 684 | return 0; |
c906108c SS |
685 | } |
686 | ||
687 | int | |
688 | gen_WIND () | |
689 | { | |
690 | #ifdef SIGWIND | |
691 | kill (getpid (), SIGWIND); | |
692 | #else | |
693 | handle_WIND (0); | |
694 | #endif | |
085dd6e6 | 695 | return 0; |
c906108c SS |
696 | } |
697 | ||
698 | int | |
699 | gen_PHONE () | |
700 | { | |
701 | #ifdef SIGPHONE | |
702 | kill (getpid (), SIGPHONE); | |
703 | #else | |
704 | handle_PHONE (0); | |
705 | #endif | |
085dd6e6 | 706 | return 0; |
c906108c SS |
707 | } |
708 | ||
709 | int | |
710 | gen_WAITING () | |
711 | { | |
712 | #ifdef SIGWAITING | |
713 | kill (getpid (), SIGWAITING); | |
714 | #else | |
715 | handle_WAITING (0); | |
716 | #endif | |
085dd6e6 | 717 | return 0; |
c906108c SS |
718 | } |
719 | ||
720 | int | |
721 | gen_LWP () | |
722 | { | |
723 | #ifdef SIGLWP | |
724 | kill (getpid (), SIGLWP); | |
725 | #else | |
726 | handle_LWP (0); | |
727 | #endif | |
085dd6e6 | 728 | return 0; |
c906108c SS |
729 | } |
730 | ||
731 | int | |
732 | gen_DANGER () | |
733 | { | |
734 | #ifdef SIGDANGER | |
735 | kill (getpid (), SIGDANGER); | |
736 | #else | |
737 | handle_DANGER (0); | |
738 | #endif | |
085dd6e6 | 739 | return 0; |
c906108c SS |
740 | } |
741 | ||
742 | int | |
743 | gen_GRANT () | |
744 | { | |
745 | #ifdef SIGGRANT | |
746 | kill (getpid (), SIGGRANT); | |
747 | #else | |
748 | handle_GRANT (0); | |
749 | #endif | |
085dd6e6 | 750 | return 0; |
c906108c SS |
751 | } |
752 | ||
753 | int | |
754 | gen_RETRACT () | |
755 | { | |
756 | #ifdef SIGRETRACT | |
757 | kill (getpid (), SIGRETRACT); | |
758 | #else | |
759 | handle_RETRACT (0); | |
760 | #endif | |
085dd6e6 | 761 | return 0; |
c906108c SS |
762 | } |
763 | ||
764 | int | |
765 | gen_MSG () | |
766 | { | |
767 | #ifdef SIGMSG | |
768 | kill (getpid (), SIGMSG); | |
769 | #else | |
770 | handle_MSG (0); | |
771 | #endif | |
085dd6e6 | 772 | return 0; |
c906108c SS |
773 | } |
774 | ||
775 | int | |
776 | gen_SOUND () | |
777 | { | |
778 | #ifdef SIGSOUND | |
779 | kill (getpid (), SIGSOUND); | |
780 | #else | |
781 | handle_SOUND (0); | |
782 | #endif | |
085dd6e6 | 783 | return 0; |
c906108c SS |
784 | } |
785 | ||
786 | int | |
787 | gen_SAK () | |
788 | { | |
789 | #ifdef SIGSAK | |
790 | kill (getpid (), SIGSAK); | |
791 | #else | |
792 | handle_SAK (0); | |
793 | #endif | |
085dd6e6 | 794 | return 0; |
c906108c SS |
795 | } |
796 | ||
797 | int | |
798 | gen_PRIO () | |
799 | { | |
800 | #ifdef SIGPRIO | |
801 | kill (getpid (), SIGPRIO); | |
802 | #else | |
803 | handle_PRIO (0); | |
804 | #endif | |
085dd6e6 | 805 | return 0; |
c906108c SS |
806 | } |
807 | ||
808 | int | |
809 | gen_33 () | |
810 | { | |
811 | #ifdef SIG33 | |
812 | kill (getpid (), 33); | |
813 | #else | |
814 | handle_33 (0); | |
815 | #endif | |
085dd6e6 | 816 | return 0; |
c906108c SS |
817 | } |
818 | ||
819 | int | |
820 | gen_34 () | |
821 | { | |
822 | #ifdef SIG34 | |
823 | kill (getpid (), 34); | |
824 | #else | |
825 | handle_34 (0); | |
826 | #endif | |
085dd6e6 | 827 | return 0; |
c906108c SS |
828 | } |
829 | ||
830 | int | |
831 | gen_35 () | |
832 | { | |
833 | #ifdef SIG35 | |
834 | kill (getpid (), 35); | |
835 | #else | |
836 | handle_35 (0); | |
837 | #endif | |
085dd6e6 | 838 | return 0; |
c906108c SS |
839 | } |
840 | ||
841 | int | |
842 | gen_36 () | |
843 | { | |
844 | #ifdef SIG36 | |
845 | kill (getpid (), 36); | |
846 | #else | |
847 | handle_36 (0); | |
848 | #endif | |
085dd6e6 | 849 | return 0; |
c906108c SS |
850 | } |
851 | ||
852 | int | |
853 | gen_37 () | |
854 | { | |
855 | #ifdef SIG37 | |
856 | kill (getpid (), 37); | |
857 | #else | |
858 | handle_37 (0); | |
859 | #endif | |
085dd6e6 | 860 | return 0; |
c906108c SS |
861 | } |
862 | ||
863 | int | |
864 | gen_38 () | |
865 | { | |
866 | #ifdef SIG38 | |
867 | kill (getpid (), 38); | |
868 | #else | |
869 | handle_38 (0); | |
870 | #endif | |
085dd6e6 | 871 | return 0; |
c906108c SS |
872 | } |
873 | ||
874 | int | |
875 | gen_39 () | |
876 | { | |
877 | #ifdef SIG39 | |
878 | kill (getpid (), 39); | |
879 | #else | |
880 | handle_39 (0); | |
881 | #endif | |
085dd6e6 | 882 | return 0; |
c906108c SS |
883 | } |
884 | ||
885 | int | |
886 | gen_40 () | |
887 | { | |
888 | #ifdef SIG40 | |
889 | kill (getpid (), 40); | |
890 | #else | |
891 | handle_40 (0); | |
892 | #endif | |
085dd6e6 | 893 | return 0; |
c906108c SS |
894 | } |
895 | ||
896 | int | |
897 | gen_41 () | |
898 | { | |
899 | #ifdef SIG41 | |
900 | kill (getpid (), 41); | |
901 | #else | |
902 | handle_41 (0); | |
903 | #endif | |
085dd6e6 | 904 | return 0; |
c906108c SS |
905 | } |
906 | ||
907 | int | |
908 | gen_42 () | |
909 | { | |
910 | #ifdef SIG42 | |
911 | kill (getpid (), 42); | |
912 | #else | |
913 | handle_42 (0); | |
914 | #endif | |
085dd6e6 | 915 | return 0; |
c906108c SS |
916 | } |
917 | ||
918 | int | |
919 | gen_43 () | |
920 | { | |
921 | #ifdef SIG43 | |
922 | kill (getpid (), 43); | |
923 | #else | |
924 | handle_43 (0); | |
925 | #endif | |
085dd6e6 | 926 | return 0; |
c906108c SS |
927 | } |
928 | ||
929 | int | |
930 | gen_44 () | |
931 | { | |
932 | #ifdef SIG44 | |
933 | kill (getpid (), 44); | |
934 | #else | |
935 | handle_44 (0); | |
936 | #endif | |
085dd6e6 | 937 | return 0; |
c906108c SS |
938 | } |
939 | ||
940 | int | |
941 | gen_45 () | |
942 | { | |
943 | #ifdef SIG45 | |
944 | kill (getpid (), 45); | |
945 | #else | |
946 | handle_45 (0); | |
947 | #endif | |
085dd6e6 | 948 | return 0; |
c906108c SS |
949 | } |
950 | ||
951 | int | |
952 | gen_46 () | |
953 | { | |
954 | #ifdef SIG46 | |
955 | kill (getpid (), 46); | |
956 | #else | |
957 | handle_46 (0); | |
958 | #endif | |
085dd6e6 | 959 | return 0; |
c906108c SS |
960 | } |
961 | ||
962 | int | |
963 | gen_47 () | |
964 | { | |
965 | #ifdef SIG47 | |
966 | kill (getpid (), 47); | |
967 | #else | |
968 | handle_47 (0); | |
969 | #endif | |
085dd6e6 | 970 | return 0; |
c906108c SS |
971 | } |
972 | ||
973 | int | |
974 | gen_48 () | |
975 | { | |
976 | #ifdef SIG48 | |
977 | kill (getpid (), 48); | |
978 | #else | |
979 | handle_48 (0); | |
980 | #endif | |
085dd6e6 | 981 | return 0; |
c906108c SS |
982 | } |
983 | ||
984 | int | |
985 | gen_49 () | |
986 | { | |
987 | #ifdef SIG49 | |
988 | kill (getpid (), 49); | |
989 | #else | |
990 | handle_49 (0); | |
991 | #endif | |
085dd6e6 | 992 | return 0; |
c906108c SS |
993 | } |
994 | ||
995 | int | |
996 | gen_50 () | |
997 | { | |
998 | #ifdef SIG50 | |
999 | kill (getpid (), 50); | |
1000 | #else | |
1001 | handle_50 (0); | |
1002 | #endif | |
085dd6e6 | 1003 | return 0; |
c906108c SS |
1004 | } |
1005 | ||
1006 | int | |
1007 | gen_51 () | |
1008 | { | |
1009 | #ifdef SIG51 | |
1010 | kill (getpid (), 51); | |
1011 | #else | |
1012 | handle_51 (0); | |
1013 | #endif | |
085dd6e6 | 1014 | return 0; |
c906108c SS |
1015 | } |
1016 | ||
1017 | int | |
1018 | gen_52 () | |
1019 | { | |
1020 | #ifdef SIG52 | |
1021 | kill (getpid (), 52); | |
1022 | #else | |
1023 | handle_52 (0); | |
1024 | #endif | |
085dd6e6 | 1025 | return 0; |
c906108c SS |
1026 | } |
1027 | ||
1028 | int | |
1029 | gen_53 () | |
1030 | { | |
1031 | #ifdef SIG53 | |
1032 | kill (getpid (), 53); | |
1033 | #else | |
1034 | handle_53 (0); | |
1035 | #endif | |
085dd6e6 | 1036 | return 0; |
c906108c SS |
1037 | } |
1038 | ||
1039 | int | |
1040 | gen_54 () | |
1041 | { | |
1042 | #ifdef SIG54 | |
1043 | kill (getpid (), 54); | |
1044 | #else | |
1045 | handle_54 (0); | |
1046 | #endif | |
085dd6e6 | 1047 | return 0; |
c906108c SS |
1048 | } |
1049 | ||
1050 | int | |
1051 | gen_55 () | |
1052 | { | |
1053 | #ifdef SIG55 | |
1054 | kill (getpid (), 55); | |
1055 | #else | |
1056 | handle_55 (0); | |
1057 | #endif | |
085dd6e6 | 1058 | return 0; |
c906108c SS |
1059 | } |
1060 | ||
1061 | int | |
1062 | gen_56 () | |
1063 | { | |
1064 | #ifdef SIG56 | |
1065 | kill (getpid (), 56); | |
1066 | #else | |
1067 | handle_56 (0); | |
1068 | #endif | |
085dd6e6 | 1069 | return 0; |
c906108c SS |
1070 | } |
1071 | ||
1072 | int | |
1073 | gen_57 () | |
1074 | { | |
1075 | #ifdef SIG57 | |
1076 | kill (getpid (), 57); | |
1077 | #else | |
1078 | handle_57 (0); | |
1079 | #endif | |
085dd6e6 | 1080 | return 0; |
c906108c SS |
1081 | } |
1082 | ||
1083 | int | |
1084 | gen_58 () | |
1085 | { | |
1086 | #ifdef SIG58 | |
1087 | kill (getpid (), 58); | |
1088 | #else | |
1089 | handle_58 (0); | |
1090 | #endif | |
085dd6e6 | 1091 | return 0; |
c906108c SS |
1092 | } |
1093 | ||
1094 | int | |
1095 | gen_59 () | |
1096 | { | |
1097 | #ifdef SIG59 | |
1098 | kill (getpid (), 59); | |
1099 | #else | |
1100 | handle_59 (0); | |
1101 | #endif | |
085dd6e6 | 1102 | return 0; |
c906108c SS |
1103 | } |
1104 | ||
1105 | int | |
1106 | gen_60 () | |
1107 | { | |
1108 | #ifdef SIG60 | |
1109 | kill (getpid (), 60); | |
1110 | #else | |
1111 | handle_60 (0); | |
1112 | #endif | |
085dd6e6 | 1113 | return 0; |
c906108c SS |
1114 | } |
1115 | ||
1116 | int | |
1117 | gen_61 () | |
1118 | { | |
1119 | #ifdef SIG61 | |
1120 | kill (getpid (), 61); | |
1121 | #else | |
1122 | handle_61 (0); | |
1123 | #endif | |
085dd6e6 | 1124 | return 0; |
c906108c SS |
1125 | } |
1126 | ||
1127 | int | |
1128 | gen_62 () | |
1129 | { | |
1130 | #ifdef SIG62 | |
1131 | kill (getpid (), 62); | |
1132 | #else | |
1133 | handle_62 (0); | |
1134 | #endif | |
085dd6e6 | 1135 | return 0; |
c906108c SS |
1136 | } |
1137 | ||
1138 | int | |
1139 | gen_63 () | |
1140 | { | |
1141 | #ifdef SIG63 | |
1142 | kill (getpid (), 63); | |
1143 | #else | |
1144 | handle_63 (0); | |
1145 | #endif | |
085dd6e6 | 1146 | return 0; |
c906108c | 1147 | } |
c906108c SS |
1148 | \f |
1149 | int | |
1150 | main () | |
1151 | { | |
4b071aec DE |
1152 | |
1153 | #ifdef SIG_SETMASK | |
1154 | /* Ensure all the signals aren't blocked. | |
1155 | The environment in which the testsuite is run may have blocked some | |
1156 | for whatever reason. */ | |
1157 | { | |
1158 | sigset_t newset; | |
1159 | sigemptyset (&newset); | |
1160 | sigprocmask (SIG_SETMASK, &newset, NULL); | |
1161 | } | |
1162 | #endif | |
1163 | ||
3657956b GB |
1164 | /* Signals are ordered ANSI-standard signals first, other signals |
1165 | second, with signals in each block ordered by their numerical | |
1166 | values on a typical POSIX platform. */ | |
1167 | ||
1168 | /* SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM | |
1169 | are ANSI-standard signals and are always available. */ | |
1170 | signal (SIGILL, handle_ILL); | |
c906108c | 1171 | signal (SIGABRT, handle_ABRT); |
3657956b GB |
1172 | signal (SIGFPE, handle_FPE); |
1173 | signal (SIGSEGV, handle_SEGV); | |
1174 | signal (SIGTERM, handle_TERM); | |
1175 | ||
1176 | /* All other signals need preprocessor conditionals. */ | |
c906108c SS |
1177 | #ifdef SIGHUP |
1178 | signal (SIGHUP, handle_HUP); | |
1179 | #endif | |
1180 | #ifdef SIGQUIT | |
1181 | signal (SIGQUIT, handle_QUIT); | |
1182 | #endif | |
c906108c SS |
1183 | #ifdef SIGEMT |
1184 | signal (SIGEMT, handle_EMT); | |
1185 | #endif | |
c906108c SS |
1186 | #ifdef SIGBUS |
1187 | signal (SIGBUS, handle_BUS); | |
1188 | #endif | |
c906108c SS |
1189 | #ifdef SIGSYS |
1190 | signal (SIGSYS, handle_SYS); | |
1191 | #endif | |
1192 | #ifdef SIGPIPE | |
1193 | signal (SIGPIPE, handle_PIPE); | |
1194 | #endif | |
1195 | #ifdef SIGALRM | |
1196 | signal (SIGALRM, handle_ALRM); | |
1197 | #endif | |
1198 | #ifdef SIGURG | |
1199 | signal (SIGURG, handle_URG); | |
1200 | #endif | |
1201 | #ifdef SIGTSTP | |
1202 | signal (SIGTSTP, handle_TSTP); | |
1203 | #endif | |
1204 | #ifdef SIGCONT | |
1205 | signal (SIGCONT, handle_CONT); | |
1206 | #endif | |
1207 | #ifdef SIGCHLD | |
1208 | signal (SIGCHLD, handle_CHLD); | |
1209 | #endif | |
1210 | #ifdef SIGTTIN | |
1211 | signal (SIGTTIN, handle_TTIN); | |
1212 | #endif | |
1213 | #ifdef SIGTTOU | |
1214 | signal (SIGTTOU, handle_TTOU); | |
1215 | #endif | |
1216 | #ifdef SIGIO | |
1217 | signal (SIGIO, handle_IO); | |
1218 | #endif | |
1219 | #ifdef SIGXCPU | |
1220 | signal (SIGXCPU, handle_XCPU); | |
1221 | #endif | |
1222 | #ifdef SIGXFSZ | |
1223 | signal (SIGXFSZ, handle_XFSZ); | |
1224 | #endif | |
1225 | #ifdef SIGVTALRM | |
1226 | signal (SIGVTALRM, handle_VTALRM); | |
1227 | #endif | |
1228 | #ifdef SIGPROF | |
1229 | signal (SIGPROF, handle_PROF); | |
1230 | #endif | |
1231 | #ifdef SIGWINCH | |
1232 | signal (SIGWINCH, handle_WINCH); | |
1233 | #endif | |
73ba372c | 1234 | #if defined(SIGLOST) && SIGLOST != SIGABRT |
c906108c SS |
1235 | signal (SIGLOST, handle_LOST); |
1236 | #endif | |
1237 | #ifdef SIGUSR1 | |
1238 | signal (SIGUSR1, handle_USR1); | |
1239 | #endif | |
1240 | #ifdef SIGUSR2 | |
1241 | signal (SIGUSR2, handle_USR2); | |
1242 | #endif | |
f1300300 | 1243 | #if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST) |
c906108c SS |
1244 | signal (SIGPWR, handle_PWR); |
1245 | #endif | |
1246 | #if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO) | |
1247 | signal (SIGPOLL, handle_POLL); | |
1248 | #endif | |
1249 | #ifdef SIGWIND | |
1250 | signal (SIGWIND, handle_WIND); | |
1251 | #endif | |
1252 | #ifdef SIGPHONE | |
1253 | signal (SIGPHONE, handle_PHONE); | |
1254 | #endif | |
1255 | #ifdef SIGWAITING | |
1256 | signal (SIGWAITING, handle_WAITING); | |
1257 | #endif | |
1258 | #ifdef SIGLWP | |
1259 | signal (SIGLWP, handle_LWP); | |
1260 | #endif | |
1261 | #ifdef SIGDANGER | |
1262 | signal (SIGDANGER, handle_DANGER); | |
1263 | #endif | |
1264 | #ifdef SIGGRANT | |
1265 | signal (SIGGRANT, handle_GRANT); | |
1266 | #endif | |
1267 | #ifdef SIGRETRACT | |
1268 | signal (SIGRETRACT, handle_RETRACT); | |
1269 | #endif | |
1270 | #ifdef SIGMSG | |
1271 | signal (SIGMSG, handle_MSG); | |
1272 | #endif | |
1273 | #ifdef SIGSOUND | |
1274 | signal (SIGSOUND, handle_SOUND); | |
1275 | #endif | |
1276 | #ifdef SIGSAK | |
1277 | signal (SIGSAK, handle_SAK); | |
1278 | #endif | |
1279 | #ifdef SIGPRIO | |
1280 | signal (SIGPRIO, handle_PRIO); | |
1281 | #endif | |
1282 | #ifdef __Lynx__ | |
1283 | /* Lynx doesn't seem to have anything in signal.h for this. */ | |
1284 | signal (33, handle_33); | |
1285 | signal (34, handle_34); | |
1286 | signal (35, handle_35); | |
1287 | signal (36, handle_36); | |
1288 | signal (37, handle_37); | |
1289 | signal (38, handle_38); | |
1290 | signal (39, handle_39); | |
1291 | signal (40, handle_40); | |
1292 | signal (41, handle_41); | |
1293 | signal (42, handle_42); | |
1294 | signal (43, handle_43); | |
1295 | signal (44, handle_44); | |
1296 | signal (45, handle_45); | |
1297 | signal (46, handle_46); | |
1298 | signal (47, handle_47); | |
1299 | signal (48, handle_48); | |
1300 | signal (49, handle_49); | |
1301 | signal (50, handle_50); | |
1302 | signal (51, handle_51); | |
1303 | signal (52, handle_52); | |
1304 | signal (53, handle_53); | |
1305 | signal (54, handle_54); | |
1306 | signal (55, handle_55); | |
1307 | signal (56, handle_56); | |
1308 | signal (57, handle_57); | |
1309 | signal (58, handle_58); | |
1310 | signal (59, handle_59); | |
1311 | signal (60, handle_60); | |
1312 | signal (61, handle_61); | |
1313 | signal (62, handle_62); | |
1314 | signal (63, handle_63); | |
1315 | #endif /* lynx */ | |
c906108c SS |
1316 | |
1317 | x = 0; | |
1318 | ||
1319 | gen_ABRT (); | |
1320 | gen_HUP (); | |
1321 | gen_QUIT (); | |
1322 | gen_ILL (); | |
1323 | gen_EMT (); | |
1324 | gen_FPE (); | |
1325 | gen_BUS (); | |
1326 | gen_SEGV (); | |
1327 | gen_SYS (); | |
1328 | gen_PIPE (); | |
1329 | gen_ALRM (); | |
1330 | gen_URG (); | |
1331 | gen_TSTP (); | |
1332 | gen_CONT (); | |
1333 | gen_CHLD (); | |
1334 | gen_TTIN (); | |
1335 | gen_TTOU (); | |
1336 | gen_IO (); | |
1337 | gen_XCPU (); | |
1338 | gen_XFSZ (); | |
1339 | gen_VTALRM (); | |
1340 | gen_PROF (); | |
1341 | gen_WINCH (); | |
1342 | gen_LOST (); | |
1343 | gen_USR1 (); | |
1344 | gen_USR2 (); | |
1345 | gen_PWR (); | |
1346 | gen_POLL (); | |
1347 | gen_WIND (); | |
1348 | gen_PHONE (); | |
1349 | gen_WAITING (); | |
1350 | gen_LWP (); | |
1351 | gen_DANGER (); | |
1352 | gen_GRANT (); | |
1353 | gen_RETRACT (); | |
1354 | gen_MSG (); | |
1355 | gen_SOUND (); | |
1356 | gen_SAK (); | |
1357 | gen_PRIO (); | |
1358 | gen_33 (); | |
1359 | gen_34 (); | |
1360 | gen_35 (); | |
1361 | gen_36 (); | |
1362 | gen_37 (); | |
1363 | gen_38 (); | |
1364 | gen_39 (); | |
1365 | gen_40 (); | |
1366 | gen_41 (); | |
1367 | gen_42 (); | |
1368 | gen_43 (); | |
1369 | gen_44 (); | |
1370 | gen_45 (); | |
1371 | gen_46 (); | |
1372 | gen_47 (); | |
1373 | gen_48 (); | |
1374 | gen_49 (); | |
1375 | gen_50 (); | |
1376 | gen_51 (); | |
1377 | gen_52 (); | |
1378 | gen_53 (); | |
1379 | gen_54 (); | |
1380 | gen_55 (); | |
1381 | gen_56 (); | |
1382 | gen_57 (); | |
1383 | gen_58 (); | |
1384 | gen_59 (); | |
1385 | gen_60 (); | |
1386 | gen_61 (); | |
1387 | gen_62 (); | |
1388 | gen_63 (); | |
1389 | gen_TERM (); | |
1390 | ||
1391 | return 0; | |
1392 | } |