xref: /titanic_50/usr/src/lib/libc/port/gen/siglist.c (revision 19d32b9ab53d17ac6605971e14c45a5281f8d9bb)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2010 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 #include "lint.h"
41 #include <sys/types.h>
42 #include <signal.h>
43 
44 #undef	_sys_nsig
45 #undef	_sys_siglist
46 #define	OLDNSIG	34
47 
48 const int _sys_nsig = OLDNSIG;
49 
50 static const char	STR_SIG_UNK[]	= "UNKNOWN SIGNAL";
51 static const char	STR_SIGHUP[]	= "Hangup";
52 static const char	STR_SIGINT[]	= "Interrupt";
53 static const char	STR_SIGQUIT[]	= "Quit";
54 static const char	STR_SIGILL[]	= "Illegal Instruction";
55 static const char	STR_SIGTRAP[]	= "Trace/Breakpoint Trap";
56 static const char	STR_SIGABRT[]	= "Abort";
57 static const char	STR_SIGEMT[]	= "Emulation Trap";
58 static const char	STR_SIGFPE[]	= "Arithmetic Exception";
59 static const char	STR_SIGKILL[]	= "Killed";
60 static const char	STR_SIGBUS[]	= "Bus Error";
61 static const char	STR_SIGSEGV[]	= "Segmentation Fault";
62 static const char	STR_SIGSYS[]	= "Bad System Call";
63 static const char	STR_SIGPIPE[]	= "Broken Pipe";
64 static const char	STR_SIGALRM[]	= "Alarm Clock";
65 static const char	STR_SIGTERM[]	= "Terminated";
66 static const char	STR_SIGUSR1[]	= "User Signal 1";
67 static const char	STR_SIGUSR2[]	= "User Signal 2";
68 static const char	STR_SIGCLD[]	= "Child Status Changed";
69 static const char	STR_SIGPWR[]	= "Power-Fail/Restart";
70 static const char	STR_SIGWINCH[]	= "Window Size Change";
71 static const char	STR_SIGURG[]	= "Urgent Socket Condition";
72 static const char	STR_SIGPOLL[]	= "Pollable Event";
73 static const char	STR_SIGSTOP[]	= "Stopped (signal)";
74 static const char	STR_SIGTSTP[]	= "Stopped (user)";
75 static const char	STR_SIGCONT[]	= "Continued";
76 static const char	STR_SIGTTIN[]	= "Stopped (tty input)";
77 static const char	STR_SIGTTOU[]	= "Stopped (tty output)";
78 static const char	STR_SIGVTALRM[]	= "Virtual Timer Expired";
79 static const char	STR_SIGPROF[]	= "Profiling Timer Expired";
80 static const char	STR_SIGXCPU[]	= "Cpu Limit Exceeded";
81 static const char	STR_SIGXFSZ[]	= "File Size Limit Exceeded";
82 static const char	STR_SIGWAITING[]	= "No runnable lwp";
83 static const char	STR_SIGLWP[]	= "Inter-lwp signal";
84 
85 const char *_sys_siglist[OLDNSIG] = {
86 	STR_SIG_UNK,	STR_SIGHUP,	STR_SIGINT,	STR_SIGQUIT,
87 	STR_SIGILL,	STR_SIGTRAP,	STR_SIGABRT,	STR_SIGEMT,
88 	STR_SIGFPE,	STR_SIGKILL,	STR_SIGBUS,	STR_SIGSEGV,
89 	STR_SIGSYS,	STR_SIGPIPE,	STR_SIGALRM,	STR_SIGTERM,
90 	STR_SIGUSR1,	STR_SIGUSR2,	STR_SIGCLD,	STR_SIGPWR,
91 	STR_SIGWINCH,	STR_SIGURG,	STR_SIGPOLL,	STR_SIGSTOP,
92 	STR_SIGTSTP,	STR_SIGCONT,	STR_SIGTTIN,	STR_SIGTTOU,
93 	STR_SIGVTALRM,	STR_SIGPROF,	STR_SIGXCPU,	STR_SIGXFSZ,
94 	STR_SIGWAITING,	STR_SIGLWP,
95 };
96 
97 static const char *_sys_siglist_data[NSIG] = {
98 	STR_SIG_UNK,	STR_SIGHUP,	STR_SIGINT,	STR_SIGQUIT,
99 	STR_SIGILL,	STR_SIGTRAP,	STR_SIGABRT,	STR_SIGEMT,
100 	STR_SIGFPE,	STR_SIGKILL,	STR_SIGBUS,	STR_SIGSEGV,
101 	STR_SIGSYS,	STR_SIGPIPE,	STR_SIGALRM,	STR_SIGTERM,
102 	STR_SIGUSR1,	STR_SIGUSR2,	STR_SIGCLD,	STR_SIGPWR,
103 	STR_SIGWINCH,	STR_SIGURG,	STR_SIGPOLL,	STR_SIGSTOP,
104 	STR_SIGTSTP,	STR_SIGCONT,	STR_SIGTTIN,	STR_SIGTTOU,
105 	STR_SIGVTALRM,	STR_SIGPROF,	STR_SIGXCPU,	STR_SIGXFSZ,
106 	STR_SIGWAITING,	STR_SIGLWP,
107 		"Checkpoint Freeze",			/* SIGFREEZE	*/
108 		"Checkpoint Thaw",			/* SIGTHAW	*/
109 		"Thread Cancellation",			/* SIGCANCEL	*/
110 		"Resource Lost",			/* SIGLOST	*/
111 		"Resource Control Exceeded",		/* SIGXRES	*/
112 		"Reserved for JVM 1",			/* SIGJVM1	*/
113 		"Reserved for JVM 2",			/* SIGJVM2	*/
114 		"Information Request",			/* SIGINFO	*/
115 		"First Realtime Signal",		/* SIGRTMIN	*/
116 		"Second Realtime Signal",		/* SIGRTMIN+1	*/
117 		"Third Realtime Signal",		/* SIGRTMIN+2	*/
118 		"Fourth Realtime Signal",		/* SIGRTMIN+3	*/
119 		"Fifth Realtime Signal",		/* SIGRTMIN+4	*/
120 		"Sixth Realtime Signal",		/* SIGRTMIN+5	*/
121 		"Seventh Realtime Signal",		/* SIGRTMIN+6	*/
122 		"Eighth Realtime Signal",		/* SIGRTMIN+7	*/
123 		"Ninth Realtime Signal",		/* SIGRTMIN+8	*/
124 		"Tenth Realtime Signal",		/* SIGRTMIN+9	*/
125 		"Eleventh Realtime Signal",		/* SIGRTMIN+10	*/
126 		"Twelfth Realtime Signal",		/* SIGRTMIN+11	*/
127 		"Thirteenth Realtime Signal",		/* SIGRTMIN+12	*/
128 		"Fourteenth Realtime Signal",		/* SIGRTMIN+13	*/
129 		"Fifteenth Realtime Signal",		/* SIGRTMIN+14	*/
130 		"Sixteenth Realtime Signal",		/* SIGRTMIN+15	*/
131 		"Sixteenth Last Realtime Signal",	/* SIGRTMAX-15	*/
132 		"Fifteenth Last Realtime Signal",	/* SIGRTMAX-14	*/
133 		"Fourteenth Last Realtime Signal",	/* SIGRTMAX-13	*/
134 		"Thirteenth Last Realtime Signal",	/* SIGRTMAX-12	*/
135 		"Twelfth Last Realtime Signal",		/* SIGRTMAX-11	*/
136 		"Eleventh Last Realtime Signal",	/* SIGRTMAX-10	*/
137 		"Tenth Last Realtime Signal",		/* SIGRTMAX-9	*/
138 		"Ninth Last Realtime Signal",		/* SIGRTMAX-8	*/
139 		"Eighth Last Realtime Signal",		/* SIGRTMAX-7	*/
140 		"Seventh Last Realtime Signal",		/* SIGRTMAX-6	*/
141 		"Sixth Last Realtime Signal",		/* SIGRTMAX-5	*/
142 		"Fifth Last Realtime Signal",		/* SIGRTMAX-4	*/
143 		"Fourth Last Realtime Signal",		/* SIGRTMAX-3	*/
144 		"Third Last Realtime Signal",		/* SIGRTMAX-2	*/
145 		"Second Last Realtime Signal",		/* SIGRTMAX-1	*/
146 		"Last Realtime Signal"			/* SIGRTMAX	*/
147 };
148 
149 const int	_sys_siglistn = sizeof (_sys_siglist_data) / sizeof (char *);
150 const char	**_sys_siglistp = _sys_siglist_data;
151