1STRSIGNAL(3)               Linux Programmer's Manual              STRSIGNAL(3)
2
3
4

NAME

6       strsignal,  sigdescr_np,  sigdescr_np,  sys_siglist - return string de‐
7       scribing signal
8

SYNOPSIS

10       #include <string.h>
11
12       char *strsignal(int sig);
13       char *sigdescr_np(int sig);
14       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       strsignal():
23           From glibc 2.10 to 2.31:
24               _POSIX_C_SOURCE >= 200809L
25           Before glibc 2.10:
26               _GNU_SOURCE
27       sys_siglist:
28           Since glibc 2.19:
29               _DEFAULT_SOURCE
30           Glibc 2.19 and earlier:
31               _BSD_SOURCE
32

DESCRIPTION

34       The strsignal() function returns a string describing the signal  number
35       passed in the argument sig.  The string can be used only until the next
36       call to strsignal().  The string returned by strsignal()  is  localized
37       according to the LC_MESSAGES category in the current locale.
38
39       The  sigdescr_np() function returns a string describing the signal num‐
40       ber passed in the argument sig.  Unlike strsignal() this string is  not
41       influenced by the current locale.
42
43       The sigabbrev_np() function returns the abbreviated name of the signal,
44       sig.  For example, given the value SIGINT, it returns the string "INT".
45
46       The (deprecated) array sys_siglist holds the signal description strings
47       indexed  by  signal number.  The strsignal() or the sigdescr_np() func‐
48       tion should be used instead of this array; see also VERSIONS.
49

RETURN VALUE

51       The strsignal() function returns the appropriate description string, or
52       an  unknown  signal  message  if the signal number is invalid.  On some
53       systems (but not on Linux), NULL may instead be returned for an invalid
54       signal number.
55
56       The  sigdescr_np() and sigdabbrev_np() functions return the appropriate
57       description string.  The returned string is  statically  allocated  and
58       valid for the lifetime of the program.  These functions return NULL for
59       an invalid signal number.
60

VERSIONS

62       sigdescr_np() and sigdabbrev_np() first appeared in glibc 2.32.
63
64       Starting with version 2.32, the sys_siglist symbol  is  no  longer  ex‐
65       ported by glibc.
66

ATTRIBUTES

68       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
69       tributes(7).
70
71       ┌───────────────┬───────────────┬─────────────────────────────────┐
72Interface      Attribute     Value                           
73       ├───────────────┼───────────────┼─────────────────────────────────┤
74strsignal()    │ Thread safety │ MT-Unsafe race:strsignal locale │
75       ├───────────────┼───────────────┼─────────────────────────────────┤
76sigdescr_np(), │ Thread safety │ MT-Safe                         │
77sigabbrev_np() │               │                                 │
78       └───────────────┴───────────────┴─────────────────────────────────┘
79

CONFORMING TO

81       strsignal(): POSIX.1-2008.  Present on Solaris and the BSDs.
82
83       sigdescr_np() and sigdabbrev_np() are GNU extensions.
84
85       sys_siglist is nonstandard, but present on many other systems.
86

NOTES

88       sigdescr_np()  and  sigdabbrev_np()  are  thread-safe and async-signal-
89       safe.
90

SEE ALSO

92       psignal(3), strerror(3)
93

COLOPHON

95       This page is part of release 5.10 of the Linux  man-pages  project.   A
96       description  of  the project, information about reporting bugs, and the
97       latest    version    of    this    page,    can     be     found     at
98       https://www.kernel.org/doc/man-pages/.
99
100
101
102GNU                               2020-11-01                      STRSIGNAL(3)
Impressum