1STRSIGNAL(3) Linux Programmer's Manual STRSIGNAL(3)
2
3
4
6 strsignal, sigabbrev_np, sigdescr_np, sys_siglist - return string de‐
7 scribing signal
8
10 #include <string.h>
11
12 char *strsignal(int sig);
13 const char *sigdescr_np(int sig);
14 const char *sigabbrev_np(int sig);
15
16 extern const char *const sys_siglist[];
17
18 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20 sigabbrev_np(), sigdescr_np():
21 _GNU_SOURCE
22
23 strsignal():
24 From glibc 2.10 to 2.31:
25 _POSIX_C_SOURCE >= 200809L
26 Before glibc 2.10:
27 _GNU_SOURCE
28
29 sys_siglist:
30 Since glibc 2.19:
31 _DEFAULT_SOURCE
32 Glibc 2.19 and earlier:
33 _BSD_SOURCE
34
36 The strsignal() function returns a string describing the signal number
37 passed in the argument sig. The string can be used only until the next
38 call to strsignal(). The string returned by strsignal() is localized
39 according to the LC_MESSAGES category in the current locale.
40
41 The sigdescr_np() function returns a string describing the signal num‐
42 ber passed in the argument sig. Unlike strsignal() this string is not
43 influenced by the current locale.
44
45 The sigabbrev_np() function returns the abbreviated name of the signal,
46 sig. For example, given the value SIGINT, it returns the string "INT".
47
48 The (deprecated) array sys_siglist holds the signal description strings
49 indexed by signal number. The strsignal() or the sigdescr_np() func‐
50 tion should be used instead of this array; see also VERSIONS.
51
53 The strsignal() function returns the appropriate description string, or
54 an unknown signal message if the signal number is invalid. On some
55 systems (but not on Linux), NULL may instead be returned for an invalid
56 signal number.
57
58 The sigdescr_np() and sigabbrev_np() functions return the appropriate
59 description string. The returned string is statically allocated and
60 valid for the lifetime of the program. These functions return NULL for
61 an invalid signal number.
62
64 sigdescr_np() and sigabbrev_np() first appeared in glibc 2.32.
65
66 Starting with version 2.32, the sys_siglist symbol is no longer ex‐
67 ported by glibc.
68
70 For an explanation of the terms used in this section, see at‐
71 tributes(7).
72
73 ┌───────────────┬───────────────┬──────────────────────────────────────┐
74 │Interface │ Attribute │ Value │
75 ├───────────────┼───────────────┼──────────────────────────────────────┤
76 │strsignal() │ Thread safety │ MT-Unsafe race:strsignal locale │
77 ├───────────────┼───────────────┼──────────────────────────────────────┤
78 │sigdescr_np(), │ Thread safety │ MT-Safe │
79 │sigabbrev_np() │ │ │
80 └───────────────┴───────────────┴──────────────────────────────────────┘
81
83 strsignal(): POSIX.1-2008. Present on Solaris and the BSDs.
84
85 sigdescr_np() and sigdabbrev_np() are GNU extensions.
86
87 sys_siglist is nonstandard, but present on many other systems.
88
90 sigdescr_np() and sigdabbrev_np() are thread-safe and async-signal-
91 safe.
92
94 psignal(3), strerror(3)
95
97 This page is part of release 5.13 of the Linux man-pages project. A
98 description of the project, information about reporting bugs, and the
99 latest version of this page, can be found at
100 https://www.kernel.org/doc/man-pages/.
101
102
103
104GNU 2021-03-22 STRSIGNAL(3)