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 * Copyright 2015, Joyent, Inc.
26 */
27
28 /* Copyright (c) 1988 AT&T */
29 /* All Rights Reserved */
30
31 /*
32 * University Copyright- Copyright (c) 1982, 1986, 1988
33 * The Regents of the University of California
34 * All Rights Reserved
35 *
36 * University Acknowledgment- Portions of this document are derived from
37 * software developed by the University of California, Berkeley, and its
38 * contributors.
39 */
40
41 #include "lint.h"
42 #include <sys/types.h>
43 #include <signal.h>
44
45 #undef _sys_nsig
46 #undef _sys_siglist
47 #define OLDNSIG 34
48
49 const int _sys_nsig = OLDNSIG;
50
51 static const char STR_SIG_UNK[] = "UNKNOWN SIGNAL";
52 static const char STR_SIGHUP[] = "Hangup";
53 static const char STR_SIGINT[] = "Interrupt";
54 static const char STR_SIGQUIT[] = "Quit";
55 static const char STR_SIGILL[] = "Illegal Instruction";
56 static const char STR_SIGTRAP[] = "Trace/Breakpoint Trap";
57 static const char STR_SIGABRT[] = "Abort";
58 static const char STR_SIGEMT[] = "Emulation Trap";
59 static const char STR_SIGFPE[] = "Arithmetic Exception";
60 static const char STR_SIGKILL[] = "Killed";
61 static const char STR_SIGBUS[] = "Bus Error";
62 static const char STR_SIGSEGV[] = "Segmentation Fault";
63 static const char STR_SIGSYS[] = "Bad System Call";
64 static const char STR_SIGPIPE[] = "Broken Pipe";
65 static const char STR_SIGALRM[] = "Alarm Clock";
66 static const char STR_SIGTERM[] = "Terminated";
67 static const char STR_SIGUSR1[] = "User Signal 1";
68 static const char STR_SIGUSR2[] = "User Signal 2";
69 static const char STR_SIGCLD[] = "Child Status Changed";
70 static const char STR_SIGPWR[] = "Power-Fail/Restart";
71 static const char STR_SIGWINCH[] = "Window Size Change";
72 static const char STR_SIGURG[] = "Urgent Socket Condition";
73 static const char STR_SIGPOLL[] = "Pollable Event";
74 static const char STR_SIGSTOP[] = "Stopped (signal)";
75 static const char STR_SIGTSTP[] = "Stopped (user)";
76 static const char STR_SIGCONT[] = "Continued";
77 static const char STR_SIGTTIN[] = "Stopped (tty input)";
78 static const char STR_SIGTTOU[] = "Stopped (tty output)";
79 static const char STR_SIGVTALRM[] = "Virtual Timer Expired";
80 static const char STR_SIGPROF[] = "Profiling Timer Expired";
81 static const char STR_SIGXCPU[] = "Cpu Limit Exceeded";
82 static const char STR_SIGXFSZ[] = "File Size Limit Exceeded";
83 static const char STR_SIGWAITING[] = "No runnable lwp";
84 static const char STR_SIGLWP[] = "Inter-lwp signal";
85
86 const char *_sys_siglist[OLDNSIG] = {
87 STR_SIG_UNK, STR_SIGHUP, STR_SIGINT, STR_SIGQUIT,
88 STR_SIGILL, STR_SIGTRAP, STR_SIGABRT, STR_SIGEMT,
89 STR_SIGFPE, STR_SIGKILL, STR_SIGBUS, STR_SIGSEGV,
90 STR_SIGSYS, STR_SIGPIPE, STR_SIGALRM, STR_SIGTERM,
91 STR_SIGUSR1, STR_SIGUSR2, STR_SIGCLD, STR_SIGPWR,
92 STR_SIGWINCH, STR_SIGURG, STR_SIGPOLL, STR_SIGSTOP,
93 STR_SIGTSTP, STR_SIGCONT, STR_SIGTTIN, STR_SIGTTOU,
94 STR_SIGVTALRM, STR_SIGPROF, STR_SIGXCPU, STR_SIGXFSZ,
95 STR_SIGWAITING, STR_SIGLWP,
96 };
97
98 static const char *_sys_siglist_data[NSIG] = {
99 STR_SIG_UNK, STR_SIGHUP, STR_SIGINT, STR_SIGQUIT,
100 STR_SIGILL, STR_SIGTRAP, STR_SIGABRT, STR_SIGEMT,
101 STR_SIGFPE, STR_SIGKILL, STR_SIGBUS, STR_SIGSEGV,
102 STR_SIGSYS, STR_SIGPIPE, STR_SIGALRM, STR_SIGTERM,
103 STR_SIGUSR1, STR_SIGUSR2, STR_SIGCLD, STR_SIGPWR,
104 STR_SIGWINCH, STR_SIGURG, STR_SIGPOLL, STR_SIGSTOP,
105 STR_SIGTSTP, STR_SIGCONT, STR_SIGTTIN, STR_SIGTTOU,
106 STR_SIGVTALRM, STR_SIGPROF, STR_SIGXCPU, STR_SIGXFSZ,
107 STR_SIGWAITING, STR_SIGLWP,
108 "Checkpoint Freeze", /* SIGFREEZE */
109 "Checkpoint Thaw", /* SIGTHAW */
110 "Thread Cancellation", /* SIGCANCEL */
111 "Resource Lost", /* SIGLOST */
112 "Resource Control Exceeded", /* SIGXRES */
113 "Reserved for JVM 1", /* SIGJVM1 */
114 "Reserved for JVM 2", /* SIGJVM2 */
115 "Information Request", /* SIGINFO */
116 "First Realtime Signal", /* SIGRTMIN */
117 "Second Realtime Signal", /* SIGRTMIN+1 */
118 "Third Realtime Signal", /* SIGRTMIN+2 */
119 "Fourth Realtime Signal", /* SIGRTMIN+3 */
120 "Fifth Realtime Signal", /* SIGRTMIN+4 */
121 "Sixth Realtime Signal", /* SIGRTMIN+5 */
122 "Seventh Realtime Signal", /* SIGRTMIN+6 */
123 "Eighth Realtime Signal", /* SIGRTMIN+7 */
124 "Ninth Realtime Signal", /* SIGRTMIN+8 */
125 "Tenth Realtime Signal", /* SIGRTMIN+9 */
126 "Eleventh Realtime Signal", /* SIGRTMIN+10 */
127 "Twelfth Realtime Signal", /* SIGRTMIN+11 */
128 "Thirteenth Realtime Signal", /* SIGRTMIN+12 */
129 "Fourteenth Realtime Signal", /* SIGRTMIN+13 */
130 "Fifteenth Realtime Signal", /* SIGRTMIN+14 */
131 "Sixteenth Realtime Signal", /* SIGRTMIN+15 */
132 "Seventeenth Realtime Signal", /* SIGRTMIN+16 */
133 "Sixteenth Last Realtime Signal", /* SIGRTMAX-15 */
134 "Fifteenth Last Realtime Signal", /* SIGRTMAX-14 */
135 "Fourteenth Last Realtime Signal", /* SIGRTMAX-13 */
136 "Thirteenth Last Realtime Signal", /* SIGRTMAX-12 */
137 "Twelfth Last Realtime Signal", /* SIGRTMAX-11 */
138 "Eleventh Last Realtime Signal", /* SIGRTMAX-10 */
139 "Tenth Last Realtime Signal", /* SIGRTMAX-9 */
140 "Ninth Last Realtime Signal", /* SIGRTMAX-8 */
141 "Eighth Last Realtime Signal", /* SIGRTMAX-7 */
142 "Seventh Last Realtime Signal", /* SIGRTMAX-6 */
143 "Sixth Last Realtime Signal", /* SIGRTMAX-5 */
144 "Fifth Last Realtime Signal", /* SIGRTMAX-4 */
145 "Fourth Last Realtime Signal", /* SIGRTMAX-3 */
146 "Third Last Realtime Signal", /* SIGRTMAX-2 */
147 "Second Last Realtime Signal", /* SIGRTMAX-1 */
148 "Last Realtime Signal" /* SIGRTMAX */
149 };
150
151 const int _sys_siglistn = sizeof (_sys_siglist_data) / sizeof (char *);
152 const char **_sys_siglistp = _sys_siglist_data;