1ssignal(3C) Standard C Library Functions ssignal(3C)
2
3
4
6 ssignal, gsignal - software signals
7
9 #include <signal.h>
10
11 void(*ssignal (int sig, int (*action)(int)))(int);
12
13
14 int gsignal(int sig);
15
16
18 The ssignal() and gsignal() functions implement a software facility
19 similar to signal(3C). This facility is made available to users for
20 their own purposes.
21
22 ssignal()
23 Software signals made available to users are associated with integers
24 in the inclusive range 1 through 17. A call to ssignal() associates a
25 procedure, action, with the software signal sig; the software signal,
26 sig, is raised by a call to gsignal(). Raising a software signal causes
27 the action established for that signal to be taken.
28
29
30 The first argument to ssignal() is a number identifying the type of
31 signal for which an action is to be established. The second argument
32 defines the action; it is either the name of a (user-defined) action
33 function or one of the manifest constants SIG_DFL (default) or SIG_IGN
34 (ignore). The ssignal() function returns the action previously estab‐
35 lished for that signal type; if no action has been established or the
36 signal number is illegal, ssignal() returns SIG_DFL.
37
38 gsignal()
39 The gsignal() raises the signal identified by its argument, sig.
40
41
42 If an action function has been established for sig, then that action is
43 reset to SIG_DFL and the action function is entered with argument sig.
44 The gsignal() function returns the value returned to it by the action
45 function.
46
47
48 If the action for sig is SIG_IGN, gsignal() returns the value 1 and
49 takes no other action.
50
51
52 If the action for sig is SIG_DFL, gsignal() returns the value 0 and
53 takes no other action.
54
55
56 If sig has an illegal value or no action was ever specified for sig,
57 gsignal() returns the value 0 and takes no other action.
58
60 See attributes(5) for descriptions of the following attributes:
61
62
63
64
65 ┌─────────────────────────────┬─────────────────────────────┐
66 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
67 ├─────────────────────────────┼─────────────────────────────┤
68 │MT-Level │Unsafe │
69 └─────────────────────────────┴─────────────────────────────┘
70
72 raise(3C), signal(3C), attributes(5)
73
74
75
76SunOS 5.11 29 Dec 1996 ssignal(3C)