xref: /freebsd/lib/libc/gen/siglist.c (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
1 /*
2  * Copyright (c) 1983, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 4. Neither the name of the University nor the names of its contributors
14  *    may be used to endorse or promote products derived from this software
15  *    without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  */
29 
30 #if defined(LIBC_SCCS) && !defined(lint)
31 static char sccsid[] = "@(#)siglist.c	8.1 (Berkeley) 6/4/93";
32 #endif /* LIBC_SCCS and not lint */
33 #include <sys/cdefs.h>
34 __FBSDID("$FreeBSD$");
35 
36 #include <signal.h>
37 
38 const char *const sys_signame[NSIG] = {
39 	"Signal 0",
40 	"HUP",				/* SIGHUP */
41 	"INT",				/* SIGINT */
42 	"QUIT",				/* SIGQUIT */
43 	"ILL",				/* SIGILL */
44 	"TRAP",				/* SIGTRAP */
45 	"ABRT",				/* SIGABRT */
46 	"EMT",				/* SIGEMT */
47 	"FPE",				/* SIGFPE */
48 	"KILL",				/* SIGKILL */
49 	"BUS",				/* SIGBUS */
50 	"SEGV",				/* SIGSEGV */
51 	"SYS",				/* SIGSYS */
52 	"PIPE",				/* SIGPIPE */
53 	"ALRM",				/* SIGALRM */
54 	"TERM",				/* SIGTERM */
55 	"URG",				/* SIGURG */
56 	"STOP",				/* SIGSTOP */
57 	"TSTP",				/* SIGTSTP */
58 	"CONT",				/* SIGCONT */
59 	"CHLD",				/* SIGCHLD */
60 	"TTIN",				/* SIGTTIN */
61 	"TTOU",				/* SIGTTOU */
62 	"IO",				/* SIGIO */
63 	"XCPU",				/* SIGXCPU */
64 	"XFSZ",				/* SIGXFSZ */
65 	"VTALRM",			/* SIGVTALRM */
66 	"PROF",				/* SIGPROF */
67 	"WINCH",			/* SIGWINCH */
68 	"INFO",				/* SIGINFO */
69 	"USR1",				/* SIGUSR1 */
70 	"USR2"				/* SIGUSR2 */
71 };
72 
73 const char *const sys_siglist[NSIG] = {
74 	"Signal 0",
75 	"Hangup",			/* SIGHUP */
76 	"Interrupt",			/* SIGINT */
77 	"Quit",				/* SIGQUIT */
78 	"Illegal instruction",		/* SIGILL */
79 	"Trace/BPT trap",		/* SIGTRAP */
80 	"Abort trap",			/* SIGABRT */
81 	"EMT trap",			/* SIGEMT */
82 	"Floating point exception",	/* SIGFPE */
83 	"Killed",			/* SIGKILL */
84 	"Bus error",			/* SIGBUS */
85 	"Segmentation fault",		/* SIGSEGV */
86 	"Bad system call",		/* SIGSYS */
87 	"Broken pipe",			/* SIGPIPE */
88 	"Alarm clock",			/* SIGALRM */
89 	"Terminated",			/* SIGTERM */
90 	"Urgent I/O condition",		/* SIGURG */
91 	"Suspended (signal)",		/* SIGSTOP */
92 	"Suspended",			/* SIGTSTP */
93 	"Continued",			/* SIGCONT */
94 	"Child exited",			/* SIGCHLD */
95 	"Stopped (tty input)",		/* SIGTTIN */
96 	"Stopped (tty output)",		/* SIGTTOU */
97 	"I/O possible",			/* SIGIO */
98 	"Cputime limit exceeded",	/* SIGXCPU */
99 	"Filesize limit exceeded",	/* SIGXFSZ */
100 	"Virtual timer expired",	/* SIGVTALRM */
101 	"Profiling timer expired",	/* SIGPROF */
102 	"Window size changes",		/* SIGWINCH */
103 	"Information request",		/* SIGINFO */
104 	"User defined signal 1",	/* SIGUSR1 */
105 	"User defined signal 2"		/* SIGUSR2 */
106 };
107 const int sys_nsig = sizeof(sys_siglist) / sizeof(sys_siglist[0]);
108