xref: /illumos-gate/usr/src/lib/libc/port/gen/siglist.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1988 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 /*
31  * University Copyright- Copyright (c) 1982, 1986, 1988
32  * The Regents of the University of California
33  * All Rights Reserved
34  *
35  * University Acknowledgment- Portions of this document are derived from
36  * software developed by the University of California, Berkeley, and its
37  * contributors.
38  */
39 
40 #pragma ident	"%Z%%M%	%I%	%E% SMI"
41 
42 #include "synonyms.h"
43 #include <sys/types.h>
44 #include <signal.h>
45 
46 #undef	_sys_nsig
47 #undef	_sys_siglist
48 #define	OLDNSIG	34
49 
50 const int _sys_nsig = OLDNSIG;
51 
52 static const char	STR_SIG_UNK[]	= "UNKNOWN SIGNAL";
53 static const char	STR_SIGHUP[]	= "Hangup";
54 static const char	STR_SIGINT[]	= "Interrupt";
55 static const char	STR_SIGQUIT[]	= "Quit";
56 static const char	STR_SIGILL[]	= "Illegal Instruction";
57 static const char	STR_SIGTRAP[]	= "Trace/Breakpoint Trap";
58 static const char	STR_SIGABRT[]	= "Abort";
59 static const char	STR_SIGEMT[]	= "Emulation Trap";
60 static const char	STR_SIGFPE[]	= "Arithmetic Exception";
61 static const char	STR_SIGKILL[]	= "Killed";
62 static const char	STR_SIGBUS[]	= "Bus Error";
63 static const char	STR_SIGSEGV[]	= "Segmentation Fault";
64 static const char	STR_SIGSYS[]	= "Bad System Call";
65 static const char	STR_SIGPIPE[]	= "Broken Pipe";
66 static const char	STR_SIGALRM[]	= "Alarm Clock";
67 static const char	STR_SIGTERM[]	= "Terminated";
68 static const char	STR_SIGUSR1[]	= "User Signal 1";
69 static const char	STR_SIGUSR2[]	= "User Signal 2";
70 static const char	STR_SIGCLD[]	= "Child Status Changed";
71 static const char	STR_SIGPWR[]	= "Power-Fail/Restart";
72 static const char	STR_SIGWINCH[]	= "Window Size Change";
73 static const char	STR_SIGURG[]	= "Urgent Socket Condition";
74 static const char	STR_SIGPOLL[]	= "Pollable Event";
75 static const char	STR_SIGSTOP[]	= "Stopped (signal)";
76 static const char	STR_SIGTSTP[]	= "Stopped (user)";
77 static const char	STR_SIGCONT[]	= "Continued";
78 static const char	STR_SIGTTIN[]	= "Stopped (tty input)";
79 static const char	STR_SIGTTOU[]	= "Stopped (tty output)";
80 static const char	STR_SIGVTALRM[]	= "Virtual Timer Expired";
81 static const char	STR_SIGPROF[]	= "Profiling Timer Expired";
82 static const char	STR_SIGXCPU[]	= "Cpu Limit Exceeded";
83 static const char	STR_SIGXFSZ[]	= "File Size Limit Exceeded";
84 static const char	STR_SIGWAITING[]	= "No runnable lwp";
85 static const char	STR_SIGLWP[]	= "Inter-lwp signal";
86 
87 const char *_sys_siglist[OLDNSIG] = {
88 	STR_SIG_UNK,	STR_SIGHUP,	STR_SIGINT,	STR_SIGQUIT,
89 	STR_SIGILL,	STR_SIGTRAP,	STR_SIGABRT,	STR_SIGEMT,
90 	STR_SIGFPE,	STR_SIGKILL,	STR_SIGBUS,	STR_SIGSEGV,
91 	STR_SIGSYS,	STR_SIGPIPE,	STR_SIGALRM,	STR_SIGTERM,
92 	STR_SIGUSR1,	STR_SIGUSR2,	STR_SIGCLD,	STR_SIGPWR,
93 	STR_SIGWINCH,	STR_SIGURG,	STR_SIGPOLL,	STR_SIGSTOP,
94 	STR_SIGTSTP,	STR_SIGCONT,	STR_SIGTTIN,	STR_SIGTTOU,
95 	STR_SIGVTALRM,	STR_SIGPROF,	STR_SIGXCPU,	STR_SIGXFSZ,
96 	STR_SIGWAITING,	STR_SIGLWP,
97 };
98 
99 static const char *_sys_siglist_data[NSIG] = {
100 	STR_SIG_UNK,	STR_SIGHUP,	STR_SIGINT,	STR_SIGQUIT,
101 	STR_SIGILL,	STR_SIGTRAP,	STR_SIGABRT,	STR_SIGEMT,
102 	STR_SIGFPE,	STR_SIGKILL,	STR_SIGBUS,	STR_SIGSEGV,
103 	STR_SIGSYS,	STR_SIGPIPE,	STR_SIGALRM,	STR_SIGTERM,
104 	STR_SIGUSR1,	STR_SIGUSR2,	STR_SIGCLD,	STR_SIGPWR,
105 	STR_SIGWINCH,	STR_SIGURG,	STR_SIGPOLL,	STR_SIGSTOP,
106 	STR_SIGTSTP,	STR_SIGCONT,	STR_SIGTTIN,	STR_SIGTTOU,
107 	STR_SIGVTALRM,	STR_SIGPROF,	STR_SIGXCPU,	STR_SIGXFSZ,
108 	STR_SIGWAITING,	STR_SIGLWP,
109 		"Checkpoint Freeze",		/* SIGFREEZE	*/
110 		"Checkpoint Thaw",		/* SIGTHAW	*/
111 		"Thread Cancellation",		/* SIGCANCEL	*/
112 		"Resource Lost",		/* SIGLOST	*/
113 		"Resource Control Exceeded",	/* SIGXRES	*/
114 		"Reserved for JVM 1",		/* SIGJVM1	*/
115 		"Reserved for JVM 2",		/* SIGJVM2	*/
116 		"First Realtime Signal",	/* SIGRTMIN	*/
117 		"Second Realtime Signal",	/* SIGRTMIN+1	*/
118 		"Third Realtime Signal",	/* SIGRTMIN+2	*/
119 		"Fourth Realtime Signal",	/* SIGRTMIN+3	*/
120 		"Fourth Last Realtime Signal",	/* SIGRTMAX-3	*/
121 		"Third Last Realtime Signal",	/* SIGRTMAX-2	*/
122 		"Second Last Realtime Signal",	/* SIGRTMAX-1	*/
123 		"Last Realtime Signal"		/* SIGRTMAX	*/
124 };
125 
126 const int	_sys_siglistn = sizeof (_sys_siglist_data) / sizeof (char *);
127 const char	**_sys_siglistp = _sys_siglist_data;
128