1GSIGNAL(3) Linux Programmer's Manual GSIGNAL(3)
2
3
4
6 gsignal, ssignal - software signal facility
7
9 #include <signal.h>
10
11 typedef void (*sighandler_t)(int);
12
13 int gsignal(int signum);
14
15 sighandler_t ssignal(int signum, sighandler_t action);
16
17 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19 gsignal(), ssignal():
20 Since glibc 2.19:
21 _DEFAULT_SOURCE
22 Glibc 2.19 and earlier:
23 _SVID_SOURCE
24
26 Don't use these functions under Linux. Due to a historical mistake,
27 under Linux these functions are aliases for raise(3) and signal(2),
28 respectively.
29
30 Elsewhere, on System V-like systems, these functions implement software
31 signaling, entirely independent of the classical signal(2) and kill(2)
32 functions. The function ssignal() defines the action to take when the
33 software signal with number signum is raised using the function gsig‐
34 nal(), and returns the previous such action or SIG_DFL. The function
35 gsignal() does the following: if no action (or the action SIG_DFL) was
36 specified for signum, then it does nothing and returns 0. If the
37 action SIG_IGN was specified for signum, then it does nothing and
38 returns 1. Otherwise, it resets the action to SIG_DFL and calls the
39 action function with argument signum, and returns the value returned by
40 that function. The range of possible values signum varies (often 1–15
41 or 1–17).
42
44 For an explanation of the terms used in this section, see
45 attributes(7).
46
47 ┌──────────┬───────────────┬─────────────────┐
48 │Interface │ Attribute │ Value │
49 ├──────────┼───────────────┼─────────────────┤
50 │gsignal() │ Thread safety │ MT-Safe │
51 ├──────────┼───────────────┼─────────────────┤
52 │ssignal() │ Thread safety │ MT-Safe sigintr │
53 └──────────┴───────────────┴─────────────────┘
54
56 These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris,
57 Tru64. They are called obsolete under most of these systems, and are
58 broken under Linux libc and glibc. Some systems also have gsignal_r()
59 and ssignal_r().
60
62 kill(2), signal(2), raise(3)
63
65 This page is part of release 5.04 of the Linux man-pages project. A
66 description of the project, information about reporting bugs, and the
67 latest version of this page, can be found at
68 https://www.kernel.org/doc/man-pages/.
69
70
71
72 2017-09-15 GSIGNAL(3)