Last change
on this file was 2, checked in by bird, 22 years ago |
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
File size:
1.3 KB
|
Line | |
---|
1 | /* Set up the signal behavior. */
|
---|
2 |
|
---|
3 | #include <stdio.h>
|
---|
4 | #include "signal1.h"
|
---|
5 |
|
---|
6 | #ifndef SIGIOT
|
---|
7 | #ifdef SIGABRT
|
---|
8 | #define SIGIOT SIGABRT
|
---|
9 | #endif
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | #ifndef KR_headers
|
---|
13 | #undef VOID
|
---|
14 | #include <stdlib.h>
|
---|
15 | #endif
|
---|
16 |
|
---|
17 | #ifndef VOID
|
---|
18 | #define VOID void
|
---|
19 | #endif
|
---|
20 |
|
---|
21 | #ifdef __cplusplus
|
---|
22 | extern "C" {
|
---|
23 | #endif
|
---|
24 |
|
---|
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
|
---|
32 |
|
---|
33 | static VOID sigfdie(Sigarg)
|
---|
34 | {
|
---|
35 | Use_Sigarg;
|
---|
36 | sig_die("Floating Exception", 1);
|
---|
37 | }
|
---|
38 |
|
---|
39 |
|
---|
40 | static VOID sigidie(Sigarg)
|
---|
41 | {
|
---|
42 | Use_Sigarg;
|
---|
43 | sig_die("IOT Trap", 1);
|
---|
44 | }
|
---|
45 |
|
---|
46 | #ifdef SIGQUIT
|
---|
47 | static VOID sigqdie(Sigarg)
|
---|
48 | {
|
---|
49 | Use_Sigarg;
|
---|
50 | sig_die("Quit signal", 1);
|
---|
51 | }
|
---|
52 | #endif
|
---|
53 |
|
---|
54 |
|
---|
55 | static VOID sigindie(Sigarg)
|
---|
56 | {
|
---|
57 | Use_Sigarg;
|
---|
58 | sig_die("Interrupt", 0);
|
---|
59 | }
|
---|
60 |
|
---|
61 | static VOID sigtdie(Sigarg)
|
---|
62 | {
|
---|
63 | Use_Sigarg;
|
---|
64 | sig_die("Killed", 0);
|
---|
65 | }
|
---|
66 |
|
---|
67 | #ifdef SIGTRAP
|
---|
68 | static VOID sigtrdie(Sigarg)
|
---|
69 | {
|
---|
70 | Use_Sigarg;
|
---|
71 | sig_die("Trace trap", 1);
|
---|
72 | }
|
---|
73 | #endif
|
---|
74 |
|
---|
75 |
|
---|
76 | #ifdef __cplusplus
|
---|
77 | }
|
---|
78 | #endif
|
---|
79 |
|
---|
80 | void
|
---|
81 | f_setsig()
|
---|
82 | {
|
---|
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);
|
---|
97 |
|
---|
98 | #ifdef pdp11
|
---|
99 | ldfps(01200); /* detect overflow as an exception */
|
---|
100 | #endif
|
---|
101 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.