Debian Codegraph @

upstream/debian-unstable/man3/psignal.3

raw
1 '\" t
2 .\" Copyright 1993, David Metcalfe <[email protected]>
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH psignal 3 2026-02-08 "Linux man-pages 6.18"
8 .SH NAME
9 psignal, psiginfo \- print signal description
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ,\~ \-lc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <signal.h>
16 .P
17 .BI "void psignal(int " sig ", const char *" s );
18 .BI "void psiginfo(const siginfo_t *" pinfo ", const char *" s );
19 .fi
20 .P
21 .RS -4
22 Feature Test Macro Requirements for glibc (see
23 .BR feature_test_macros (7)):
24 .RE
25 .P
26 .BR psignal ():
27 .nf
28 Since glibc 2.19:
29 _DEFAULT_SOURCE
30 glibc 2.19 and earlier:
31 _BSD_SOURCE || _SVID_SOURCE
32 .fi
33 .P
34 .BR psiginfo ():
35 .nf
36 _POSIX_C_SOURCE >= 200809L
37 .fi
38 .SH DESCRIPTION
39 The
40 .BR psignal ()
41 function displays a message on
42 .I stderr
43 consisting of the string
44 .IR s ,
45 a colon,
46 a space,
47 a string
48 describing the signal number
49 .IR sig ,
50 and a trailing newline.
51 If the string
52 .I s
53 is NULL or empty, the colon and space are omitted.
54 If
55 .I sig
56 is invalid,
57 the message displayed will indicate an unknown signal.
58 .P
59 The
60 .BR psiginfo ()
61 function is like
62 .BR psignal (),
63 except that it displays information about the signal described by
64 .IR pinfo ,
65 which should point to a valid
66 .I siginfo_t
67 structure.
68 As well as the signal description,
69 .BR psiginfo ()
70 displays information about the origin of the signal,
71 and other information relevant to the signal
72 (e.g., the relevant memory address for hardware-generated signals,
73 the child process ID for
74 .BR SIGCHLD ,
75 and the user ID and process ID of the sender, for signals set using
76 .BR kill (2)
77 or
78 .BR sigqueue (3)).
79 .SH RETURN VALUE
80 The
81 .BR psignal ()
82 and
83 .BR psiginfo ()
84 functions return no value.
85 .SH ATTRIBUTES
86 For an explanation of the terms used in this section, see
87 .BR attributes (7).
88 .TS
89 allbox;
90 lbx lb lb
91 l l l.
92 Interface Attribute Value
93 T{
94 .na
95 .nh
96 .BR psignal (),
97 .BR psiginfo ()
98 T} Thread safety MT-Safe locale
99 .TE
100 .SH STANDARDS
101 POSIX.1-2008.
102 .SH HISTORY
103 glibc 2.10.
104 POSIX.1-2008, 4.3BSD.
105 .SH BUGS
106 Up to glibc 2.12,
107 .BR psiginfo ()
108 had the following bugs:
109 .IP \[bu] 3
110 In some circumstances, a trailing newline is not printed.
111 .\" FIXME . http://sourceware.org/bugzilla/show_bug.cgi?id=12107
112 .\" Reportedly now fixed; check glibc 2.13
113 .IP \[bu]
114 Additional details are not displayed for real-time signals.
115 .\" FIXME . http://sourceware.org/bugzilla/show_bug.cgi?id=12108
116 .\" Reportedly now fixed; check glibc 2.13
117 .SH SEE ALSO
118 .BR sigaction (2),
119 .BR perror (3),
120 .BR strsignal (3),
121 .BR signal (7)