xref: /original-bsd/lib/libc/gen/psignal.3 (revision fac0c393)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)psignal.3	8.2 (Berkeley) 02/27/95
7.\"
8.Dd
9.Dt PSIGNAL 3
10.Os BSD 4.2
11.Sh NAME
12.Nm psignal ,
13.Nm sys_siglist ,
14.Nm sys_signame
15.Nd system signal messages
16.Sh SYNOPSIS
17.Fd #include <sys/signal.h>
18.Ft void
19.Fn psignal "unsigned sig" "const char *s"
20.Vt extern char *sys_siglist[];
21.Vt extern char *sys_signame[];
22.Sh DESCRIPTION
23The
24.Fn psignal
25function locates the descriptive message
26string for the given signal number
27.Fa sig
28and writes it to the standard error.
29.Pp
30If the argument
31.Fa s
32is
33.Pf non- Dv NULL
34it is written to the standard error file descriptor
35prior to the message string,
36immediately followed by a colon and a space.
37If the signal number is not recognized
38.Pq Xr sigaction 2 ,
39the string
40.Dq "Unknown signal
41is produced.
42.Pp
43The message strings can be accessed directly
44through the external array
45.Va sys_siglist ,
46indexed by recognized signal numbers.
47The external array
48.Va sys_signame
49is used similarly and
50contains short, lower-case abbreviations for signals
51which are useful for recognizing signal names
52in user input.
53The defined variable
54.Dv NSIG
55contains a count of the strings in
56.Va sys_siglist
57and
58.Va sys_signame .
59.Sh SEE ALSO
60.Xr sigaction 2 ,
61.Xr perror 3
62.Sh HISTORY
63The
64.Fn psignal
65function appeared in
66.Bx 4.2 .
67