]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/strsignal.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / man3 / strsignal.3
CommitLineData
a1eaacb1 1'\" t
fea681da 2.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
5dc64edd 3.\" and Copyright (C) 2020 Michael Kerrisk <mtk.manpages@gmail.com>
fea681da 4.\"
5fbde956 5.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
6.\"
7.\" References consulted:
8.\" Linux libc source code
9.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10.\" 386BSD man pages
11.\" Modified Sat Jul 24 17:59:03 1993 by Rik Faith (faith@cs.unc.edu)
4c1c5274 12.TH strsignal 3 (date) "Linux man-pages (unreleased)"
fea681da 13.SH NAME
15f0b7af
AC
14strsignal, sigabbrev_np, sigdescr_np, sys_siglist \-
15return string describing signal
5179cbd6
AC
16.SH LIBRARY
17Standard C library
8fc3b2cf 18.RI ( libc ", " \-lc )
fea681da
MK
19.SH SYNOPSIS
20.nf
fea681da 21.B #include <string.h>
68e4db0a 22.PP
fea681da 23.BI "char *strsignal(int " sig );
a2d963a8
AC
24.BI "const char *sigdescr_np(int " sig );
25.BI "const char *sigabbrev_np(int " sig );
68e4db0a 26.PP
bde1e34f 27.BI "[[deprecated]] extern const char *const " sys_siglist [];
fea681da 28.fi
68e4db0a 29.PP
d39ad78f 30.RS -4
235063a0
MK
31Feature Test Macro Requirements for glibc (see
32.BR feature_test_macros (7)):
d39ad78f 33.RE
68e4db0a 34.PP
5dc64edd
MK
35.BR sigabbrev_np (),
36.BR sigdescr_np ():
9d2adbae 37.nf
ea40ab11 38 _GNU_SOURCE
9d2adbae 39.fi
38c1dbe9 40.PP
5dc64edd 41.BR strsignal ():
9d2adbae 42.nf
b324e17d 43 From glibc 2.10 to glibc 2.31:
5c10d2c5 44 _POSIX_C_SOURCE >= 200809L
38c1dbe9
MK
45 Before glibc 2.10:
46 _GNU_SOURCE
9d2adbae 47.fi
98c9347c 48.PP
31720347 49.IR sys_siglist :
9d2adbae 50.nf
31720347
MK
51 Since glibc 2.19:
52 _DEFAULT_SOURCE
75c018a1 53 glibc 2.19 and earlier:
31720347 54 _BSD_SOURCE
9d2adbae 55.fi
fea681da 56.SH DESCRIPTION
60a90ecd
MK
57The
58.BR strsignal ()
59function returns a string describing the signal
46d8df8e
MK
60number passed in the argument
61.IR sig .
33a0ccb2 62The string can be used only until the next call to
60a90ecd 63.BR strsignal ().
5dc64edd
MK
64The string returned by
65.BR strsignal ()
66is localized according to the
67.B LC_MESSAGES
68category in the current locale.
69.PP
70The
71.BR sigdescr_np ()
72function returns a string describing the signal
73number passed in the argument
74.IR sig .
75Unlike
76.BR strsignal ()
77this string is not influenced by the current locale.
78.PP
79The
80.BR sigabbrev_np ()
81function returns the abbreviated name of the signal,
82.IR sig .
83For example, given the value
84.BR SIGINT ,
85it returns the string "INT".
fea681da 86.PP
2d711519 87The (deprecated) array
46d8df8e
MK
88.I sys_siglist
89holds the signal description strings
c13182ef 90indexed by signal number.
60a90ecd
MK
91The
92.BR strsignal ()
5dc64edd
MK
93or the
94.BR sigdescr_np ()
2d711519 95function should be used instead of this array; see also VERSIONS.
47297adb 96.SH RETURN VALUE
60a90ecd
MK
97The
98.BR strsignal ()
99function returns the appropriate description
fea681da 100string, or an unknown signal message if the signal number is invalid.
b437fdd9
MK
101On some systems (but not on Linux), NULL may instead be
102returned for an invalid signal number.
5dc64edd
MK
103.PP
104The
105.BR sigdescr_np ()
106and
f589f0e1 107.BR sigabbrev_np ()
5dc64edd
MK
108functions return the appropriate description string.
109The returned string is statically allocated and valid for
110the lifetime of the program.
111These functions return NULL for an invalid signal number.
5e6495f4
ZL
112.SH ATTRIBUTES
113For an explanation of the terms used in this section, see
114.BR attributes (7).
115.TS
116allbox;
b32feea5 117lb lb lbx
5e6495f4
ZL
118l l l.
119Interface Attribute Value
120T{
9e54434e
BR
121.na
122.nh
5e6495f4 123.BR strsignal ()
b32feea5 124T} Thread safety T{
9e54434e
BR
125.na
126.nh
b32feea5
MK
127MT-Unsafe race:strsignal locale
128T}
5dc64edd 129T{
9e54434e
BR
130.na
131.nh
5dc64edd
MK
132.BR sigdescr_np (),
133.BR sigabbrev_np ()
134T} Thread safety MT-Safe
5e6495f4 135.TE
847e0d88 136.sp 1
4131356c
AC
137.SH STANDARDS
138.TP
139.BR strsignal ()
140POSIX.1-2008.
141.TP
196224f7 142.BR sigdescr_np ()
4131356c 143.TQ
196224f7 144.BR sigabbrev_np ()
4131356c
AC
145GNU.
146.TP
196224f7 147.I sys_siglist
4131356c
AC
148None.
149.\" glibc commit b1ccfc061feee9ce616444ded8e1cd5acf9fa97f
150.SH HISTORY
151.TP
152.BR strsignal ()
2773008f 153POSIX.1-2008.
4131356c
AC
154Solaris, BSD.
155.TP
5dc64edd 156.BR sigdescr_np ()
4131356c 157.TQ
334f6d95 158.BR sigabbrev_np ()
4131356c
AC
159glibc 2.32.
160.TP
970c890a 161.I sys_siglist
4131356c 162Removed in glibc 2.32.
5dc64edd
MK
163.SH NOTES
164.BR sigdescr_np ()
165and
334f6d95 166.BR sigabbrev_np ()
5dc64edd 167are thread-safe and async-signal-safe.
47297adb 168.SH SEE ALSO
fea681da 169.BR psignal (3),
0a4f8b7b 170.BR strerror (3)