1PSIGINFO(3P) POSIX Programmer's Manual PSIGINFO(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 psiginfo, psignal — print signal information to standard error
14
16 #include <signal.h>
17
18 void psiginfo(const siginfo_t *pinfo, const char *message);
19 void psignal(int signum, const char *message);
20
22 The psiginfo() and psignal() functions shall print a message out on
23 stderr associated with a signal number. If message is not null and is
24 not the empty string, then the string pointed to by the message argu‐
25 ment shall be printed first, followed by a <colon>, a <space>, and the
26 signal description string indicated by signum, or by the signal associ‐
27 ated with pinfo. If the message argument is null or points to an empty
28 string, then only the signal description shall be printed. For psig‐
29 info(), the argument pinfo references a valid siginfo_t structure. For
30 psignal(), if signum is not a valid signal number, the behavior is
31 implementation-defined.
32
33 The psiginfo() and psignal() functions shall not change the orientation
34 of the standard error stream.
35
36 The psiginfo() and psignal() functions shall mark for update the last
37 data modification and last file status change timestamps of the file
38 associated with the standard error stream at some time between their
39 successful completion and exit(), abort(), or the completion of
40 fflush() or fclose() on stderr.
41
42 The psiginfo() and psignal() functions shall not change the setting of
43 errno if successful.
44
45 On error, the psiginfo() and psignal() functions shall set the error
46 indicator for the stream to which stderr points, and shall set errno to
47 indicate the error.
48
49 Since no value is returned, an application wishing to check for error
50 situations should set errno to 0, then call psiginfo() or psignal(),
51 then check errno.
52
54 These functions shall not return a value.
55
57 Refer to fputc().
58
59 The following sections are informative.
60
62 None.
63
65 As an alternative to setting errno to zero before the call and checking
66 if it is non-zero afterwards, applications can use ferror() to detect
67 whether psiginfo() or psignal() encountered an error.
68
69 An application wishing to use this method to check for error situations
70 should call clearerr(stderr) before calling psiginfo() or psignal(),
71 then if ferror(stderr) returns non-zero, the value of errno indicates
72 which error occurred.
73
75 System V historically has psignal() and psiginfo() in <siginfo.h>.
76 However, the <siginfo.h> header is not specified in the Base Defini‐
77 tions volume of POSIX.1‐2008, and the type siginfo_t is defined in
78 <signal.h>.
79
81 None.
82
84 fputc(), perror(), strsignal()
85
86 The Base Definitions volume of POSIX.1‐2008, <signal.h>
87
89 Portions of this text are reprinted and reproduced in electronic form
90 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
91 -- Portable Operating System Interface (POSIX), The Open Group Base
92 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
93 cal and Electronics Engineers, Inc and The Open Group. (This is
94 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
95 event of any discrepancy between this version and the original IEEE and
96 The Open Group Standard, the original IEEE and The Open Group Standard
97 is the referee document. The original Standard can be obtained online
98 at http://www.unix.org/online.html .
99
100 Any typographical or formatting errors that appear in this page are
101 most likely to have been introduced during the conversion of the source
102 files to man page format. To report such errors, see https://www.ker‐
103 nel.org/doc/man-pages/reporting_bugs.html .
104
105
106
107IEEE/The Open Group 2013 PSIGINFO(3P)