Research V4 development
[unix-history] / man / man2 / signal.2
CommitLineData
91d4927d
KT
1.th SIGNAL II 8/5/73
2.sh NAME
3signal \*- catch or ignore signals
4.sh SYNOPSIS
5(signal = 48.)
6.br
7.ft B
8sys signal; sig; value
9.s3
10signal(sig, func)
11.br
12int (*func)();
13.ft R
14.sh DESCRIPTION
15When the signal
16defined by
17.it sig
18is sent to the current process,
19it is to be treated according to
20.it value.
21The following is the list of signals:
22.s3
23.lp +10 5
241 hangup
25.lp +10 5
262 interrupt
27.lp +10 5
283* quit
29.lp +10 5
304* illegal instruction
31.lp +10 5
325* trace trap
33.lp +10 5
346* IOT instruction
35.lp +10 5
367* EMT instruction
37.lp +10 5
388* floating point exception
39.lp +10 5
409 kill (cannot be caught or ignored)
41.lp +10 5
4210* bus error
43.lp +10 5
4411* segmentation violation
45.lp +10 5
4612* bad argument to sys call
47.s3
48.i0
49If
50.it value
51is 0, the default system
52action applies to the signal.
53This is processes termination
54with or without a core dump.
55If
56.it value
57is odd, the signal is ignored.
58Any other even
59.it value
60specifies an address in the process
61where an interrupt is simulated.
62An RTI instruction will return from the
63interrupt.
64As a signal is caught,
65it is reset to 0.
66Thus if it is desired to
67catch every such signal,
68the catching routine must
69issue another
70.it signal
71call.
72.s3
73The starred signals in the list above
74cause core images if not caught and not ignored.
75In C,
76if
77.it func
78is 0 or 1, the action is as described above.
79If
80.it func
81is even, it is assumed to be the address
82of a function entry point.
83When the signal occurs,
84the function will be called.
85A return from the function will
86simulate the RTI.
87.s3
88After a
89.it fork,
90the child inherits
91all signals.
92The
93.it exec
94call resets all
95caught signals to default action.
96.sh "SEE ALSO"
97kill (I, II)
98.sh DIAGNOSTICS
99The error bit
100(c-bit)
101is set if the
102given signal is out of range.
103In C, a \*-1 indicates an error;
1040 indicates success.