|
|
1.1 root 1: .\" Copyright (c) 1983 Regents of the University of California.
2: .\" All rights reserved. The Berkeley software License Agreement
3: .\" specifies the terms and conditions for redistribution.
4: .\"
5: .\" @(#)signal.3f 6.1 (Berkeley) 5/15/85
6: .\"
7: .TH SIGNAL 3F "May 15, 1985"
8: .UC 5
9: .SH NAME
10: signal \- change the action for a signal
11: .SH SYNOPSIS
12: .B integer function signal(signum, proc, flag)
13: .br
14: .B integer signum, flag
15: .br
16: .B external proc
17: .SH DESCRIPTION
18: When a process incurs a signal (see
19: .IR signal (3C))
20: the default action
21: is usually to clean up and abort.
22: The user may choose to write an alternative signal handling routine.
23: A call to
24: .I signal
25: is the way this alternate action is specified to the system.
26: .PP
27: .I Signum
28: is the signal number (see
29: .IR signal (3C)).
30: If
31: .I flag
32: is negative, then
33: .I proc
34: must be the name of the user signal handling routine.
35: If
36: .I flag
37: is zero or positive, then
38: .I proc
39: is ignored and the value of
40: .I flag
41: is passed to the system as the signal action definition.
42: In particular, this is how previously saved signal actions can be restored.
43: Two possible values for
44: .I flag
45: have specific meanings:
46: 0 means "use the default action" (See NOTES below),
47: 1 means "ignore this signal".
48: .PP
49: A positive returned value is the previous action definition.
50: A value greater than 1 is the address of a routine that
51: was to have been called on occurrence of the given signal.
52: The returned value can be used in subsequent calls to
53: .I signal
54: in order to restore a previous action definition.
55: A negative returned value is the negation of a system error code.
56: (See
57: .IR perror (3F))
58: .SH FILES
59: .ie \nM /usr/ucb/lib/libU77.a
60: .el /usr/lib/libU77.a
61: .SH "SEE ALSO"
62: signal(3C), kill(3F), kill(1)
63: .SH NOTES
64: .B f77
65: arranges to trap certain signals when a process is started.
66: The only way to restore the default
67: .B f77
68: action is to save the returned
69: value from the first call to
70: .I signal.
71: .PP
72: If the user signal handler is called, it will be passed the signal number
73: as an integer argument.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.