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