1 /* Copyright 2002, 2011 Red Hat Inc. */
4 <<psignal>>---print a signal message on standard error
11 void psignal(int <[signal]>, const char *<[prefix]>);
14 Use <<psignal>> to print (on standard error) a signal message
15 corresponding to the value of the signal number <[signal]>.
16 Unless you use <<NULL>> as the value of the argument <[prefix]>, the
17 signal message will begin with the string at <[prefix]>, followed by a
18 colon and a space (<<: >>). The remainder of the signal message is one
19 of the strings described for <<strsignal>>.
22 <<psignal>> returns no result.
25 POSIX.1-2008 requires <<psignal>>, but the strings issued vary from one
26 implementation to another.
28 Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
29 <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
37 #define WRITE_STR(str) \
39 const char *p = (str); \
40 size_t len = strlen (p); \
43 ssize_t len1 = write (fileno (stderr), p, len); \
56 if (s
!= NULL
&& *s
!= '\0')
61 WRITE_STR (strsignal (sig
));
64 WRITE_STR ((stderr
->_flags
& __SCLE
) ? "\r\n" : "\n");