1gsignal(3)                 Library Functions Manual                 gsignal(3)
2
3
4

NAME

6       gsignal, ssignal - software signal facility
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <signal.h>
13
14       typedef void (*sighandler_t)(int);
15
16       [[deprecated]] int gsignal(int signum);
17
18       [[deprecated]] sighandler_t ssignal(int signum, sighandler_t action);
19
20   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
21
22       gsignal(), ssignal():
23           Since glibc 2.19:
24               _DEFAULT_SOURCE
25           glibc 2.19 and earlier:
26               _SVID_SOURCE
27

DESCRIPTION

29       Don't  use  these  functions under Linux.  Due to a historical mistake,
30       under Linux these functions are aliases for raise(3) and signal(2), re‐
31       spectively.
32
33       Elsewhere, on System V-like systems, these functions implement software
34       signaling, entirely independent of the classical signal(2) and  kill(2)
35       functions.   The function ssignal() defines the action to take when the
36       software signal with number signum is raised using the  function  gsig‐
37       nal(),  and  returns the previous such action or SIG_DFL.  The function
38       gsignal() does the following: if no action (or the action SIG_DFL)  was
39       specified  for  signum, then it does nothing and returns 0.  If the ac‐
40       tion SIG_IGN was specified for signum, then it does nothing and returns
41       1.   Otherwise,  it  resets  the action to SIG_DFL and calls the action
42       function with argument signum, and returns the value returned  by  that
43       function.   The  range  of possible values signum varies (often 1–15 or
44       1–17).
45

ATTRIBUTES

47       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
48       tributes(7).
49
50       ┌────────────────────────────────────┬───────────────┬─────────────────┐
51Interface                           Attribute     Value           
52       ├────────────────────────────────────┼───────────────┼─────────────────┤
53gsignal()                           │ Thread safety │ MT-Safe         │
54       ├────────────────────────────────────┼───────────────┼─────────────────┤
55ssignal()                           │ Thread safety │ MT-Safe sigintr │
56       └────────────────────────────────────┴───────────────┴─────────────────┘
57

STANDARDS

59       None.
60

HISTORY

62       AIX, DG/UX, HP-UX, SCO, Solaris, Tru64.  They are called obsolete under
63       most of these systems, and are broken under glibc.  Some  systems  also
64       have gsignal_r() and ssignal_r().
65

SEE ALSO

67       kill(2), signal(2), raise(3)
68
69
70
71Linux man-pages 6.04              2023-03-30                        gsignal(3)
Impressum