Move *-*-gnu* pattern below *-*-linux*.
[official-gcc.git] / libf2c / libF77 / setsig.c
blob8fde2fa27e81874b2e4c68935ba5d5a30e7d4518
1 /* Set up the signal behavior. */
3 #include <stdio.h>
4 #include "signal1.h"
6 #ifndef SIGIOT
7 #ifdef SIGABRT
8 #define SIGIOT SIGABRT
9 #endif
10 #endif
12 #ifndef KR_headers
13 #undef VOID
14 #include <stdlib.h>
15 #endif
17 #ifndef VOID
18 #define VOID void
19 #endif
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
25 #ifdef KR_headers
26 extern VOID sig_die();
27 #define Int /* int */
28 #else
29 extern void sig_die(char*, int);
30 #define Int int
31 #endif
33 static VOID sigfdie(Sigarg)
35 Use_Sigarg;
36 sig_die("Floating Exception", 1);
40 static VOID sigidie(Sigarg)
42 Use_Sigarg;
43 sig_die("IOT Trap", 1);
46 #ifdef SIGQUIT
47 static VOID sigqdie(Sigarg)
49 Use_Sigarg;
50 sig_die("Quit signal", 1);
52 #endif
55 static VOID sigindie(Sigarg)
57 Use_Sigarg;
58 sig_die("Interrupt", 0);
61 static VOID sigtdie(Sigarg)
63 Use_Sigarg;
64 sig_die("Killed", 0);
67 #ifdef SIGTRAP
68 static VOID sigtrdie(Sigarg)
70 Use_Sigarg;
71 sig_die("Trace trap", 1);
73 #endif
76 #ifdef __cplusplus
78 #endif
80 void
81 f_setsig()
83 signal1(SIGFPE, sigfdie); /* ignore underflow, enable overflow */
84 #ifdef SIGIOT
85 signal1(SIGIOT, sigidie);
86 #endif
87 #ifdef SIGTRAP
88 signal1(SIGTRAP, sigtrdie);
89 #endif
90 #ifdef SIGQUIT
91 if(signal1(SIGQUIT,sigqdie) == SIG_IGN)
92 signal1(SIGQUIT, SIG_IGN);
93 #endif
94 if(signal1(SIGINT, sigindie) == SIG_IGN)
95 signal1(SIGINT, SIG_IGN);
96 signal1(SIGTERM,sigtdie);
98 #ifdef pdp11
99 ldfps(01200); /* detect overflow as an exception */
100 #endif