1.\" $NetBSD: psignal.3,v 1.15 2003/08/07 16:42:55 agc Exp $ 2.\" 3.\" Copyright (c) 1983, 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the University nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.\" @(#)psignal.3 8.2 (Berkeley) 2/27/95 31.\" 32.Dd February 27, 1995 33.Dt PSIGNAL 3 34.Os 35.Sh NAME 36.Nm psignal , 37.Nm sys_siglist , 38.Nm sys_signame 39.Nd system signal messages 40.Sh LIBRARY 41.Lb libc 42.Sh SYNOPSIS 43.In signal.h 44.Ft void 45.Fn psignal "unsigned sig" "const char *s" 46.Vt extern const char * const sys_siglist[]; 47.Vt extern const char * const sys_signame[]; 48.Sh DESCRIPTION 49The 50.Fn psignal 51function locates the descriptive message 52string for the given signal number 53.Fa sig 54and writes it to the standard error. 55.Pp 56If the argument 57.Fa s 58is 59.Pf non- Dv NULL 60it is written to the standard error file descriptor 61prior to the message string, 62immediately followed by a colon and a space. 63If the signal number is not recognized 64.Pq Xr sigaction 2 , 65the string 66.Dq "Unknown signal 67is produced. 68.Pp 69The message strings can be accessed directly using the external array 70.Va sys_siglist , 71indexed by recognized signal numbers. 72The external array 73.Va sys_signame 74is used similarly and contains short, upper-case abbreviations for signals 75which are useful for recognizing signal names in user input. 76The defined variable 77.Dv NSIG 78contains a count of the strings in 79.Va sys_siglist 80and 81.Va sys_signame . 82.Sh SEE ALSO 83.Xr sigaction 2 , 84.Xr perror 3 , 85.Xr setlocale 3 , 86.Xr strsignal 3 87.Sh HISTORY 88The 89.Fn psignal 90function appeared in 91.Bx 4.2 . 92