OSDN Git Service

(split) LDP_man-pages: update original to v3.34.
[linuxjm/LDP_man-pages.git] / original / man3 / psignal.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sat Jul 24 18:45:17 1993 by Rik Faith (faith@cs.unc.edu)
28 .TH PSIGNAL 3  2010-10-06 "GNU" "Linux Programmer's Manual"
29 .SH NAME
30 psignal, psiginfo \- print signal message
31 .SH SYNOPSIS
32 .nf
33 .B #include <signal.h>
34 .sp
35 .BI "void psignal(int " sig ", const char *" s );
36 .BI "void psiginfo(const siginfo_t *" pinfo ", const char *" s );
37 .sp
38 .BI "extern const char *const " sys_siglist [];
39 .fi
40 .sp
41 .in -4n
42 Feature Test Macro Requirements for glibc (see
43 .BR feature_test_macros (7)):
44 .in
45 .sp
46 .BR psignal ():
47 _SVID_SOURCE || _BSD_SOURCE
48 .br
49 .BR psiginfo ():
50 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
51 .br
52 .IR sys_siglist :
53 _BSD_SOURCE
54 .SH DESCRIPTION
55 The
56 .BR psignal ()
57 function displays a message on \fIstderr\fP
58 consisting of the string \fIs\fP, a colon, a space, a string
59 describing the signal number \fIsig\fP, and a trailing newline.
60 If the string \fIs\fP is NULL or empty, the colon and space are omitted.
61 If \fIsig\fP is invalid,
62 the message displayed will indicate an unknown signal.
63
64 The
65 .BR psiginfo ()
66 function is like
67 .BR psignal (),
68 except that it displays information about the signal described by
69 .IR pinfo ,
70 which should point to a valid
71 .I siginfo_t
72 structure.
73 As well as the signal description,
74 .BR psiginfo ()
75 displays information about the origin of the signal,
76 and other information relevant to the signal
77 (e.g., the relevant memory address for hardware-generated signals,
78 the child process ID for
79 .BR SIGCHLD ,
80 and the user ID and process ID of the sender, for signals set using
81 .BR kill (2)
82 or
83 .BR sigqueue (3)).
84
85 The array \fIsys_siglist\fP holds the signal description strings
86 indexed by signal number.
87 .SH "RETURN VALUE"
88 The
89 .BR psignal ()
90 and
91 .BR psiginfo ()
92 functions return no value.
93 .SH VERSIONS
94 The
95 .BR psiginfo ()
96 function was added to glibc in version 2.10.
97 .SH "CONFORMING TO"
98 POSIX.1-2008, 4.3BSD.
99 .SH BUGS
100 In glibc versions up to 2.12,
101 .BR psiginfo ()
102 had the following bugs:
103 .IP * 3
104 In some circumstances, a trailing newline is not printed.
105 .\" FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12107
106 .\" Reportedly now fixed; check glibc 2.13
107 .IP *
108 Additional details are not displayed for real-time signals.
109 .\" FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12108
110 .\" Reportedly now fixed; check glibc 2.13
111 .SH "SEE ALSO"
112 .BR sigaction (2),
113 .BR perror (3),
114 .BR strsignal (3),
115 .BR signal (7)