]>
Commit | Line | Data |
---|---|---|
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 |
14 | strsignal, sigabbrev_np, sigdescr_np, sys_siglist \- |
15 | return string describing signal | |
5179cbd6 AC |
16 | .SH LIBRARY |
17 | Standard 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 |
31 | Feature 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 |
57 | The |
58 | .BR strsignal () | |
59 | function returns a string describing the signal | |
46d8df8e MK |
60 | number passed in the argument |
61 | .IR sig . | |
33a0ccb2 | 62 | The string can be used only until the next call to |
60a90ecd | 63 | .BR strsignal (). |
5dc64edd MK |
64 | The string returned by |
65 | .BR strsignal () | |
66 | is localized according to the | |
67 | .B LC_MESSAGES | |
68 | category in the current locale. | |
69 | .PP | |
70 | The | |
71 | .BR sigdescr_np () | |
72 | function returns a string describing the signal | |
73 | number passed in the argument | |
74 | .IR sig . | |
75 | Unlike | |
76 | .BR strsignal () | |
77 | this string is not influenced by the current locale. | |
78 | .PP | |
79 | The | |
80 | .BR sigabbrev_np () | |
81 | function returns the abbreviated name of the signal, | |
82 | .IR sig . | |
83 | For example, given the value | |
84 | .BR SIGINT , | |
85 | it returns the string "INT". | |
fea681da | 86 | .PP |
2d711519 | 87 | The (deprecated) array |
46d8df8e MK |
88 | .I sys_siglist |
89 | holds the signal description strings | |
c13182ef | 90 | indexed by signal number. |
60a90ecd MK |
91 | The |
92 | .BR strsignal () | |
5dc64edd MK |
93 | or the |
94 | .BR sigdescr_np () | |
2d711519 | 95 | function should be used instead of this array; see also VERSIONS. |
47297adb | 96 | .SH RETURN VALUE |
60a90ecd MK |
97 | The |
98 | .BR strsignal () | |
99 | function returns the appropriate description | |
fea681da | 100 | string, or an unknown signal message if the signal number is invalid. |
b437fdd9 MK |
101 | On some systems (but not on Linux), NULL may instead be |
102 | returned for an invalid signal number. | |
5dc64edd MK |
103 | .PP |
104 | The | |
105 | .BR sigdescr_np () | |
106 | and | |
f589f0e1 | 107 | .BR sigabbrev_np () |
5dc64edd MK |
108 | functions return the appropriate description string. |
109 | The returned string is statically allocated and valid for | |
110 | the lifetime of the program. | |
111 | These functions return NULL for an invalid signal number. | |
5e6495f4 ZL |
112 | .SH ATTRIBUTES |
113 | For an explanation of the terms used in this section, see | |
114 | .BR attributes (7). | |
115 | .TS | |
116 | allbox; | |
b32feea5 | 117 | lb lb lbx |
5e6495f4 ZL |
118 | l l l. |
119 | Interface Attribute Value | |
120 | T{ | |
9e54434e BR |
121 | .na |
122 | .nh | |
5e6495f4 | 123 | .BR strsignal () |
b32feea5 | 124 | T} Thread safety T{ |
9e54434e BR |
125 | .na |
126 | .nh | |
b32feea5 MK |
127 | MT-Unsafe race:strsignal locale |
128 | T} | |
5dc64edd | 129 | T{ |
9e54434e BR |
130 | .na |
131 | .nh | |
5dc64edd MK |
132 | .BR sigdescr_np (), |
133 | .BR sigabbrev_np () | |
134 | T} Thread safety MT-Safe | |
5e6495f4 | 135 | .TE |
847e0d88 | 136 | .sp 1 |
4131356c AC |
137 | .SH STANDARDS |
138 | .TP | |
139 | .BR strsignal () | |
140 | POSIX.1-2008. | |
141 | .TP | |
196224f7 | 142 | .BR sigdescr_np () |
4131356c | 143 | .TQ |
196224f7 | 144 | .BR sigabbrev_np () |
4131356c AC |
145 | GNU. |
146 | .TP | |
196224f7 | 147 | .I sys_siglist |
4131356c AC |
148 | None. |
149 | .\" glibc commit b1ccfc061feee9ce616444ded8e1cd5acf9fa97f | |
150 | .SH HISTORY | |
151 | .TP | |
152 | .BR strsignal () | |
2773008f | 153 | POSIX.1-2008. |
4131356c AC |
154 | Solaris, BSD. |
155 | .TP | |
5dc64edd | 156 | .BR sigdescr_np () |
4131356c | 157 | .TQ |
334f6d95 | 158 | .BR sigabbrev_np () |
4131356c AC |
159 | glibc 2.32. |
160 | .TP | |
970c890a | 161 | .I sys_siglist |
4131356c | 162 | Removed in glibc 2.32. |
5dc64edd MK |
163 | .SH NOTES |
164 | .BR sigdescr_np () | |
165 | and | |
334f6d95 | 166 | .BR sigabbrev_np () |
5dc64edd | 167 | are thread-safe and async-signal-safe. |
47297adb | 168 | .SH SEE ALSO |
fea681da | 169 | .BR psignal (3), |
0a4f8b7b | 170 | .BR strerror (3) |