xref: /csrg-svn/lib/libc/gen/psignal.3 (revision 58377)
148352Scael.\" Copyright (c) 1983, 1991 Regents of the University of California.
248352Scael.\" All rights reserved.
320570Smckusick.\"
448352Scael.\" %sccs.include.redist.man%
520570Smckusick.\"
6*58377Sbostic.\"     @(#)psignal.3	6.4 (Berkeley) 03/02/93
748352Scael.\"
848352Scael.Dd
948352Scael.Dt PSIGNAL 3
1048352Scael.Os BSD 4.2
1148352Scael.Sh NAME
1248352Scael.Nm psignal ,
1348352Scael.Nm sys_siglist
14*58377Sbostic.Nm sys_signame
1548352Scael.Nd system signal messages
1648352Scael.Sh SYNOPSIS
17*58377Sbostic.Fd #include <sys/signal.h>
1848352Scael.Ft void
1948352Scael.Fn psignal "unsigned sig" "const char *s"
2048352Scael.Vt extern char *sys_siglist[];
21*58377Sbostic.Vt extern char *sys_signame[];
2248352Scael.Sh DESCRIPTION
2348352ScaelThe
2448352Scael.Fn psignal
2548352Scaelfunction locates the descriptive message
26*58377Sbosticstring for the given signal number
2748352Scael.Fa sig
28*58377Sbosticand writes it to the standard error.
2948352Scael.Pp
3048352ScaelIf the argument
3148352Scael.Fa s
3248352Scaelis
3348352Scael.Pf non- Dv NULL
34*58377Sbosticit is written to the standard error file descriptor
35*58377Sbosticprior to the message string,
36*58377Sbosticimmediately followed by a colon and a space.
37*58377SbosticIf the signal number is not recognized
38*58377Sbostic.Pq Xr sigaction 2 ,
39*58377Sbosticthe string
40*58377Sbostic.Dq "Unknown signal
41*58377Sbosticis produced.
4248352Scael.Pp
4348352ScaelThe message strings can be accessed directly
44*58377Sbosticthrough the external array
45*58377Sbostic.Va sys_siglist ,
46*58377Sbosticindexed by recognized signal numbers.
47*58377SbosticThe external array
48*58377Sbostic.Va sys_signame
49*58377Sbosticis used similarly and
50*58377Sbosticcontains short, lower-case abbreviations for signals
51*58377Sbosticwhich are useful for recognizing signal names
52*58377Sbosticin user input.
5348352ScaelThe defined variable
5448352Scael.Dv NSIG
55*58377Sbosticcontains a count of the strings in
56*58377Sbostic.Va sys_siglist
57*58377Sbosticand
58*58377Sbostic.Va sys_signame .
5948352Scael.Sh SEE ALSO
6048352Scael.Xr sigaction 2 ,
6148352Scael.Xr perror 3
6248352Scael.Sh HISTORY
6348352ScaelThe
6448352Scael.Fn psignal
6548352Scaelfunction appeared in
6648352Scael.Bx 4.2 .
67