1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28*0Sstevel@tonic-gate /*	  All Rights Reserved  	*/
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate 
31*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
32*0Sstevel@tonic-gate 
33*0Sstevel@tonic-gate #include <stdio.h>
34*0Sstevel@tonic-gate #include <stdlib.h>
35*0Sstevel@tonic-gate #include <fcntl.h>
36*0Sstevel@tonic-gate #include <unistd.h>
37*0Sstevel@tonic-gate #include <string.h>
38*0Sstevel@tonic-gate #include <signal.h>
39*0Sstevel@tonic-gate #include <sys/types.h>
40*0Sstevel@tonic-gate #include <libproc.h>
41*0Sstevel@tonic-gate #include <sys/aio.h>
42*0Sstevel@tonic-gate #include <sys/port_impl.h>
43*0Sstevel@tonic-gate #include "ramdata.h"
44*0Sstevel@tonic-gate #include "systable.h"
45*0Sstevel@tonic-gate #include "print.h"
46*0Sstevel@tonic-gate #include "proto.h"
47*0Sstevel@tonic-gate 
48*0Sstevel@tonic-gate /*
49*0Sstevel@tonic-gate  * Tables of information about system calls - read-only data.
50*0Sstevel@tonic-gate  */
51*0Sstevel@tonic-gate 
52*0Sstevel@tonic-gate const	char *const	errcode[] = {	/* error code names */
53*0Sstevel@tonic-gate 	NULL,		/*  0 */
54*0Sstevel@tonic-gate 	"EPERM",	/*  1 */
55*0Sstevel@tonic-gate 	"ENOENT",	/*  2 */
56*0Sstevel@tonic-gate 	"ESRCH",	/*  3 */
57*0Sstevel@tonic-gate 	"EINTR",	/*  4 */
58*0Sstevel@tonic-gate 	"EIO",		/*  5 */
59*0Sstevel@tonic-gate 	"ENXIO",	/*  6 */
60*0Sstevel@tonic-gate 	"E2BIG",	/*  7 */
61*0Sstevel@tonic-gate 	"ENOEXEC",	/*  8 */
62*0Sstevel@tonic-gate 	"EBADF",	/*  9 */
63*0Sstevel@tonic-gate 	"ECHILD",	/* 10 */
64*0Sstevel@tonic-gate 	"EAGAIN",	/* 11 */
65*0Sstevel@tonic-gate 	"ENOMEM",	/* 12 */
66*0Sstevel@tonic-gate 	"EACCES",	/* 13 */
67*0Sstevel@tonic-gate 	"EFAULT",	/* 14 */
68*0Sstevel@tonic-gate 	"ENOTBLK",	/* 15 */
69*0Sstevel@tonic-gate 	"EBUSY",	/* 16 */
70*0Sstevel@tonic-gate 	"EEXIST",	/* 17 */
71*0Sstevel@tonic-gate 	"EXDEV",	/* 18 */
72*0Sstevel@tonic-gate 	"ENODEV",	/* 19 */
73*0Sstevel@tonic-gate 	"ENOTDIR",	/* 20 */
74*0Sstevel@tonic-gate 	"EISDIR",	/* 21 */
75*0Sstevel@tonic-gate 	"EINVAL",	/* 22 */
76*0Sstevel@tonic-gate 	"ENFILE",	/* 23 */
77*0Sstevel@tonic-gate 	"EMFILE",	/* 24 */
78*0Sstevel@tonic-gate 	"ENOTTY",	/* 25 */
79*0Sstevel@tonic-gate 	"ETXTBSY",	/* 26 */
80*0Sstevel@tonic-gate 	"EFBIG",	/* 27 */
81*0Sstevel@tonic-gate 	"ENOSPC",	/* 28 */
82*0Sstevel@tonic-gate 	"ESPIPE",	/* 29 */
83*0Sstevel@tonic-gate 	"EROFS",	/* 30 */
84*0Sstevel@tonic-gate 	"EMLINK",	/* 31 */
85*0Sstevel@tonic-gate 	"EPIPE",	/* 32 */
86*0Sstevel@tonic-gate 	"EDOM",		/* 33 */
87*0Sstevel@tonic-gate 	"ERANGE",	/* 34 */
88*0Sstevel@tonic-gate 	"ENOMSG",	/* 35 */
89*0Sstevel@tonic-gate 	"EIDRM",	/* 36 */
90*0Sstevel@tonic-gate 	"ECHRNG",	/* 37 */
91*0Sstevel@tonic-gate 	"EL2NSYNC",	/* 38 */
92*0Sstevel@tonic-gate 	"EL3HLT",	/* 39 */
93*0Sstevel@tonic-gate 	"EL3RST",	/* 40 */
94*0Sstevel@tonic-gate 	"ELNRNG",	/* 41 */
95*0Sstevel@tonic-gate 	"EUNATCH",	/* 42 */
96*0Sstevel@tonic-gate 	"ENOCSI",	/* 43 */
97*0Sstevel@tonic-gate 	"EL2HLT",	/* 44 */
98*0Sstevel@tonic-gate 	"EDEADLK",	/* 45 */
99*0Sstevel@tonic-gate 	"ENOLCK",	/* 46 */
100*0Sstevel@tonic-gate 	"ECANCELED",	/* 47 */
101*0Sstevel@tonic-gate 	"ENOTSUP",	/* 48 */
102*0Sstevel@tonic-gate 	"EDQUOT",	/* 49 */
103*0Sstevel@tonic-gate 	"EBADE",	/* 50 */
104*0Sstevel@tonic-gate 	"EBADR",	/* 51 */
105*0Sstevel@tonic-gate 	"EXFULL",	/* 52 */
106*0Sstevel@tonic-gate 	"ENOANO",	/* 53 */
107*0Sstevel@tonic-gate 	"EBADRQC",	/* 54 */
108*0Sstevel@tonic-gate 	"EBADSLT",	/* 55 */
109*0Sstevel@tonic-gate 	"EDEADLOCK",	/* 56 */
110*0Sstevel@tonic-gate 	"EBFONT",	/* 57 */
111*0Sstevel@tonic-gate 	"EOWNERDEAD",	/* 58 */
112*0Sstevel@tonic-gate 	"ENOTRECOVERABLE",	/* 59 */
113*0Sstevel@tonic-gate 	"ENOSTR",	/* 60 */
114*0Sstevel@tonic-gate 	"ENODATA",	/* 61 */
115*0Sstevel@tonic-gate 	"ETIME",	/* 62 */
116*0Sstevel@tonic-gate 	"ENOSR",	/* 63 */
117*0Sstevel@tonic-gate 	"ENONET",	/* 64 */
118*0Sstevel@tonic-gate 	"ENOPKG",	/* 65 */
119*0Sstevel@tonic-gate 	"EREMOTE",	/* 66 */
120*0Sstevel@tonic-gate 	"ENOLINK",	/* 67 */
121*0Sstevel@tonic-gate 	"EADV",		/* 68 */
122*0Sstevel@tonic-gate 	"ESRMNT",	/* 69 */
123*0Sstevel@tonic-gate 	"ECOMM",	/* 70 */
124*0Sstevel@tonic-gate 	"EPROTO",	/* 71 */
125*0Sstevel@tonic-gate 	"ELOCKUNMAPPED",	/* 72 */
126*0Sstevel@tonic-gate 	"ENOTACTIVE",	/* 73 */
127*0Sstevel@tonic-gate 	"EMULTIHOP",	/* 74 */
128*0Sstevel@tonic-gate 	NULL,		/* 75 */
129*0Sstevel@tonic-gate 	NULL,		/* 76 */
130*0Sstevel@tonic-gate 	"EBADMSG",	/* 77 */
131*0Sstevel@tonic-gate 	"ENAMETOOLONG",	/* 78 */
132*0Sstevel@tonic-gate 	"EOVERFLOW",	/* 79 */
133*0Sstevel@tonic-gate 	"ENOTUNIQ",	/* 80 */
134*0Sstevel@tonic-gate 	"EBADFD",	/* 81 */
135*0Sstevel@tonic-gate 	"EREMCHG",	/* 82 */
136*0Sstevel@tonic-gate 	"ELIBACC",	/* 83 */
137*0Sstevel@tonic-gate 	"ELIBBAD",	/* 84 */
138*0Sstevel@tonic-gate 	"ELIBSCN",	/* 85 */
139*0Sstevel@tonic-gate 	"ELIBMAX",	/* 86 */
140*0Sstevel@tonic-gate 	"ELIBEXEC",	/* 87 */
141*0Sstevel@tonic-gate 	"EILSEQ",	/* 88 */
142*0Sstevel@tonic-gate 	"ENOSYS",	/* 89 */
143*0Sstevel@tonic-gate 	"ELOOP",	/* 90 */
144*0Sstevel@tonic-gate 	"ERESTART",	/* 91 */
145*0Sstevel@tonic-gate 	"ESTRPIPE",	/* 92 */
146*0Sstevel@tonic-gate 	"ENOTEMPTY",	/* 93 */
147*0Sstevel@tonic-gate 	"EUSERS",	/* 94 */
148*0Sstevel@tonic-gate 	"ENOTSOCK",	/* 95 */
149*0Sstevel@tonic-gate 	"EDESTADDRREQ",	/* 96 */
150*0Sstevel@tonic-gate 	"EMSGSIZE",	/* 97 */
151*0Sstevel@tonic-gate 	"EPROTOTYPE",	/* 98 */
152*0Sstevel@tonic-gate 	"ENOPROTOOPT",	/* 99 */
153*0Sstevel@tonic-gate 	NULL,		/* 100 */
154*0Sstevel@tonic-gate 	NULL,		/* 101 */
155*0Sstevel@tonic-gate 	NULL,		/* 102 */
156*0Sstevel@tonic-gate 	NULL,		/* 103 */
157*0Sstevel@tonic-gate 	NULL,		/* 104 */
158*0Sstevel@tonic-gate 	NULL,		/* 105 */
159*0Sstevel@tonic-gate 	NULL,		/* 106 */
160*0Sstevel@tonic-gate 	NULL,		/* 107 */
161*0Sstevel@tonic-gate 	NULL,		/* 108 */
162*0Sstevel@tonic-gate 	NULL,		/* 109 */
163*0Sstevel@tonic-gate 	NULL,		/* 110 */
164*0Sstevel@tonic-gate 	NULL,		/* 111 */
165*0Sstevel@tonic-gate 	NULL,		/* 112 */
166*0Sstevel@tonic-gate 	NULL,		/* 113 */
167*0Sstevel@tonic-gate 	NULL,		/* 114 */
168*0Sstevel@tonic-gate 	NULL,		/* 115 */
169*0Sstevel@tonic-gate 	NULL,		/* 116 */
170*0Sstevel@tonic-gate 	NULL,		/* 117 */
171*0Sstevel@tonic-gate 	NULL,		/* 118 */
172*0Sstevel@tonic-gate 	NULL,		/* 119 */
173*0Sstevel@tonic-gate 	"EPROTONOSUPPORT",	/* 120 */
174*0Sstevel@tonic-gate 	"ESOCKTNOSUPPORT",	/* 121 */
175*0Sstevel@tonic-gate 	"EOPNOTSUPP",	/* 122 */
176*0Sstevel@tonic-gate 	"EPFNOSUPPORT",	/* 123 */
177*0Sstevel@tonic-gate 	"EAFNOSUPPORT",	/* 124 */
178*0Sstevel@tonic-gate 	"EADDRINUSE",	/* 125 */
179*0Sstevel@tonic-gate 	"EADDRNOTAVAIL", /* 126 */
180*0Sstevel@tonic-gate 	"ENETDOWN",	/* 127 */
181*0Sstevel@tonic-gate 	"ENETUNREACH",	/* 128 */
182*0Sstevel@tonic-gate 	"ENETRESET",	/* 129 */
183*0Sstevel@tonic-gate 	"ECONNABORTED",	/* 130 */
184*0Sstevel@tonic-gate 	"ECONNRESET",	/* 131 */
185*0Sstevel@tonic-gate 	"ENOBUFS",	/* 132 */
186*0Sstevel@tonic-gate 	"EISCONN",	/* 133 */
187*0Sstevel@tonic-gate 	"ENOTCONN",	/* 134 */
188*0Sstevel@tonic-gate 	NULL,		/* 135 */
189*0Sstevel@tonic-gate 	NULL,		/* 136 */
190*0Sstevel@tonic-gate 	NULL,		/* 137 */
191*0Sstevel@tonic-gate 	NULL,		/* 138 */
192*0Sstevel@tonic-gate 	NULL,		/* 139 */
193*0Sstevel@tonic-gate 	NULL,		/* 140 */
194*0Sstevel@tonic-gate 	NULL,		/* 141 */
195*0Sstevel@tonic-gate 	NULL,		/* 142 */
196*0Sstevel@tonic-gate 	"ESHUTDOWN",	/* 143 */
197*0Sstevel@tonic-gate 	"ETOOMANYREFS",	/* 144 */
198*0Sstevel@tonic-gate 	"ETIMEDOUT",	/* 145 */
199*0Sstevel@tonic-gate 	"ECONNREFUSED",	/* 146 */
200*0Sstevel@tonic-gate 	"EHOSTDOWN",	/* 147 */
201*0Sstevel@tonic-gate 	"EHOSTUNREACH",	/* 148 */
202*0Sstevel@tonic-gate 	"EALREADY",	/* 149 */
203*0Sstevel@tonic-gate 	"EINPROGRESS",	/* 150 */
204*0Sstevel@tonic-gate 	"ESTALE"	/* 151 */
205*0Sstevel@tonic-gate };
206*0Sstevel@tonic-gate 
207*0Sstevel@tonic-gate #define	NERRCODE	(sizeof (errcode) / sizeof (char *))
208*0Sstevel@tonic-gate 
209*0Sstevel@tonic-gate 
210*0Sstevel@tonic-gate const char *
211*0Sstevel@tonic-gate errname(int err)	/* return the error code name (NULL if none) */
212*0Sstevel@tonic-gate {
213*0Sstevel@tonic-gate 	const char *ename = NULL;
214*0Sstevel@tonic-gate 
215*0Sstevel@tonic-gate 	if (err >= 0 && err < NERRCODE)
216*0Sstevel@tonic-gate 		ename = errcode[err];
217*0Sstevel@tonic-gate 
218*0Sstevel@tonic-gate 	return (ename);
219*0Sstevel@tonic-gate }
220*0Sstevel@tonic-gate 
221*0Sstevel@tonic-gate 
222*0Sstevel@tonic-gate const struct systable systable[] = {
223*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
224*0Sstevel@tonic-gate {"_exit",	1, DEC, NOV, DEC},				/*   1 */
225*0Sstevel@tonic-gate {"forkall",	0, DEC, NOV},					/*   2 */
226*0Sstevel@tonic-gate {"read",	3, DEC, NOV, DEC, IOB, UNS},			/*   3 */
227*0Sstevel@tonic-gate {"write",	3, DEC, NOV, DEC, IOB, UNS},			/*   4 */
228*0Sstevel@tonic-gate {"open",	3, DEC, NOV, STG, OPN, OCT},			/*   5 */
229*0Sstevel@tonic-gate {"close",	1, DEC, NOV, DEC},				/*   6 */
230*0Sstevel@tonic-gate {"wait",	0, DEC, HHX},					/*   7 */
231*0Sstevel@tonic-gate {"creat",	2, DEC, NOV, STG, OCT},				/*   8 */
232*0Sstevel@tonic-gate {"link",	2, DEC, NOV, STG, STG},				/*   9 */
233*0Sstevel@tonic-gate {"unlink",	1, DEC, NOV, STG},				/*  10 */
234*0Sstevel@tonic-gate {"exec",	2, DEC, NOV, STG, DEC},				/*  11 */
235*0Sstevel@tonic-gate {"chdir",	1, DEC, NOV, STG},				/*  12 */
236*0Sstevel@tonic-gate {"time",	0, DEC, NOV},					/*  13 */
237*0Sstevel@tonic-gate {"mknod",	3, DEC, NOV, STG, OCT, HEX},			/*  14 */
238*0Sstevel@tonic-gate {"chmod",	2, DEC, NOV, STG, OCT},				/*  15 */
239*0Sstevel@tonic-gate {"chown",	3, DEC, NOV, STG, DEC, DEC},			/*  16 */
240*0Sstevel@tonic-gate {"brk",		1, DEC, NOV, HEX},				/*  17 */
241*0Sstevel@tonic-gate {"stat",	2, DEC, NOV, STG, HEX},				/*  18 */
242*0Sstevel@tonic-gate {"lseek",	3, DEC, NOV, DEC, DEX, WHN},			/*  19 */
243*0Sstevel@tonic-gate {"getpid",	0, DEC, DEC},					/*  20 */
244*0Sstevel@tonic-gate {"mount",	8, DEC, NOV, STG, STG, MTF, MFT, HEX, DEC, HEX, DEC},	/* 21 */
245*0Sstevel@tonic-gate {"umount",	1, DEC, NOV, STG},				/*  22 */
246*0Sstevel@tonic-gate {"setuid",	1, DEC, NOV, DEC},				/*  23 */
247*0Sstevel@tonic-gate {"getuid",	0, DEC, DEC},					/*  24 */
248*0Sstevel@tonic-gate {"stime",	1, DEC, NOV, DEC},				/*  25 */
249*0Sstevel@tonic-gate {"pcsample",	2, DEC, NOV, HEX, DEC},				/*  26 */
250*0Sstevel@tonic-gate {"alarm",	1, DEC, NOV, UNS},				/*  27 */
251*0Sstevel@tonic-gate {"fstat",	2, DEC, NOV, DEC, HEX},				/*  28 */
252*0Sstevel@tonic-gate {"pause",	0, DEC, NOV},					/*  29 */
253*0Sstevel@tonic-gate {"utime",	2, DEC, NOV, STG, HEX},				/*  30 */
254*0Sstevel@tonic-gate {"stty",	2, DEC, NOV, DEC, DEC},				/*  31 */
255*0Sstevel@tonic-gate {"gtty",	2, DEC, NOV, DEC, DEC},				/*  32 */
256*0Sstevel@tonic-gate {"access",	2, DEC, NOV, STG, ACC},				/*  33 */
257*0Sstevel@tonic-gate {"nice",	1, DEC, NOV, DEC},				/*  34 */
258*0Sstevel@tonic-gate {"statfs",	4, DEC, NOV, STG, HEX, DEC, DEC},		/*  35 */
259*0Sstevel@tonic-gate {"sync",	0, DEC, NOV},					/*  36 */
260*0Sstevel@tonic-gate {"kill",	2, DEC, NOV, DEC, SIG},				/*  37 */
261*0Sstevel@tonic-gate {"fstatfs",	4, DEC, NOV, DEC, HEX, DEC, DEC},		/*  38 */
262*0Sstevel@tonic-gate {"pgrpsys",	3, DEC, NOV, DEC, DEC, DEC},			/*  39 */
263*0Sstevel@tonic-gate 
264*0Sstevel@tonic-gate /* The following entry was xenix */
265*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
266*0Sstevel@tonic-gate 
267*0Sstevel@tonic-gate {"dup",		1, DEC, NOV, DEC},				/*  41 */
268*0Sstevel@tonic-gate {"pipe",	0, DEC, DEC},					/*  42 */
269*0Sstevel@tonic-gate {"times",	1, DEC, NOV, HEX},				/*  43 */
270*0Sstevel@tonic-gate {"profil",	4, DEC, NOV, HEX, UNS, HEX, OCT},		/*  44 */
271*0Sstevel@tonic-gate {"plock",	1, DEC, NOV, PLK},				/*  45 */
272*0Sstevel@tonic-gate {"setgid",	1, DEC, NOV, DEC},				/*  46 */
273*0Sstevel@tonic-gate {"getgid",	0, DEC, DEC},					/*  47 */
274*0Sstevel@tonic-gate {"signal",	2, HEX, NOV, SIG, ACT},				/*  48 */
275*0Sstevel@tonic-gate {"msgsys",	6, DEC, NOV, DEC, DEC, DEC, DEC, DEC, DEC},	/*  49 */
276*0Sstevel@tonic-gate {"sysi86",	4, HEX, NOV, S86, HEX, HEX, HEX, DEC, DEC},	/*  50 */
277*0Sstevel@tonic-gate {"acct",	1, DEC, NOV, STG},				/*  51 */
278*0Sstevel@tonic-gate {"shmsys",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/*  52 */
279*0Sstevel@tonic-gate {"semsys",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/*  53 */
280*0Sstevel@tonic-gate {"ioctl",	3, DEC, NOV, DEC, IOC, IOA},			/*  54 */
281*0Sstevel@tonic-gate {"uadmin",	3, DEC, NOV, DEC, DEC, DEC},			/*  55 */
282*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
283*0Sstevel@tonic-gate {"utssys",	4, DEC, NOV, HEX, DEC, UTS, HEX},		/*  57 */
284*0Sstevel@tonic-gate {"fdsync",	2, DEC, NOV, DEC, FFG},				/*  58 */
285*0Sstevel@tonic-gate {"execve",	3, DEC, NOV, STG, HEX, HEX},			/*  59 */
286*0Sstevel@tonic-gate {"umask",	1, OCT, NOV, OCT},				/*  60 */
287*0Sstevel@tonic-gate {"chroot",	1, DEC, NOV, STG},				/*  61 */
288*0Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, HEX},			/*  62 */
289*0Sstevel@tonic-gate {"ulimit",	2, DEX, NOV, ULM, DEC},				/*  63 */
290*0Sstevel@tonic-gate 
291*0Sstevel@tonic-gate /*  The following 6 entries were reserved for the UNIX PC */
292*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
293*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
294*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
295*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
296*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
297*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
298*0Sstevel@tonic-gate 
299*0Sstevel@tonic-gate {"tasksys",	5, DEC, NOV, DEC, DEC, DEC, HEX, DEC},		/*  70 */
300*0Sstevel@tonic-gate {"acctctl",	3, DEC, NOV, HEX, HEX, UNS},			/*  71 */
301*0Sstevel@tonic-gate {"exacctsys",	6, DEC, NOV, DEC, IDT, DEC, HEX, DEC, HEX},	/*  72 */
302*0Sstevel@tonic-gate {"getpagesizes", 2, DEC, NOV, HEX, DEC},			/*  73 */
303*0Sstevel@tonic-gate {"rctlsys",	6, DEC, NOV, DEC, STG, HEX, HEX, DEC, DEC},	/*  74 */
304*0Sstevel@tonic-gate {"issetugid",	0, DEC, NOV},					/*  75 */
305*0Sstevel@tonic-gate {"fsat",	6, DEC, NOV, HEX, HEX, HEX, HEX, HEX, HEX},	/*  76 */
306*0Sstevel@tonic-gate {"lwp_park",	3, DEC, NOV, DEC, HEX, DEC},			/*  77 */
307*0Sstevel@tonic-gate {"sendfilev",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/*  78 */
308*0Sstevel@tonic-gate {"rmdir",	1, DEC, NOV, STG},				/*  79 */
309*0Sstevel@tonic-gate {"mkdir",	2, DEC, NOV, STG, OCT},				/*  80 */
310*0Sstevel@tonic-gate {"getdents",	3, DEC, NOV, DEC, HEX, UNS},			/*  81 */
311*0Sstevel@tonic-gate {"privsys",	5, HEX, NOV, DEC, DEC, DEC, HEX, DEC},		/*  82 */
312*0Sstevel@tonic-gate {"ucredsys",	3, DEC, NOV, DEC, DEC, HEX},			/*  83 */
313*0Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEX, DEX},			/*  84 */
314*0Sstevel@tonic-gate {"getmsg",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/*  85 */
315*0Sstevel@tonic-gate {"putmsg",	4, DEC, NOV, DEC, HEX, HEX, SMF},		/*  86 */
316*0Sstevel@tonic-gate {"poll",	3, DEC, NOV, HEX, DEC, DEC},			/*  87 */
317*0Sstevel@tonic-gate {"lstat",	2, DEC, NOV, STG, HEX},				/*  88 */
318*0Sstevel@tonic-gate {"symlink",	2, DEC, NOV, STG, STG},				/*  89 */
319*0Sstevel@tonic-gate {"readlink",	3, DEC, NOV, STG, RLK, UNS},			/*  90 */
320*0Sstevel@tonic-gate {"setgroups",	2, DEC, NOV, DEC, HEX},				/*  91 */
321*0Sstevel@tonic-gate {"getgroups",	2, DEC, NOV, DEC, HEX},				/*  92 */
322*0Sstevel@tonic-gate {"fchmod",	2, DEC, NOV, DEC, OCT},				/*  93 */
323*0Sstevel@tonic-gate {"fchown",	3, DEC, NOV, DEC, DEC, DEC},			/*  94 */
324*0Sstevel@tonic-gate {"sigprocmask",	3, DEC, NOV, SPM, HEX, HEX},			/*  95 */
325*0Sstevel@tonic-gate {"sigsuspend",	1, DEC, NOV, HEX},				/*  96 */
326*0Sstevel@tonic-gate {"sigaltstack",	2, DEC, NOV, HEX, HEX},				/*  97 */
327*0Sstevel@tonic-gate {"sigaction",	3, DEC, NOV, SIG, HEX, HEX},			/*  98 */
328*0Sstevel@tonic-gate {"sigpendsys",	2, DEC, NOV, DEC, HEX},				/*  99 */
329*0Sstevel@tonic-gate {"context",	2, DEC, NOV, DEC, HEX},				/* 100 */
330*0Sstevel@tonic-gate {"evsys",	3, DEC, NOV, DEC, DEC, HEX},			/* 101 */
331*0Sstevel@tonic-gate {"evtrapret",	0, DEC, NOV},					/* 102 */
332*0Sstevel@tonic-gate {"statvfs",	2, DEC, NOV, STG, HEX},				/* 103 */
333*0Sstevel@tonic-gate {"fstatvfs",	2, DEC, NOV, DEC, HEX},				/* 104 */
334*0Sstevel@tonic-gate {"getloadavg",	2, DEC, NOV, HEX, DEC},				/* 105 */
335*0Sstevel@tonic-gate {"nfssys",	2, DEC, NOV, DEC, HEX},				/* 106 */
336*0Sstevel@tonic-gate {"waitid",	4, DEC, NOV, IDT, DEC, HEX, WOP},		/* 107 */
337*0Sstevel@tonic-gate {"sigsendsys",	2, DEC, NOV, HEX, SIG},				/* 108 */
338*0Sstevel@tonic-gate {"hrtsys",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 109 */
339*0Sstevel@tonic-gate {"acancel",	3, DEC, NOV, DEC, HEX, DEC},			/* 110 */
340*0Sstevel@tonic-gate {"async",	3, DEC, NOV, DEC, HEX, DEC},			/* 111 */
341*0Sstevel@tonic-gate {"priocntlsys",	5, DEC, NOV, DEC, HEX, DEC, PC4, PC5},		/* 112 */
342*0Sstevel@tonic-gate {"pathconf",	2, DEC, NOV, STG, PTC},				/* 113 */
343*0Sstevel@tonic-gate {"mincore",	3, DEC, NOV, HEX, UNS, HEX},			/* 114 */
344*0Sstevel@tonic-gate {"mmap",	6, HEX, NOV, HEX, UNS, MPR, MTY, DEC, DEC},	/* 115 */
345*0Sstevel@tonic-gate {"mprotect",	3, DEC, NOV, HEX, UNS, MPR},			/* 116 */
346*0Sstevel@tonic-gate {"munmap",	2, DEC, NOV, HEX, UNS},				/* 117 */
347*0Sstevel@tonic-gate {"fpathconf",	2, DEC, NOV, DEC, PTC},				/* 118 */
348*0Sstevel@tonic-gate {"vfork",	0, DEC, NOV},					/* 119 */
349*0Sstevel@tonic-gate {"fchdir",	1, DEC, NOV, DEC},				/* 120 */
350*0Sstevel@tonic-gate {"readv",	3, DEC, NOV, DEC, HEX, DEC},			/* 121 */
351*0Sstevel@tonic-gate {"writev",	3, DEC, NOV, DEC, HEX, DEC},			/* 122 */
352*0Sstevel@tonic-gate {"xstat",	3, DEC, NOV, DEC, STG, HEX},			/* 123 */
353*0Sstevel@tonic-gate {"lxstat",	3, DEC, NOV, DEC, STG, HEX},			/* 124 */
354*0Sstevel@tonic-gate {"fxstat",	3, DEC, NOV, DEC, DEC, HEX},			/* 125 */
355*0Sstevel@tonic-gate {"xmknod",	4, DEC, NOV, DEC, STG, OCT, HEX},		/* 126 */
356*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
357*0Sstevel@tonic-gate {"setrlimit",	2, DEC, NOV, RLM, HEX},				/* 128 */
358*0Sstevel@tonic-gate {"getrlimit",	2, DEC, NOV, RLM, HEX},				/* 129 */
359*0Sstevel@tonic-gate {"lchown",	3, DEC, NOV, STG, DEC, DEC},			/* 130 */
360*0Sstevel@tonic-gate {"memcntl",	6, DEC, NOV, HEX, UNS, MCF, MC4, MC5, DEC},	/* 131 */
361*0Sstevel@tonic-gate {"getpmsg",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 132 */
362*0Sstevel@tonic-gate {"putpmsg",	5, DEC, NOV, DEC, HEX, HEX, DEC, HHX},		/* 133 */
363*0Sstevel@tonic-gate {"rename",	2, DEC, NOV, STG, STG},				/* 134 */
364*0Sstevel@tonic-gate {"uname",	1, DEC, NOV, HEX},				/* 135 */
365*0Sstevel@tonic-gate {"setegid",	1, DEC, NOV, DEC},				/* 136 */
366*0Sstevel@tonic-gate {"sysconfig",	1, DEC, NOV, CNF},				/* 137 */
367*0Sstevel@tonic-gate {"adjtime",	2, DEC, NOV, HEX, HEX},				/* 138 */
368*0Sstevel@tonic-gate {"sysinfo",	3, DEC, NOV, INF, RST, DEC},			/* 139 */
369*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
370*0Sstevel@tonic-gate {"seteuid",	1, DEC, NOV, DEC},				/* 141 */
371*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
372*0Sstevel@tonic-gate {"fork1",	0, DEC, NOV},					/* 143 */
373*0Sstevel@tonic-gate {"sigtimedwait", 3, DEC, NOV, HEX, HEX, HEX},			/* 144 */
374*0Sstevel@tonic-gate {"lwp_info",	1, DEC, NOV, HEX},				/* 145 */
375*0Sstevel@tonic-gate {"yield",	0, DEC, NOV},					/* 146 */
376*0Sstevel@tonic-gate {"lwp_sema_wait", 1, DEC, NOV, HEX},				/* 147 */
377*0Sstevel@tonic-gate {"lwp_sema_post", 1, DEC, NOV, HEX},				/* 148 */
378*0Sstevel@tonic-gate {"lwp_sema_trywait", 1, DEC, NOV, HEX},				/* 149 */
379*0Sstevel@tonic-gate {"lwp_detach",	1, DEC, NOV, DEC},				/* 150 */
380*0Sstevel@tonic-gate {"corectl",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/* 151 */
381*0Sstevel@tonic-gate {"modctl",	5, DEC, NOV, MOD, HEX, HEX, HEX, HEX},		/* 152 */
382*0Sstevel@tonic-gate {"fchroot",	1, DEC, NOV, DEC},				/* 153 */
383*0Sstevel@tonic-gate {"utimes",	2, DEC, NOV, STG, HEX},				/* 154 */
384*0Sstevel@tonic-gate {"vhangup",	0, DEC, NOV},					/* 155 */
385*0Sstevel@tonic-gate {"gettimeofday", 1, DEC, NOV, HEX},				/* 156 */
386*0Sstevel@tonic-gate {"getitimer",	2, DEC, NOV, ITM, HEX},				/* 157 */
387*0Sstevel@tonic-gate {"setitimer",	3, DEC, NOV, ITM, HEX, HEX},			/* 158 */
388*0Sstevel@tonic-gate {"lwp_create",	3, DEC, NOV, HEX, LWF, HEX},			/* 159 */
389*0Sstevel@tonic-gate {"lwp_exit",	0, DEC, NOV},					/* 160 */
390*0Sstevel@tonic-gate {"lwp_suspend",	1, DEC, NOV, DEC},				/* 161 */
391*0Sstevel@tonic-gate {"lwp_continue", 1, DEC, NOV, DEC},				/* 162 */
392*0Sstevel@tonic-gate {"lwp_kill",	2, DEC, NOV, DEC, SIG},				/* 163 */
393*0Sstevel@tonic-gate {"lwp_self",	0, DEC, NOV},					/* 164 */
394*0Sstevel@tonic-gate {"lwp_sigmask",	3, HEX, HEX, SPM, HEX, HEX},			/* 165 */
395*0Sstevel@tonic-gate {"lwp_private",	3, HEX, NOV, DEC, DEC, HEX},			/* 166 */
396*0Sstevel@tonic-gate {"lwp_wait",	2, DEC, NOV, DEC, HEX},				/* 167 */
397*0Sstevel@tonic-gate {"lwp_mutex_wakeup", 1, DEC, NOV, HEX},				/* 168 */
398*0Sstevel@tonic-gate {"lwp_mutex_lock", 1, DEC, NOV, HEX},				/* 169 */
399*0Sstevel@tonic-gate {"lwp_cond_wait", 4, DEC, NOV, HEX, HEX, HEX, DEC},		/* 170 */
400*0Sstevel@tonic-gate {"lwp_cond_signal", 1, DEC, NOV, HEX},				/* 171 */
401*0Sstevel@tonic-gate {"lwp_cond_broadcast", 1, DEC, NOV, HEX},			/* 172 */
402*0Sstevel@tonic-gate {"pread",	4, DEC, NOV, DEC, IOB, UNS, DEX},		/* 173 */
403*0Sstevel@tonic-gate {"pwrite",	4, DEC, NOV, DEC, IOB, UNS, DEX},		/* 174 */
404*0Sstevel@tonic-gate {"llseek",	4, LLO, NOV, DEC, LLO, HID, WHN},		/* 175 */
405*0Sstevel@tonic-gate {"inst_sync",	2, DEC, NOV, STG, DEC},				/* 176 */
406*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
407*0Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, HEX, HEX, HEX, HEX, HEX, HEX}, /* 178 */
408*0Sstevel@tonic-gate {"cpc",		5, DEC, NOV, CPC, DEC, HEX, HEX, HEX},		/* 179 */
409*0Sstevel@tonic-gate {"lgrpsys",	3, DEC, NOV, DEC, DEC, HEX},			/* 180 */
410*0Sstevel@tonic-gate {"rusagesys",	2, DEC, NOV, DEC, HEX},				/* 181 */
411*0Sstevel@tonic-gate {"portfs",	6, HEX, HEX, DEC, HEX, HEX, HEX, HEX, HEX},	/* 182 */
412*0Sstevel@tonic-gate {"pollsys",	4, DEC, NOV, HEX, DEC, HEX, HEX},		/* 183 */
413*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
414*0Sstevel@tonic-gate {"acl",		4, DEC, NOV, STG, ACL, DEC, HEX},		/* 185 */
415*0Sstevel@tonic-gate {"auditsys",	4, DEC, NOV, AUD, HEX, HEX, HEX},		/* 186 */
416*0Sstevel@tonic-gate {"processor_bind", 4, DEC, NOV, IDT, DEC, DEC, HEX},		/* 187 */
417*0Sstevel@tonic-gate {"processor_info", 2, DEC, NOV, DEC, HEX},			/* 188 */
418*0Sstevel@tonic-gate {"p_online",	2, DEC, NOV, DEC, DEC},				/* 189 */
419*0Sstevel@tonic-gate {"sigqueue",	4, DEC, NOV, DEC, SIG, HEX, SQC},		/* 190 */
420*0Sstevel@tonic-gate {"clock_gettime", 2, DEC, NOV, DEC, HEX},			/* 191 */
421*0Sstevel@tonic-gate {"clock_settime", 2, DEC, NOV, DEC, HEX},			/* 192 */
422*0Sstevel@tonic-gate {"clock_getres", 2, DEC, NOV, DEC, HEX},			/* 193 */
423*0Sstevel@tonic-gate {"timer_create", 3, DEC, NOV, DEC, HEX, HEX},			/* 194 */
424*0Sstevel@tonic-gate {"timer_delete", 1, DEC, NOV, DEC},				/* 195 */
425*0Sstevel@tonic-gate {"timer_settime", 4, DEC, NOV, DEC, DEC, HEX, HEX},		/* 196 */
426*0Sstevel@tonic-gate {"timer_gettime", 2, DEC, NOV, DEC, HEX},			/* 197 */
427*0Sstevel@tonic-gate {"timer_getoverrun", 1, DEC, NOV, DEC},				/* 198 */
428*0Sstevel@tonic-gate {"nanosleep",	2, DEC, NOV, HEX, HEX},				/* 199 */
429*0Sstevel@tonic-gate {"facl",	4, DEC, NOV, DEC, ACL, DEC, HEX},		/* 200 */
430*0Sstevel@tonic-gate {"door",	6, DEC, NOV, DEC, HEX, HEX, HEX, HEX, DEC},	/* 201 */
431*0Sstevel@tonic-gate {"setreuid",	2, DEC, NOV, DEC, DEC},				/* 202 */
432*0Sstevel@tonic-gate {"setregid",	2, DEC, NOV, DEC, DEC},				/* 203 */
433*0Sstevel@tonic-gate {"install_utrap", 3, DEC, NOV, DEC, HEX, HEX},			/* 204 */
434*0Sstevel@tonic-gate {"signotify",	3, DEC, NOV, DEC, HEX, HEX},			/* 205 */
435*0Sstevel@tonic-gate {"schedctl",	0, HEX, NOV},					/* 206 */
436*0Sstevel@tonic-gate {"pset",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 207 */
437*0Sstevel@tonic-gate {"sparc_utrap_install", 5, DEC, NOV, UTT, UTH, UTH, HEX, HEX},	/* 208 */
438*0Sstevel@tonic-gate {"resolvepath",	3, DEC, NOV, STG, RLK, DEC},			/* 209 */
439*0Sstevel@tonic-gate {"lwp_mutex_timedlock", 2, DEC, NOV, HEX, HEX},			/* 210 */
440*0Sstevel@tonic-gate {"lwp_sema_timedwait", 3, DEC, NOV, HEX, HEX, DEC},		/* 211 */
441*0Sstevel@tonic-gate {"lwp_rwlock_sys", 3, DEC, NOV, DEC, HEX, HEX},			/* 212 */
442*0Sstevel@tonic-gate {"getdents64",	3, DEC, NOV, DEC, HEX, UNS},			/* 213 */
443*0Sstevel@tonic-gate {"mmap64",	7, HEX, NOV, HEX, UNS, MPR, MTY, DEC, LLO, HID}, /* 214 */
444*0Sstevel@tonic-gate {"stat64",	2, DEC, NOV, STG, HEX},				/* 215 */
445*0Sstevel@tonic-gate {"lstat64",	2, DEC, NOV, STG, HEX},				/* 216 */
446*0Sstevel@tonic-gate {"fstat64",	2, DEC, NOV, DEC, HEX},				/* 217 */
447*0Sstevel@tonic-gate {"statvfs64",	2, DEC, NOV, STG, HEX},				/* 218 */
448*0Sstevel@tonic-gate {"fstatvfs64",	2, DEC, NOV, DEC, HEX},				/* 219 */
449*0Sstevel@tonic-gate {"setrlimit64",	2, DEC, NOV, RLM, HEX},				/* 220 */
450*0Sstevel@tonic-gate {"getrlimit64",	2, DEC, NOV, RLM, HEX},				/* 221 */
451*0Sstevel@tonic-gate {"pread64",	5, DEC, NOV, DEC, IOB, UNS, LLO, HID},		/* 222 */
452*0Sstevel@tonic-gate {"pwrite64",	5, DEC, NOV, DEC, IOB, UNS, LLO, HID},		/* 223 */
453*0Sstevel@tonic-gate {"creat64",	2, DEC, NOV, STG, OCT},				/* 224 */
454*0Sstevel@tonic-gate {"open64",	3, DEC, NOV, STG, OPN, OCT},			/* 225 */
455*0Sstevel@tonic-gate {"rpcmod",	3, DEC, NOV, DEC, HEX},				/* 226 */
456*0Sstevel@tonic-gate {"zone",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 227 */
457*0Sstevel@tonic-gate {"autofssys",	2, DEC, NOV, DEC, HEX},				/* 228 */
458*0Sstevel@tonic-gate {"getcwd",	3, DEC, NOV, RST, DEC},				/* 229 */
459*0Sstevel@tonic-gate {"so_socket",	5, DEC, NOV, PFM, SKT, SKP, STG, SKV},		/* 230 */
460*0Sstevel@tonic-gate {"so_socketpair", 1, DEC, NOV, HEX},				/* 231 */
461*0Sstevel@tonic-gate {"bind",	4, DEC, NOV, DEC, HEX, DEC, SKV},		/* 232 */
462*0Sstevel@tonic-gate {"listen",	3, DEC, NOV, DEC, DEC, SKV},			/* 233 */
463*0Sstevel@tonic-gate {"accept",	4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 234 */
464*0Sstevel@tonic-gate {"connect",	4, DEC, NOV, DEC, HEX, DEC, SKV},		/* 235 */
465*0Sstevel@tonic-gate {"shutdown",	3, DEC, NOV, DEC, SHT, SKV},			/* 236 */
466*0Sstevel@tonic-gate {"recv",	4, DEC, NOV, DEC, IOB, DEC, DEC},		/* 237 */
467*0Sstevel@tonic-gate {"recvfrom",	6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, HEX},	/* 238 */
468*0Sstevel@tonic-gate {"recvmsg",	3, DEC, NOV, DEC, HEX, DEC},			/* 239 */
469*0Sstevel@tonic-gate {"send",	4, DEC, NOV, DEC, IOB, DEC, DEC},		/* 240 */
470*0Sstevel@tonic-gate {"sendmsg",	3, DEC, NOV, DEC, HEX, DEC},			/* 241 */
471*0Sstevel@tonic-gate {"sendto",	6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, DEC},	/* 242 */
472*0Sstevel@tonic-gate {"getpeername", 4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 243 */
473*0Sstevel@tonic-gate {"getsockname", 4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 244 */
474*0Sstevel@tonic-gate {"getsockopt",	6, DEC, NOV, DEC, SOL, SON, HEX, HEX, SKV},	/* 245 */
475*0Sstevel@tonic-gate {"setsockopt",	6, DEC, NOV, DEC, SOL, SON, HEX, DEC, SKV},	/* 246 */
476*0Sstevel@tonic-gate {"sockconfig",	4, DEC, NOV, DEC, DEC, DEC, STG},		/* 247 */
477*0Sstevel@tonic-gate {"ntp_gettime",	1, DEC, NOV, HEX},				/* 248 */
478*0Sstevel@tonic-gate {"ntp_adjtime",	1, DEC, NOV, HEX},				/* 249 */
479*0Sstevel@tonic-gate {"lwp_mutex_unlock", 1, DEC, NOV, HEX},				/* 250 */
480*0Sstevel@tonic-gate {"lwp_mutex_trylock", 1, DEC, NOV, HEX},			/* 251 */
481*0Sstevel@tonic-gate {"lwp_mutex_init", 2, DEC, NOV, HEX, HEX},			/* 252 */
482*0Sstevel@tonic-gate {"cladm",	3, DEC, NOV, CLC, CLF, HEX},			/* 253 */
483*0Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
484*0Sstevel@tonic-gate {"umount2",	2, DEC, NOV, STG, MTF},				/* 255 */
485*0Sstevel@tonic-gate { NULL, -1, DEC, NOV},
486*0Sstevel@tonic-gate };
487*0Sstevel@tonic-gate 
488*0Sstevel@tonic-gate /* SYSEND == max syscall number + 1 */
489*0Sstevel@tonic-gate #define	SYSEND	((sizeof (systable) / sizeof (struct systable))-1)
490*0Sstevel@tonic-gate 
491*0Sstevel@tonic-gate 
492*0Sstevel@tonic-gate /*
493*0Sstevel@tonic-gate  * The following are for interpreting syscalls with sub-codes.
494*0Sstevel@tonic-gate  */
495*0Sstevel@tonic-gate 
496*0Sstevel@tonic-gate const	struct systable opentable[] = {
497*0Sstevel@tonic-gate {"open",	2, DEC, NOV, STG, OPN},				/* 0 */
498*0Sstevel@tonic-gate {"open",	3, DEC, NOV, STG, OPN, OCT},			/* 1 */
499*0Sstevel@tonic-gate };
500*0Sstevel@tonic-gate #define	NOPENCODE	(sizeof (opentable) / sizeof (struct systable))
501*0Sstevel@tonic-gate 
502*0Sstevel@tonic-gate const	struct systable open64table[] = {
503*0Sstevel@tonic-gate {"open64",	2, DEC, NOV, STG, OPN},				/* 0 */
504*0Sstevel@tonic-gate {"open64",	3, DEC, NOV, STG, OPN, OCT},			/* 1 */
505*0Sstevel@tonic-gate };
506*0Sstevel@tonic-gate #define	NOPEN64CODE	(sizeof (open64table) / sizeof (struct systable))
507*0Sstevel@tonic-gate 
508*0Sstevel@tonic-gate const	struct systable fcntltable[] = {
509*0Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, HEX},			/* 0: default */
510*0Sstevel@tonic-gate {"fcntl",	2, DEC, NOV, DEC, FCN},				/* 1: no arg */
511*0Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, FFG},			/* 2: F_SETFL */
512*0Sstevel@tonic-gate };
513*0Sstevel@tonic-gate #define	NFCNTLCODE	(sizeof (fcntltable) / sizeof (struct systable))
514*0Sstevel@tonic-gate 
515*0Sstevel@tonic-gate const	struct systable sigtable[] = {
516*0Sstevel@tonic-gate {"signal",	2, HEX, NOV, SIG, ACT},				/* 0 */
517*0Sstevel@tonic-gate {"sigset",	2, HEX, NOV, SIX, ACT},				/* 1 */
518*0Sstevel@tonic-gate {"sighold",	1, HEX, NOV, SIX},				/* 2 */
519*0Sstevel@tonic-gate {"sigrelse",	1, HEX, NOV, SIX},				/* 3 */
520*0Sstevel@tonic-gate {"sigignore",	1, HEX, NOV, SIX},				/* 4 */
521*0Sstevel@tonic-gate {"sigpause",	1, HEX, NOV, SIX},				/* 5 */
522*0Sstevel@tonic-gate };
523*0Sstevel@tonic-gate #define	NSIGCODE	(sizeof (sigtable) / sizeof (struct systable))
524*0Sstevel@tonic-gate 
525*0Sstevel@tonic-gate const	struct systable msgtable[] = {
526*0Sstevel@tonic-gate {"msgget",	3, DEC, NOV, HID, KEY, MSF},			/* 0 */
527*0Sstevel@tonic-gate {"msgctl",	4, DEC, NOV, HID, DEC, MSC, HEX},		/* 1 */
528*0Sstevel@tonic-gate {"msgrcv",	6, DEC, NOV, HID, DEC, HEX, UNS, DEC, MSF},	/* 2 */
529*0Sstevel@tonic-gate {"msgsnd",	5, DEC, NOV, HID, DEC, HEX, UNS, MSF},		/* 3 */
530*0Sstevel@tonic-gate {"msgids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 4 */
531*0Sstevel@tonic-gate {"msgsnap",	5, DEC, NOV, HID, DEC, HEX, UNS, DEC},		/* 5 */
532*0Sstevel@tonic-gate };
533*0Sstevel@tonic-gate #define	NMSGCODE	(sizeof (msgtable) / sizeof (struct systable))
534*0Sstevel@tonic-gate 
535*0Sstevel@tonic-gate const	struct systable semtable[] = {
536*0Sstevel@tonic-gate {"semctl",	5, DEC, NOV, HID, DEC, DEC, SMC, DEX},		/* 0 */
537*0Sstevel@tonic-gate {"semget",	4, DEC, NOV, HID, KEY, DEC, SEF},		/* 1 */
538*0Sstevel@tonic-gate {"semop",	4, DEC, NOV, HID, DEC, HEX, UNS},		/* 2 */
539*0Sstevel@tonic-gate {"semids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 3 */
540*0Sstevel@tonic-gate {"semtimedop",	5, DEC, NOV, HID, DEC, HEX, UNS, HEX},		/* 4 */
541*0Sstevel@tonic-gate };
542*0Sstevel@tonic-gate #define	NSEMCODE	(sizeof (semtable) / sizeof (struct systable))
543*0Sstevel@tonic-gate 
544*0Sstevel@tonic-gate const	struct systable shmtable[] = {
545*0Sstevel@tonic-gate {"shmat",	4, HEX, NOV, HID, DEC, DEX, SHF},		/* 0 */
546*0Sstevel@tonic-gate {"shmctl",	4, DEC, NOV, HID, DEC, SHC, DEX},		/* 1 */
547*0Sstevel@tonic-gate {"shmdt",	2, DEC, NOV, HID, HEX},				/* 2 */
548*0Sstevel@tonic-gate {"shmget",	4, DEC, NOV, HID, KEY, UNS, SHF},		/* 3 */
549*0Sstevel@tonic-gate {"shmids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 4 */
550*0Sstevel@tonic-gate };
551*0Sstevel@tonic-gate #define	NSHMCODE	(sizeof (shmtable) / sizeof (struct systable))
552*0Sstevel@tonic-gate 
553*0Sstevel@tonic-gate const	struct systable pidtable[] = {
554*0Sstevel@tonic-gate {"getpgrp",	1, DEC, NOV, HID},				/* 0 */
555*0Sstevel@tonic-gate {"setpgrp",	1, DEC, NOV, HID},				/* 1 */
556*0Sstevel@tonic-gate {"getsid",	2, DEC, NOV, HID, DEC},				/* 2 */
557*0Sstevel@tonic-gate {"setsid",	1, DEC, NOV, HID},				/* 3 */
558*0Sstevel@tonic-gate {"getpgid",	2, DEC, NOV, HID, DEC},				/* 4 */
559*0Sstevel@tonic-gate {"setpgid",	3, DEC, NOV, HID, DEC, DEC},			/* 5 */
560*0Sstevel@tonic-gate };
561*0Sstevel@tonic-gate #define	NPIDCODE	(sizeof (pidtable) / sizeof (struct systable))
562*0Sstevel@tonic-gate 
563*0Sstevel@tonic-gate const	struct systable sfstable[] = {
564*0Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEX, DEX},			/* 0 */
565*0Sstevel@tonic-gate {"sysfs",	2, DEC, NOV, SFS, STG},				/* 1 */
566*0Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEC, RST},			/* 2 */
567*0Sstevel@tonic-gate {"sysfs",	1, DEC, NOV, SFS},				/* 3 */
568*0Sstevel@tonic-gate };
569*0Sstevel@tonic-gate #define	NSFSCODE	(sizeof (sfstable) / sizeof (struct systable))
570*0Sstevel@tonic-gate 
571*0Sstevel@tonic-gate const	struct systable utstable[] = {
572*0Sstevel@tonic-gate {"utssys",	3, DEC, NOV, HEX, DEC, UTS},			/* 0 */
573*0Sstevel@tonic-gate {"utssys",	4, DEC, NOV, HEX, HEX, HEX, HEX},		/* err */
574*0Sstevel@tonic-gate {"utssys",	3, DEC, NOV, HEX, HHX, UTS},			/* 2 */
575*0Sstevel@tonic-gate {"utssys",	4, DEC, NOV, STG, FUI, UTS, HEX}		/* 3 */
576*0Sstevel@tonic-gate };
577*0Sstevel@tonic-gate #define	NUTSCODE	(sizeof (utstable) / sizeof (struct systable))
578*0Sstevel@tonic-gate 
579*0Sstevel@tonic-gate const	struct systable sgptable[] = {
580*0Sstevel@tonic-gate {"sigpendsys",	2, DEC, NOV, DEC, HEX},				/* err */
581*0Sstevel@tonic-gate {"sigpending",	2, DEC, NOV, HID, HEX},				/* 1 */
582*0Sstevel@tonic-gate {"sigfillset",	2, DEC, NOV, HID, HEX},				/* 2 */
583*0Sstevel@tonic-gate };
584*0Sstevel@tonic-gate #define	NSGPCODE	(sizeof (sgptable) / sizeof (struct systable))
585*0Sstevel@tonic-gate 
586*0Sstevel@tonic-gate const	struct systable ctxtable[] = {
587*0Sstevel@tonic-gate {"getcontext",	2, DEC, NOV, HID, HEX},				/* 0 */
588*0Sstevel@tonic-gate {"setcontext",	2, DEC, NOV, HID, HEX},				/* 1 */
589*0Sstevel@tonic-gate {"getustack",	2, DEC, NOV, HID, HEX},				/* 2 */
590*0Sstevel@tonic-gate {"setustack",	2, DEC, NOV, HID, HEX},				/* 3 */
591*0Sstevel@tonic-gate };
592*0Sstevel@tonic-gate #define	NCTXCODE	(sizeof (ctxtable) / sizeof (struct systable))
593*0Sstevel@tonic-gate 
594*0Sstevel@tonic-gate const	struct systable hrttable[] = {
595*0Sstevel@tonic-gate {"hrtcntl",	5, DEC, NOV, HID, DEC, DEC, HEX, HEX},		/* 0 */
596*0Sstevel@tonic-gate {"hrtalarm",	3, DEC, NOV, HID, HEX, DEC},			/* 1 */
597*0Sstevel@tonic-gate {"hrtsleep",	2, DEC, NOV, HID, HEX},				/* 2 */
598*0Sstevel@tonic-gate {"hrtcancel",	3, DEC, NOV, HID, HEX, DEC},			/* 3 */
599*0Sstevel@tonic-gate };
600*0Sstevel@tonic-gate #define	NHRTCODE	(sizeof (hrttable) / sizeof (struct systable))
601*0Sstevel@tonic-gate 
602*0Sstevel@tonic-gate const	struct systable cortable[] = {
603*0Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, HEX, HEX, HEX},		/* 0 */
604*0Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCO},				/* 1 */
605*0Sstevel@tonic-gate {"corectl",	1, HHX, NOV, COR},				/* 2 */
606*0Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, STG, DEC},			/* 3 */
607*0Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RST, DEC},			/* 4 */
608*0Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, STG, DEC, DEC},		/* 5 */
609*0Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, RST, DEC, DEC},		/* 6 */
610*0Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCC},				/* 7 */
611*0Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, RCC},				/* 8 */
612*0Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, CCC, DEC},			/* 9 */
613*0Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RCC, DEC},			/* 10 */
614*0Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, STG, DEC},			/* 11 */
615*0Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RST, DEC},			/* 12 */
616*0Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCC},				/* 13 */
617*0Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, RCC},				/* 14 */
618*0Sstevel@tonic-gate };
619*0Sstevel@tonic-gate #define	NCORCODE	(sizeof (cortable) / sizeof (struct systable))
620*0Sstevel@tonic-gate 
621*0Sstevel@tonic-gate const	struct systable aiotable[] = {
622*0Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 0 */
623*0Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 1 */
624*0Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, HEX, DEC},			/* 2 */
625*0Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, DEC, HEX},			/* 3 */
626*0Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 4 */
627*0Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 5 */
628*0Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 6 */
629*0Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 7 */
630*0Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, DEC},		/* 8 */
631*0Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 9 */
632*0Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 10 */
633*0Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 11 */
634*0Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 12 */
635*0Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 13 */
636*0Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, DEC},		/* 14 */
637*0Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 15 */
638*0Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 16 */
639*0Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 17 */
640*0Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 18 */
641*0Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, DEC, HEX},			/* 19 */
642*0Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 20 */
643*0Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, HEX},		/* 21 */
644*0Sstevel@tonic-gate };
645*0Sstevel@tonic-gate #define	NAIOCODE	(sizeof (aiotable) / sizeof (struct systable))
646*0Sstevel@tonic-gate 
647*0Sstevel@tonic-gate const	struct systable doortable[] = {
648*0Sstevel@tonic-gate {"door_create", 3, DEC, NOV, HEX, HEX, DFL},			/* 0 */
649*0Sstevel@tonic-gate {"door_revoke", 1, DEC, NOV, DEC},				/* 1 */
650*0Sstevel@tonic-gate {"door_info",	2, DEC, NOV, DEC, HEX},				/* 2 */
651*0Sstevel@tonic-gate {"door_call",	2, DEC, NOV, DEC, HEX},				/* 3 */
652*0Sstevel@tonic-gate {"door_return", 4, DEC, NOV, HEX, DEC, HEX, DEC},		/* 4 (old) */
653*0Sstevel@tonic-gate {"door_cred",	1, DEC, NOV, HEX},				/* 5 (old) */
654*0Sstevel@tonic-gate {"door_bind",	1, DEC, NOV, DEC},				/* 6 */
655*0Sstevel@tonic-gate {"door_unbind", 0, DEC, NOV},					/* 7 */
656*0Sstevel@tonic-gate {"door_unref",	0, DEC, NOV},					/* 8 */
657*0Sstevel@tonic-gate {"door_ucred",	1, DEC, NOV, HEX},				/* 9 */
658*0Sstevel@tonic-gate {"door_return", 5, DEC, NOV, HEX, DEC, HEX, HEX, DEC},		/* 10 */
659*0Sstevel@tonic-gate {"door_getparam", 3, DEC, NOV, DEC, DPM, HEX},			/* 11 */
660*0Sstevel@tonic-gate {"door_setparam", 3, DEC, NOV, DEC, DPM, DEC},			/* 12 */
661*0Sstevel@tonic-gate };
662*0Sstevel@tonic-gate #define	NDOORCODE	(sizeof (doortable) / sizeof (struct systable))
663*0Sstevel@tonic-gate 
664*0Sstevel@tonic-gate const	struct systable psettable[] = {
665*0Sstevel@tonic-gate {"pset_create", 2, DEC, NOV, HID, HEX},				/* 0 */
666*0Sstevel@tonic-gate {"pset_destroy", 2, DEC, NOV, HID, PST},			/* 1 */
667*0Sstevel@tonic-gate {"pset_assign",	4, DEC, NOV, HID, PST, DEC, HEX},		/* 2 */
668*0Sstevel@tonic-gate {"pset_info",	5, DEC, NOV, HID, PST, HEX, HEX, HEX},		/* 3 */
669*0Sstevel@tonic-gate {"pset_bind",	5, DEC, NOV, HID, PST, IDT, DEC, HEX},		/* 4 */
670*0Sstevel@tonic-gate {"pset_getloadavg", 4, DEC, NOV, HID, PST, HEX, DEC},		/* 5 */
671*0Sstevel@tonic-gate {"pset_list",	3, DEC, NOV, HID, HEX, HEX},			/* 6 */
672*0Sstevel@tonic-gate {"pset_setattr", 3, DEC, NOV, HID, PST, HEX},			/* 7 */
673*0Sstevel@tonic-gate {"pset_getattr", 3, DEC, NOV, HID, PST, HEX},			/* 8 */
674*0Sstevel@tonic-gate {"pset_assign_forced",	4, DEC, NOV, HID, PST, DEC, HEX},	/* 9 */
675*0Sstevel@tonic-gate };
676*0Sstevel@tonic-gate #define	NPSETCODE	(sizeof (psettable) / sizeof (struct systable))
677*0Sstevel@tonic-gate 
678*0Sstevel@tonic-gate const	struct systable lwpcreatetable[] = {
679*0Sstevel@tonic-gate {"lwp_create",	3, DEC, NOV, HEX, LWF, HEX},			/* 0 */
680*0Sstevel@tonic-gate {"lwp_create",	0, DEC, NOV},					/* 1 */
681*0Sstevel@tonic-gate };
682*0Sstevel@tonic-gate #define	NLWPCREATECODE	(sizeof (lwpcreatetable) / sizeof (struct systable))
683*0Sstevel@tonic-gate 
684*0Sstevel@tonic-gate static	const	struct systable tasksystable[] = {
685*0Sstevel@tonic-gate {"settaskid",	3, DEC, NOV, HID, DEC, HEX},			/* 0 */
686*0Sstevel@tonic-gate {"gettaskid",	1, DEC, NOV, HID},				/* 1 */
687*0Sstevel@tonic-gate {"getprojid",	1, DEC, NOV, HID},				/* 2 */
688*0Sstevel@tonic-gate };
689*0Sstevel@tonic-gate #define	NTASKSYSCODE	(sizeof (tasksystable) / sizeof (struct systable))
690*0Sstevel@tonic-gate 
691*0Sstevel@tonic-gate static const	struct systable privsystable[] = {
692*0Sstevel@tonic-gate {"setppriv",		4, DEC, NOV, HID, PRO, PRN, PRS},	/* 0 */
693*0Sstevel@tonic-gate {"getppriv",		4, DEC, NOV, HID, HID, PRN, PRS},	/* 1 */
694*0Sstevel@tonic-gate {"getprivimplinfo",	5, DEC, NOV, HID, HID, HID, HEX, DEC},	/* 2 */
695*0Sstevel@tonic-gate {"setpflags",		3, DEC, NOV, HID, PFL, DEC},		/* 3 */
696*0Sstevel@tonic-gate {"getpflags",		2, DEC, NOV, HID, PFL},			/* 4 */
697*0Sstevel@tonic-gate };
698*0Sstevel@tonic-gate #define	NPRIVSYSCODE	(sizeof (privsystable) / sizeof (struct systable))
699*0Sstevel@tonic-gate 
700*0Sstevel@tonic-gate static	const	struct systable exacctsystable[] = {
701*0Sstevel@tonic-gate {"getacct",	5, DEC, NOV, HID, IDT, DEC, HEX, UNS},		/* 0 */
702*0Sstevel@tonic-gate {"putacct",	6, DEC, NOV, HID, IDT, DEC, HEX, UNS, HEX},	/* 1 */
703*0Sstevel@tonic-gate {"wracct",	4, DEC, NOV, HID, IDT, DEC, HEX},		/* 2 */
704*0Sstevel@tonic-gate };
705*0Sstevel@tonic-gate #define	NEXACCTSYSCODE	(sizeof (exacctsystable) / sizeof (struct systable))
706*0Sstevel@tonic-gate 
707*0Sstevel@tonic-gate static const	struct systable fsatsystable[] = {
708*0Sstevel@tonic-gate {"openat",	5, DEC, NOV, HID, ATC, STG, OPN, OCT},		/* 0 */
709*0Sstevel@tonic-gate {"openat64",	5, DEC, NOV, HID, ATC, STG, OPN, OCT},		/* 1 */
710*0Sstevel@tonic-gate {"fstatat64",	5, DEC, NOV, HID, ATC, STG, HEX, HEX},		/* 2 */
711*0Sstevel@tonic-gate {"fstatat",	5, DEC, NOV, HID, ATC, STG, HEX, HEX},		/* 3 */
712*0Sstevel@tonic-gate {"fchownat",	6, DEC, NOV, HID, ATC, STG, HEX, HEX, HEX},	/* 4 */
713*0Sstevel@tonic-gate {"unlinkat",	4, DEC, NOV, HID, ATC, STG, HEX},		/* 5 */
714*0Sstevel@tonic-gate {"futimesat",	4, DEC, NOV, HID, ATC, STG, HEX},		/* 6 */
715*0Sstevel@tonic-gate {"renameat",	5, DEC, NOV, HID, ATC, STG, DEC, STG},		/* 7 */
716*0Sstevel@tonic-gate {"openat",	4, DEC, NOV, HID, ATC, STG, OPN},		/* 8 */
717*0Sstevel@tonic-gate {"openat64",	4, DEC, NOV, HID, ATC, STG, OPN},		/* 9 */
718*0Sstevel@tonic-gate };
719*0Sstevel@tonic-gate #define	NFSATSYSCODE	(sizeof (fsatsystable) / sizeof (struct systable))
720*0Sstevel@tonic-gate 
721*0Sstevel@tonic-gate static	const	struct systable lwpparktable[] = {
722*0Sstevel@tonic-gate {"lwp_park",	3, DEC, NOV, HID, HEX, DEC},			/* 0 */
723*0Sstevel@tonic-gate {"lwp_unpark",	2, DEC, NOV, HID, DEC},				/* 1 */
724*0Sstevel@tonic-gate {"lwp_unpark_all", 3, DEC, NOV, HID, HEX, DEC},			/* 2 */
725*0Sstevel@tonic-gate };
726*0Sstevel@tonic-gate #define	NLWPPARKCODE	(sizeof (lwpparktable) / sizeof (struct systable))
727*0Sstevel@tonic-gate 
728*0Sstevel@tonic-gate static	const	struct systable lwprwlocktable[] = {
729*0Sstevel@tonic-gate {"lwp_rwlock_rdlock", 3, DEC, NOV, HID, HEX, HEX},		/* 0 */
730*0Sstevel@tonic-gate {"lwp_rwlock_wrlock", 3, DEC, NOV, HID, HEX, HEX},		/* 1 */
731*0Sstevel@tonic-gate {"lwp_rwlock_tryrdlock", 2, DEC, NOV, HID, HEX},		/* 2 */
732*0Sstevel@tonic-gate {"lwp_rwlock_trywrlock", 2, DEC, NOV, HID, HEX},		/* 3 */
733*0Sstevel@tonic-gate {"lwp_rwlock_unlock", 2, DEC, NOV, HID, HEX},			/* 4 */
734*0Sstevel@tonic-gate };
735*0Sstevel@tonic-gate #define	NLWPRWLOCKCODE	(sizeof (lwprwlocktable) / sizeof (struct systable))
736*0Sstevel@tonic-gate 
737*0Sstevel@tonic-gate static	const	struct systable sendfilevsystable[] = {
738*0Sstevel@tonic-gate {"sendfilev",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/* 0 */
739*0Sstevel@tonic-gate {"sendfilev64",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/* 1 */
740*0Sstevel@tonic-gate };
741*0Sstevel@tonic-gate #define	NSENDFILESYSCODE \
742*0Sstevel@tonic-gate 		(sizeof (sendfilevsystable) / sizeof (struct systable))
743*0Sstevel@tonic-gate 
744*0Sstevel@tonic-gate static	const	struct systable lgrpsystable[] = {
745*0Sstevel@tonic-gate {"meminfo",		3, DEC, NOV, HID, NOV, MIF},		/* 0 */
746*0Sstevel@tonic-gate {"_lgrpsys",		3, DEC, NOV, DEC, DEC, NOV},		/* 1 */
747*0Sstevel@tonic-gate {"lgrp_version",	3, DEC, NOV, HID, DEC, NOV},		/* 2 */
748*0Sstevel@tonic-gate {"_lgrpsys",		3, DEC, NOV, DEC, HEX, HEX},		/* 3 */
749*0Sstevel@tonic-gate {"lgrp_affinity_get",	3, DEC, NOV, HID, NOV, LAF},		/* 4 */
750*0Sstevel@tonic-gate {"lgrp_affinity_set",	3, DEC, NOV, HID, NOV, LAF},		/* 5 */
751*0Sstevel@tonic-gate {"lgrp_latency",	3, DEC, NOV, HID, DEC, DEC},		/* 6 */
752*0Sstevel@tonic-gate };
753*0Sstevel@tonic-gate #define	NLGRPSYSCODE	(sizeof (lgrpsystable) / sizeof (struct systable))
754*0Sstevel@tonic-gate 
755*0Sstevel@tonic-gate static	const	struct systable rusagesystable[] = {
756*0Sstevel@tonic-gate {"getrusage",		2, DEC, NOV, HID, HEX},			/* 0 */
757*0Sstevel@tonic-gate {"getrusage_chld",	2, DEC, NOV, HID, HEX},			/* 1 */
758*0Sstevel@tonic-gate {"getrusage_lwp",	2, DEC, NOV, HID, HEX},			/* 2 */
759*0Sstevel@tonic-gate };
760*0Sstevel@tonic-gate #define	NRUSAGESYSCODE \
761*0Sstevel@tonic-gate 		(sizeof (rusagesystable) / sizeof (struct systable))
762*0Sstevel@tonic-gate 
763*0Sstevel@tonic-gate static const	struct systable ucredsystable[] = {
764*0Sstevel@tonic-gate {"ucred_get",	3, DEC, NOV, HID, DEC, HEX},
765*0Sstevel@tonic-gate {"getpeerucred", 3, DEC, NOV, HID, DEC, HEX},
766*0Sstevel@tonic-gate };
767*0Sstevel@tonic-gate #define	NUCREDSYSCODE \
768*0Sstevel@tonic-gate 		(sizeof (ucredsystable) / sizeof (struct systable))
769*0Sstevel@tonic-gate 
770*0Sstevel@tonic-gate const	struct systable portfstable[] = {
771*0Sstevel@tonic-gate {"port_create",	2, DEC, NOV, HID, DEC},				/* 0 */
772*0Sstevel@tonic-gate {"port_associate",	6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX}, /* 1 */
773*0Sstevel@tonic-gate {"port_dissociate",	4, DEC, NOV, HID, DEC, DEC, HEX}, 	/* 2 */
774*0Sstevel@tonic-gate {"port_send",	4, DEC, NOV, HID, DEC, HEX, HEX},		/* 3 */
775*0Sstevel@tonic-gate {"port_sendn",	6, DEC, DEC, HID, HEX, HEX, DEC, HEX, HEX},	/* 4 */
776*0Sstevel@tonic-gate {"port_get",	4, DEC, NOV, HID, DEC, HEX, HEX},		/* 5 */
777*0Sstevel@tonic-gate {"port_getn",	6, DEC, DEC, HID, DEC, HEX, DEC, DEC, HEX},	/* 6 */
778*0Sstevel@tonic-gate {"port_alert",	5, DEC, NOV, HID, DEC, HEX, HEX, HEX},		/* 7 */
779*0Sstevel@tonic-gate {"port_dispatch", 6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX},	/* 8 */
780*0Sstevel@tonic-gate };
781*0Sstevel@tonic-gate #define	NPORTCODE	(sizeof (portfstable) / sizeof (struct systable))
782*0Sstevel@tonic-gate 
783*0Sstevel@tonic-gate static const struct systable zonetable[] = {
784*0Sstevel@tonic-gate {"zone_create",	6, DEC, NOV, HID, STG, STG, PRS, HEX, DEC},	/* 0 */
785*0Sstevel@tonic-gate {"zone_destroy", 2, DEC, NOV, HID, DEC},			/* 1 */
786*0Sstevel@tonic-gate {"zone_getattr", 5, DEC, NOV, HID, DEC, ZGA, HEX, DEC},		/* 2 */
787*0Sstevel@tonic-gate {"zone_enter",	2, DEC, NOV, HID, DEC},				/* 3 */
788*0Sstevel@tonic-gate {"zone_list",	3, DEC, NOV, HID, HEX, HEX},			/* 4 */
789*0Sstevel@tonic-gate {"zone_shutdown", 2, DEC, NOV, HID, DEC},			/* 5 */
790*0Sstevel@tonic-gate {"zone_lookup", 2, DEC, NOV, HID, STG},				/* 6 */
791*0Sstevel@tonic-gate {"zone_boot", 3, DEC, NOV, HID, DEC, STG},			/* 7 */
792*0Sstevel@tonic-gate };
793*0Sstevel@tonic-gate #define	NZONECODE	(sizeof (zonetable) / sizeof (struct systable))
794*0Sstevel@tonic-gate 
795*0Sstevel@tonic-gate const	struct sysalias sysalias[] = {
796*0Sstevel@tonic-gate 	{ "exit",	SYS_exit	},
797*0Sstevel@tonic-gate 	{ "fork",	SYS_fork1	},
798*0Sstevel@tonic-gate 	{ "sbrk",	SYS_brk		},
799*0Sstevel@tonic-gate 	{ "getppid",	SYS_getpid	},
800*0Sstevel@tonic-gate 	{ "geteuid",	SYS_getuid	},
801*0Sstevel@tonic-gate 	{ "getpgrp",	SYS_pgrpsys	},
802*0Sstevel@tonic-gate 	{ "setpgrp",	SYS_pgrpsys	},
803*0Sstevel@tonic-gate 	{ "getsid",	SYS_pgrpsys	},
804*0Sstevel@tonic-gate 	{ "setsid",	SYS_pgrpsys	},
805*0Sstevel@tonic-gate 	{ "getpgid",	SYS_pgrpsys	},
806*0Sstevel@tonic-gate 	{ "setpgid",	SYS_pgrpsys	},
807*0Sstevel@tonic-gate 	{ "getegid",	SYS_getgid	},
808*0Sstevel@tonic-gate 	{ "sigset",	SYS_signal	},
809*0Sstevel@tonic-gate 	{ "sighold",	SYS_signal	},
810*0Sstevel@tonic-gate 	{ "sigrelse",	SYS_signal	},
811*0Sstevel@tonic-gate 	{ "sigignore",	SYS_signal	},
812*0Sstevel@tonic-gate 	{ "sigpause",	SYS_signal	},
813*0Sstevel@tonic-gate 	{ "msgget",	SYS_msgsys	},
814*0Sstevel@tonic-gate 	{ "msgctl",	SYS_msgsys	},
815*0Sstevel@tonic-gate 	{ "msgctl64",	SYS_msgsys	},
816*0Sstevel@tonic-gate 	{ "msgrcv",	SYS_msgsys	},
817*0Sstevel@tonic-gate 	{ "msgsnd",	SYS_msgsys	},
818*0Sstevel@tonic-gate 	{ "msgids",	SYS_msgsys	},
819*0Sstevel@tonic-gate 	{ "msgsnap",	SYS_msgsys	},
820*0Sstevel@tonic-gate 	{ "msgop",	SYS_msgsys	},
821*0Sstevel@tonic-gate 	{ "shmat",	SYS_shmsys	},
822*0Sstevel@tonic-gate 	{ "shmctl",	SYS_shmsys	},
823*0Sstevel@tonic-gate 	{ "shmctl64",	SYS_shmsys	},
824*0Sstevel@tonic-gate 	{ "shmdt",	SYS_shmsys	},
825*0Sstevel@tonic-gate 	{ "shmget",	SYS_shmsys	},
826*0Sstevel@tonic-gate 	{ "shmids",	SYS_shmsys	},
827*0Sstevel@tonic-gate 	{ "shmop",	SYS_shmsys	},
828*0Sstevel@tonic-gate 	{ "semctl",	SYS_semsys	},
829*0Sstevel@tonic-gate 	{ "semctl64",	SYS_semsys	},
830*0Sstevel@tonic-gate 	{ "semget",	SYS_semsys	},
831*0Sstevel@tonic-gate 	{ "semids",	SYS_semsys	},
832*0Sstevel@tonic-gate 	{ "semop",	SYS_semsys	},
833*0Sstevel@tonic-gate 	{ "semtimedop",	SYS_semsys	},
834*0Sstevel@tonic-gate 	{ "uname",	SYS_utssys	},
835*0Sstevel@tonic-gate 	{ "ustat",	SYS_utssys	},
836*0Sstevel@tonic-gate 	{ "fusers",	SYS_utssys	},
837*0Sstevel@tonic-gate 	{ "exec",	SYS_execve	},
838*0Sstevel@tonic-gate 	{ "execl",	SYS_execve	},
839*0Sstevel@tonic-gate 	{ "execv",	SYS_execve	},
840*0Sstevel@tonic-gate 	{ "execle",	SYS_execve	},
841*0Sstevel@tonic-gate 	{ "execlp",	SYS_execve	},
842*0Sstevel@tonic-gate 	{ "execvp",	SYS_execve	},
843*0Sstevel@tonic-gate 	{ "sigfillset",	SYS_sigpending	},
844*0Sstevel@tonic-gate 	{ "getcontext",	SYS_context	},
845*0Sstevel@tonic-gate 	{ "setcontext",	SYS_context	},
846*0Sstevel@tonic-gate 	{ "getustack",	SYS_context	},
847*0Sstevel@tonic-gate 	{ "setustack",	SYS_context	},
848*0Sstevel@tonic-gate 	{ "hrtcntl",	SYS_hrtsys	},
849*0Sstevel@tonic-gate 	{ "hrtalarm",	SYS_hrtsys	},
850*0Sstevel@tonic-gate 	{ "hrtsleep",	SYS_hrtsys	},
851*0Sstevel@tonic-gate 	{ "hrtcancel",	SYS_hrtsys	},
852*0Sstevel@tonic-gate 	{ "aioread",	SYS_kaio	},
853*0Sstevel@tonic-gate 	{ "aiowrite",	SYS_kaio	},
854*0Sstevel@tonic-gate 	{ "aiowait",	SYS_kaio	},
855*0Sstevel@tonic-gate 	{ "aiocancel",	SYS_kaio	},
856*0Sstevel@tonic-gate 	{ "aionotify",	SYS_kaio	},
857*0Sstevel@tonic-gate 	{ "audit",	SYS_auditsys	},
858*0Sstevel@tonic-gate 	{ "door_create",	SYS_door	},
859*0Sstevel@tonic-gate 	{ "door_revoke",	SYS_door	},
860*0Sstevel@tonic-gate 	{ "door_info",		SYS_door	},
861*0Sstevel@tonic-gate 	{ "door_call",		SYS_door	},
862*0Sstevel@tonic-gate 	{ "door_return",	SYS_door	},
863*0Sstevel@tonic-gate 	{ "door_bind",		SYS_door	},
864*0Sstevel@tonic-gate 	{ "door_unbind",	SYS_door	},
865*0Sstevel@tonic-gate 	{ "door_unref",		SYS_door	},
866*0Sstevel@tonic-gate 	{ "door_ucred",		SYS_door	},
867*0Sstevel@tonic-gate 	{ "door_getparam",	SYS_door	},
868*0Sstevel@tonic-gate 	{ "door_setparam",	SYS_door	},
869*0Sstevel@tonic-gate 	{ "pset_create",	SYS_pset	},
870*0Sstevel@tonic-gate 	{ "pset_destroy",	SYS_pset	},
871*0Sstevel@tonic-gate 	{ "pset_assign",	SYS_pset	},
872*0Sstevel@tonic-gate 	{ "pset_info",		SYS_pset	},
873*0Sstevel@tonic-gate 	{ "pset_bind",		SYS_pset	},
874*0Sstevel@tonic-gate 	{ "pset_getloadavg",	SYS_pset	},
875*0Sstevel@tonic-gate 	{ "pset_list",		SYS_pset	},
876*0Sstevel@tonic-gate 	{ "pset_setattr",	SYS_pset	},
877*0Sstevel@tonic-gate 	{ "pset_getattr",	SYS_pset	},
878*0Sstevel@tonic-gate 	{ "pset_assign_forced",	SYS_pset	},
879*0Sstevel@tonic-gate 	{ "settaskid",		SYS_tasksys	},
880*0Sstevel@tonic-gate 	{ "gettaskid",		SYS_tasksys	},
881*0Sstevel@tonic-gate 	{ "getprojid",		SYS_tasksys	},
882*0Sstevel@tonic-gate 	{ "setppriv",		SYS_privsys	},
883*0Sstevel@tonic-gate 	{ "getppriv",		SYS_privsys	},
884*0Sstevel@tonic-gate 	{ "getprivimplinfo",	SYS_privsys	},
885*0Sstevel@tonic-gate 	{ "setpflags",		SYS_privsys	},
886*0Sstevel@tonic-gate 	{ "getpflags",		SYS_privsys	},
887*0Sstevel@tonic-gate 	{ "getacct",		SYS_exacctsys	},
888*0Sstevel@tonic-gate 	{ "putacct",		SYS_exacctsys	},
889*0Sstevel@tonic-gate 	{ "wracct",		SYS_exacctsys	},
890*0Sstevel@tonic-gate 	{ "lwp_cond_timedwait",	SYS_lwp_cond_wait },
891*0Sstevel@tonic-gate 	{ "lwp_park",		SYS_lwp_park	},
892*0Sstevel@tonic-gate 	{ "lwp_unpark",		SYS_lwp_park	},
893*0Sstevel@tonic-gate 	{ "lwp_unpark_all",	SYS_lwp_park	},
894*0Sstevel@tonic-gate 	{ "lwp_rwlock_rdlock",	SYS_lwp_rwlock_sys },
895*0Sstevel@tonic-gate 	{ "lwp_rwlock_wrlock",	SYS_lwp_rwlock_sys },
896*0Sstevel@tonic-gate 	{ "lwp_rwlock_tryrdlock", SYS_lwp_rwlock_sys },
897*0Sstevel@tonic-gate 	{ "lwp_rwlock_trywrlock", SYS_lwp_rwlock_sys },
898*0Sstevel@tonic-gate 	{ "lwp_rwlock_unlock",	SYS_lwp_rwlock_sys },
899*0Sstevel@tonic-gate 	{ "sendfilev64",	SYS_sendfilev	},
900*0Sstevel@tonic-gate 	{ "openat",		SYS_fsat	},
901*0Sstevel@tonic-gate 	{ "openat64",		SYS_fsat	},
902*0Sstevel@tonic-gate 	{ "fstatat64",		SYS_fsat	},
903*0Sstevel@tonic-gate 	{ "fstatat",		SYS_fsat	},
904*0Sstevel@tonic-gate 	{ "fchownat",		SYS_fsat	},
905*0Sstevel@tonic-gate 	{ "unlinkat",		SYS_fsat	},
906*0Sstevel@tonic-gate 	{ "futimesat",		SYS_fsat	},
907*0Sstevel@tonic-gate 	{ "renameat",		SYS_fsat	},
908*0Sstevel@tonic-gate 	{ "lgrpsys",		SYS_lgrpsys	},
909*0Sstevel@tonic-gate 	{ "getrusage",		SYS_rusagesys	},
910*0Sstevel@tonic-gate 	{ "getrusage_chld",	SYS_rusagesys	},
911*0Sstevel@tonic-gate 	{ "getrusage_lwp",	SYS_rusagesys	},
912*0Sstevel@tonic-gate 	{ "getpeerucred",	SYS_ucredsys	},
913*0Sstevel@tonic-gate 	{ "ucred_get",		SYS_ucredsys	},
914*0Sstevel@tonic-gate 	{ "port_create",	SYS_port	},
915*0Sstevel@tonic-gate 	{ "port_associate",	SYS_port	},
916*0Sstevel@tonic-gate 	{ "port_dissociate",	SYS_port	},
917*0Sstevel@tonic-gate 	{ "port_send",		SYS_port	},
918*0Sstevel@tonic-gate 	{ "port_sendn",		SYS_port	},
919*0Sstevel@tonic-gate 	{ "port_get",		SYS_port	},
920*0Sstevel@tonic-gate 	{ "port_getn",		SYS_port	},
921*0Sstevel@tonic-gate 	{ "port_alert",		SYS_port	},
922*0Sstevel@tonic-gate 	{ "port_dispatch",	SYS_port	},
923*0Sstevel@tonic-gate 	{ "zone_create",	SYS_zone	},
924*0Sstevel@tonic-gate 	{ "zone_destroy",	SYS_zone	},
925*0Sstevel@tonic-gate 	{ "zone_getattr",	SYS_zone	},
926*0Sstevel@tonic-gate 	{ "zone_enter",		SYS_zone	},
927*0Sstevel@tonic-gate 	{ "getzoneid",		SYS_zone	},
928*0Sstevel@tonic-gate 	{ "zone_list",		SYS_zone	},
929*0Sstevel@tonic-gate 	{ "zone_shutdown",	SYS_zone	},
930*0Sstevel@tonic-gate 	{  NULL,	0	}	/* end-of-list */
931*0Sstevel@tonic-gate };
932*0Sstevel@tonic-gate 
933*0Sstevel@tonic-gate 
934*0Sstevel@tonic-gate /*
935*0Sstevel@tonic-gate  * Return structure to interpret system call with sub-codes.
936*0Sstevel@tonic-gate  */
937*0Sstevel@tonic-gate const struct systable *
938*0Sstevel@tonic-gate subsys(int syscall, int subcode)
939*0Sstevel@tonic-gate {
940*0Sstevel@tonic-gate 	const struct systable *stp = NULL;
941*0Sstevel@tonic-gate 
942*0Sstevel@tonic-gate 	if (subcode != -1) {
943*0Sstevel@tonic-gate 		switch (syscall) {
944*0Sstevel@tonic-gate 		case SYS_open:
945*0Sstevel@tonic-gate 			if ((unsigned)subcode < NOPENCODE)
946*0Sstevel@tonic-gate 				stp = &opentable[subcode];
947*0Sstevel@tonic-gate 			break;
948*0Sstevel@tonic-gate 		case SYS_open64:
949*0Sstevel@tonic-gate 			if ((unsigned)subcode < NOPEN64CODE)
950*0Sstevel@tonic-gate 				stp = &open64table[subcode];
951*0Sstevel@tonic-gate 			break;
952*0Sstevel@tonic-gate 		case SYS_signal:	/* signal() + sigset() family */
953*0Sstevel@tonic-gate 			if ((unsigned)subcode < NSIGCODE)
954*0Sstevel@tonic-gate 				stp = &sigtable[subcode];
955*0Sstevel@tonic-gate 			break;
956*0Sstevel@tonic-gate 		case SYS_msgsys:	/* msgsys() */
957*0Sstevel@tonic-gate 			if ((unsigned)subcode < NMSGCODE)
958*0Sstevel@tonic-gate 				stp = &msgtable[subcode];
959*0Sstevel@tonic-gate 			break;
960*0Sstevel@tonic-gate 		case SYS_semsys:	/* semsys() */
961*0Sstevel@tonic-gate 			if ((unsigned)subcode < NSEMCODE)
962*0Sstevel@tonic-gate 				stp = &semtable[subcode];
963*0Sstevel@tonic-gate 			break;
964*0Sstevel@tonic-gate 		case SYS_shmsys:	/* shmsys() */
965*0Sstevel@tonic-gate 			if ((unsigned)subcode < NSHMCODE)
966*0Sstevel@tonic-gate 				stp = &shmtable[subcode];
967*0Sstevel@tonic-gate 			break;
968*0Sstevel@tonic-gate 		case SYS_pgrpsys:	/* pgrpsys() */
969*0Sstevel@tonic-gate 			if ((unsigned)subcode < NPIDCODE)
970*0Sstevel@tonic-gate 				stp = &pidtable[subcode];
971*0Sstevel@tonic-gate 			break;
972*0Sstevel@tonic-gate 		case SYS_utssys:	/* utssys() */
973*0Sstevel@tonic-gate 			if ((unsigned)subcode < NUTSCODE)
974*0Sstevel@tonic-gate 				stp = &utstable[subcode];
975*0Sstevel@tonic-gate 			break;
976*0Sstevel@tonic-gate 		case SYS_sysfs:		/* sysfs() */
977*0Sstevel@tonic-gate 			if ((unsigned)subcode < NSFSCODE)
978*0Sstevel@tonic-gate 				stp = &sfstable[subcode];
979*0Sstevel@tonic-gate 			break;
980*0Sstevel@tonic-gate 		case SYS_sigpending:	/* sigpending()/sigfillset() */
981*0Sstevel@tonic-gate 			if ((unsigned)subcode < NSGPCODE)
982*0Sstevel@tonic-gate 				stp = &sgptable[subcode];
983*0Sstevel@tonic-gate 			break;
984*0Sstevel@tonic-gate 		case SYS_context:	/* [get|set]context() */
985*0Sstevel@tonic-gate 			if ((unsigned)subcode < NCTXCODE)
986*0Sstevel@tonic-gate 				stp = &ctxtable[subcode];
987*0Sstevel@tonic-gate 			break;
988*0Sstevel@tonic-gate 		case SYS_hrtsys:	/* hrtsys() */
989*0Sstevel@tonic-gate 			if ((unsigned)subcode < NHRTCODE)
990*0Sstevel@tonic-gate 				stp = &hrttable[subcode];
991*0Sstevel@tonic-gate 			break;
992*0Sstevel@tonic-gate 		case SYS_corectl:	/* corectl() */
993*0Sstevel@tonic-gate 			if ((unsigned)subcode < NCORCODE)
994*0Sstevel@tonic-gate 				stp = &cortable[subcode];
995*0Sstevel@tonic-gate 			break;
996*0Sstevel@tonic-gate 		case SYS_kaio:		/* kaio() */
997*0Sstevel@tonic-gate 			if ((unsigned)subcode < NAIOCODE)
998*0Sstevel@tonic-gate 				stp = &aiotable[subcode];
999*0Sstevel@tonic-gate 			break;
1000*0Sstevel@tonic-gate 		case SYS_door:		/* doors */
1001*0Sstevel@tonic-gate 			if ((unsigned)subcode < NDOORCODE)
1002*0Sstevel@tonic-gate 				stp = &doortable[subcode];
1003*0Sstevel@tonic-gate 			break;
1004*0Sstevel@tonic-gate 		case SYS_pset:		/* pset() */
1005*0Sstevel@tonic-gate 			if ((unsigned)subcode < NPSETCODE)
1006*0Sstevel@tonic-gate 				stp = &psettable[subcode];
1007*0Sstevel@tonic-gate 			break;
1008*0Sstevel@tonic-gate 		case SYS_lwp_create:	/* lwp_create() */
1009*0Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPCREATECODE)
1010*0Sstevel@tonic-gate 				stp = &lwpcreatetable[subcode];
1011*0Sstevel@tonic-gate 			break;
1012*0Sstevel@tonic-gate 		case SYS_tasksys:	/* tasks */
1013*0Sstevel@tonic-gate 			if ((unsigned)subcode < NTASKSYSCODE)
1014*0Sstevel@tonic-gate 				stp = &tasksystable[subcode];
1015*0Sstevel@tonic-gate 			break;
1016*0Sstevel@tonic-gate 		case SYS_exacctsys:	/* exacct */
1017*0Sstevel@tonic-gate 			if ((unsigned)subcode < NEXACCTSYSCODE)
1018*0Sstevel@tonic-gate 				stp = &exacctsystable[subcode];
1019*0Sstevel@tonic-gate 			break;
1020*0Sstevel@tonic-gate 		case SYS_fsat:
1021*0Sstevel@tonic-gate 			if ((unsigned)subcode < NFSATSYSCODE)
1022*0Sstevel@tonic-gate 				stp = &fsatsystable[subcode];
1023*0Sstevel@tonic-gate 			break;
1024*0Sstevel@tonic-gate 		case SYS_privsys:	/* privileges */
1025*0Sstevel@tonic-gate 			if ((unsigned)subcode < NPRIVSYSCODE)
1026*0Sstevel@tonic-gate 				stp = &privsystable[subcode];
1027*0Sstevel@tonic-gate 			break;
1028*0Sstevel@tonic-gate 		case SYS_lwp_park:	/* lwp_park */
1029*0Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPPARKCODE)
1030*0Sstevel@tonic-gate 				stp = &lwpparktable[subcode];
1031*0Sstevel@tonic-gate 			break;
1032*0Sstevel@tonic-gate 		case SYS_lwp_rwlock_sys:
1033*0Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPRWLOCKCODE)
1034*0Sstevel@tonic-gate 				stp = &lwprwlocktable[subcode];
1035*0Sstevel@tonic-gate 			break;
1036*0Sstevel@tonic-gate 		case SYS_sendfilev:	/* sendfilev */
1037*0Sstevel@tonic-gate 			if ((unsigned)subcode < NSENDFILESYSCODE)
1038*0Sstevel@tonic-gate 				stp = &sendfilevsystable[subcode];
1039*0Sstevel@tonic-gate 			break;
1040*0Sstevel@tonic-gate 		case SYS_lgrpsys:	/* lgrpsys */
1041*0Sstevel@tonic-gate 			if ((unsigned)subcode < NLGRPSYSCODE)
1042*0Sstevel@tonic-gate 				stp = &lgrpsystable[subcode];
1043*0Sstevel@tonic-gate 			break;
1044*0Sstevel@tonic-gate 		case SYS_rusagesys:	/* rusagesys */
1045*0Sstevel@tonic-gate 			if ((unsigned)subcode < NRUSAGESYSCODE)
1046*0Sstevel@tonic-gate 				stp = &rusagesystable[subcode];
1047*0Sstevel@tonic-gate 			break;
1048*0Sstevel@tonic-gate 		case SYS_fcntl:		/* fcntl */
1049*0Sstevel@tonic-gate 			if ((unsigned)subcode < NFCNTLCODE)
1050*0Sstevel@tonic-gate 				stp = &fcntltable[subcode];
1051*0Sstevel@tonic-gate 			break;
1052*0Sstevel@tonic-gate 		case SYS_ucredsys:
1053*0Sstevel@tonic-gate 			if ((unsigned)subcode < NUCREDSYSCODE)
1054*0Sstevel@tonic-gate 				stp = &ucredsystable[subcode];
1055*0Sstevel@tonic-gate 			break;
1056*0Sstevel@tonic-gate 		case SYS_port:	/* portfs */
1057*0Sstevel@tonic-gate 			if ((unsigned)subcode < NPORTCODE)
1058*0Sstevel@tonic-gate 				stp = &portfstable[subcode];
1059*0Sstevel@tonic-gate 			break;
1060*0Sstevel@tonic-gate 		case SYS_zone:		/* zone family */
1061*0Sstevel@tonic-gate 			if ((unsigned)subcode < NZONECODE)
1062*0Sstevel@tonic-gate 				stp = &zonetable[subcode];
1063*0Sstevel@tonic-gate 			break;
1064*0Sstevel@tonic-gate 		}
1065*0Sstevel@tonic-gate 	}
1066*0Sstevel@tonic-gate 
1067*0Sstevel@tonic-gate 	if (stp == NULL)
1068*0Sstevel@tonic-gate 		stp = &systable[((unsigned)syscall < SYSEND)? syscall : 0];
1069*0Sstevel@tonic-gate 
1070*0Sstevel@tonic-gate 	return (stp);
1071*0Sstevel@tonic-gate }
1072*0Sstevel@tonic-gate 
1073*0Sstevel@tonic-gate /*
1074*0Sstevel@tonic-gate  * Return the name of the system call.
1075*0Sstevel@tonic-gate  */
1076*0Sstevel@tonic-gate const char *
1077*0Sstevel@tonic-gate sysname(private_t *pri, int syscall, int subcode)
1078*0Sstevel@tonic-gate {
1079*0Sstevel@tonic-gate 	const struct systable *stp = subsys(syscall, subcode);
1080*0Sstevel@tonic-gate 	const char *name = stp->name;	/* may be NULL */
1081*0Sstevel@tonic-gate 
1082*0Sstevel@tonic-gate 	if (name == NULL) {		/* manufacture a name */
1083*0Sstevel@tonic-gate 		(void) sprintf(pri->sys_name, "sys#%d", syscall);
1084*0Sstevel@tonic-gate 		name = pri->sys_name;
1085*0Sstevel@tonic-gate 	}
1086*0Sstevel@tonic-gate 
1087*0Sstevel@tonic-gate 	return (name);
1088*0Sstevel@tonic-gate }
1089*0Sstevel@tonic-gate 
1090*0Sstevel@tonic-gate /*
1091*0Sstevel@tonic-gate  * Return the name of the signal.
1092*0Sstevel@tonic-gate  * Return NULL if unknown signal.
1093*0Sstevel@tonic-gate  */
1094*0Sstevel@tonic-gate const char *
1095*0Sstevel@tonic-gate rawsigname(private_t *pri, int sig)
1096*0Sstevel@tonic-gate {
1097*0Sstevel@tonic-gate 	/*
1098*0Sstevel@tonic-gate 	 * The C library function sig2str() omits the leading "SIG".
1099*0Sstevel@tonic-gate 	 */
1100*0Sstevel@tonic-gate 	(void) strcpy(pri->raw_sig_name, "SIG");
1101*0Sstevel@tonic-gate 
1102*0Sstevel@tonic-gate 	if (sig > 0 && sig2str(sig, pri->raw_sig_name+3) == 0)
1103*0Sstevel@tonic-gate 		return (pri->raw_sig_name);
1104*0Sstevel@tonic-gate 	return (NULL);
1105*0Sstevel@tonic-gate }
1106*0Sstevel@tonic-gate 
1107*0Sstevel@tonic-gate /*
1108*0Sstevel@tonic-gate  * Return the name of the signal.
1109*0Sstevel@tonic-gate  * Manufacture a name for unknown signal.
1110*0Sstevel@tonic-gate  */
1111*0Sstevel@tonic-gate const char *
1112*0Sstevel@tonic-gate signame(private_t *pri, int sig)
1113*0Sstevel@tonic-gate {
1114*0Sstevel@tonic-gate 	const char *name = rawsigname(pri, sig);
1115*0Sstevel@tonic-gate 
1116*0Sstevel@tonic-gate 	if (name == NULL) {			/* manufacture a name */
1117*0Sstevel@tonic-gate 		(void) sprintf(pri->sig_name, "SIG#%d", sig);
1118*0Sstevel@tonic-gate 		name = pri->sig_name;
1119*0Sstevel@tonic-gate 	}
1120*0Sstevel@tonic-gate 
1121*0Sstevel@tonic-gate 	return (name);
1122*0Sstevel@tonic-gate }
1123*0Sstevel@tonic-gate 
1124*0Sstevel@tonic-gate /*
1125*0Sstevel@tonic-gate  * Determine the subcode for this syscall, if any.
1126*0Sstevel@tonic-gate  */
1127*0Sstevel@tonic-gate int
1128*0Sstevel@tonic-gate getsubcode(private_t *pri)
1129*0Sstevel@tonic-gate {
1130*0Sstevel@tonic-gate 	const lwpstatus_t *Lsp = pri->lwpstat;
1131*0Sstevel@tonic-gate 	int syscall = Lsp->pr_syscall;
1132*0Sstevel@tonic-gate 	int nsysarg = Lsp->pr_nsysarg;
1133*0Sstevel@tonic-gate 	int subcode = -1;
1134*0Sstevel@tonic-gate 	int arg0;
1135*0Sstevel@tonic-gate 
1136*0Sstevel@tonic-gate 	if (syscall > 0 && nsysarg > 0) {
1137*0Sstevel@tonic-gate 		arg0 = Lsp->pr_sysarg[0];
1138*0Sstevel@tonic-gate 		switch (syscall) {
1139*0Sstevel@tonic-gate 		case SYS_utssys:	/* utssys() */
1140*0Sstevel@tonic-gate 			if (nsysarg > 2)
1141*0Sstevel@tonic-gate 				subcode = Lsp->pr_sysarg[2];
1142*0Sstevel@tonic-gate 			break;
1143*0Sstevel@tonic-gate 		case SYS_open:		/* open() w/ and w/o O_CREAT */
1144*0Sstevel@tonic-gate 		case SYS_open64:
1145*0Sstevel@tonic-gate 			if (nsysarg > 1)
1146*0Sstevel@tonic-gate 				subcode = (Lsp->pr_sysarg[1] & O_CREAT)? 1 : 0;
1147*0Sstevel@tonic-gate 			break;
1148*0Sstevel@tonic-gate 		case SYS_fsat:
1149*0Sstevel@tonic-gate 			switch (arg0) {
1150*0Sstevel@tonic-gate 			case 0:  /* openat */
1151*0Sstevel@tonic-gate 				if (nsysarg > 3)
1152*0Sstevel@tonic-gate 					subcode =
1153*0Sstevel@tonic-gate 					    (Lsp->pr_sysarg[3] & O_CREAT) ?
1154*0Sstevel@tonic-gate 					    0 : 8;
1155*0Sstevel@tonic-gate 				break;
1156*0Sstevel@tonic-gate 			case 1: /* openat64 */
1157*0Sstevel@tonic-gate 				if (nsysarg > 3)
1158*0Sstevel@tonic-gate 					subcode =
1159*0Sstevel@tonic-gate 					    (Lsp->pr_sysarg[3] & O_CREAT) ?
1160*0Sstevel@tonic-gate 					    1 : 9;
1161*0Sstevel@tonic-gate 				break;
1162*0Sstevel@tonic-gate 			case 2:
1163*0Sstevel@tonic-gate 			case 3:
1164*0Sstevel@tonic-gate 			case 4:
1165*0Sstevel@tonic-gate 			case 5:
1166*0Sstevel@tonic-gate 			case 6:
1167*0Sstevel@tonic-gate 			case 7:
1168*0Sstevel@tonic-gate 				subcode = arg0;
1169*0Sstevel@tonic-gate 			}
1170*0Sstevel@tonic-gate 			break;
1171*0Sstevel@tonic-gate 		case SYS_signal:	/* signal() + sigset() family */
1172*0Sstevel@tonic-gate 			switch (arg0 & ~SIGNO_MASK) {
1173*0Sstevel@tonic-gate 			default:	subcode = 0;	break;
1174*0Sstevel@tonic-gate 			case SIGDEFER:	subcode = 1;	break;
1175*0Sstevel@tonic-gate 			case SIGHOLD:	subcode = 2;	break;
1176*0Sstevel@tonic-gate 			case SIGRELSE:	subcode = 3;	break;
1177*0Sstevel@tonic-gate 			case SIGIGNORE:	subcode = 4;	break;
1178*0Sstevel@tonic-gate 			case SIGPAUSE:	subcode = 5;	break;
1179*0Sstevel@tonic-gate 			}
1180*0Sstevel@tonic-gate 			break;
1181*0Sstevel@tonic-gate 		case SYS_kaio:		/* kaio() */
1182*0Sstevel@tonic-gate 			subcode = arg0 & ~AIO_POLL_BIT;
1183*0Sstevel@tonic-gate 			break;
1184*0Sstevel@tonic-gate 		case SYS_door:		/* doors */
1185*0Sstevel@tonic-gate 			if (nsysarg > 5)
1186*0Sstevel@tonic-gate 				subcode = Lsp->pr_sysarg[5];
1187*0Sstevel@tonic-gate 			break;
1188*0Sstevel@tonic-gate 		case SYS_lwp_create:	/* lwp_create() */
1189*0Sstevel@tonic-gate 			subcode =	/* 0 for parent, 1 for child */
1190*0Sstevel@tonic-gate 				(Lsp->pr_why == PR_SYSEXIT &&
1191*0Sstevel@tonic-gate 				    Lsp->pr_errno == 0 &&
1192*0Sstevel@tonic-gate 				    Lsp->pr_rval1 == 0);
1193*0Sstevel@tonic-gate 			break;
1194*0Sstevel@tonic-gate 		case SYS_msgsys:	/* msgsys() */
1195*0Sstevel@tonic-gate 		case SYS_semsys:	/* semsys() */
1196*0Sstevel@tonic-gate 		case SYS_shmsys:	/* shmsys() */
1197*0Sstevel@tonic-gate 		case SYS_pgrpsys:	/* pgrpsys() */
1198*0Sstevel@tonic-gate 		case SYS_sysfs:		/* sysfs() */
1199*0Sstevel@tonic-gate 		case SYS_sigpending:	/* sigpending()/sigfillset() */
1200*0Sstevel@tonic-gate 		case SYS_context:	/* [get|set]context() */
1201*0Sstevel@tonic-gate 		case SYS_hrtsys:	/* hrtsys() */
1202*0Sstevel@tonic-gate 		case SYS_corectl:	/* corectl() */
1203*0Sstevel@tonic-gate 		case SYS_pset:		/* pset() */
1204*0Sstevel@tonic-gate 		case SYS_tasksys:	/* tasks */
1205*0Sstevel@tonic-gate 		case SYS_privsys:	/* privileges */
1206*0Sstevel@tonic-gate 		case SYS_exacctsys:	/* exacct */
1207*0Sstevel@tonic-gate 		case SYS_lwp_park:	/* lwp_park */
1208*0Sstevel@tonic-gate 		case SYS_lwp_rwlock_sys: /* lwp_rwlock_*() */
1209*0Sstevel@tonic-gate 		case SYS_sendfilev:	/* sendfilev */
1210*0Sstevel@tonic-gate 		case SYS_lgrpsys:	/* lgrpsys */
1211*0Sstevel@tonic-gate 		case SYS_rusagesys:	/* rusagesys */
1212*0Sstevel@tonic-gate 		case SYS_ucredsys:	/* ucredsys */
1213*0Sstevel@tonic-gate 		case SYS_zone:		/* zone */
1214*0Sstevel@tonic-gate 			subcode = arg0;
1215*0Sstevel@tonic-gate 			break;
1216*0Sstevel@tonic-gate 		case SYS_fcntl:		/* fcntl() */
1217*0Sstevel@tonic-gate 			if (nsysarg > 2) {
1218*0Sstevel@tonic-gate 				switch (Lsp->pr_sysarg[1]) {
1219*0Sstevel@tonic-gate 				default:	subcode = 0; break;
1220*0Sstevel@tonic-gate 				case F_GETFL:
1221*0Sstevel@tonic-gate 				case F_GETOWN:
1222*0Sstevel@tonic-gate 				case F_GETXFL:	subcode = 1; break;
1223*0Sstevel@tonic-gate 				case F_SETFL:	subcode = 2; break;
1224*0Sstevel@tonic-gate 				}
1225*0Sstevel@tonic-gate 			}
1226*0Sstevel@tonic-gate 			break;
1227*0Sstevel@tonic-gate 		case SYS_port:		/* portfs */
1228*0Sstevel@tonic-gate 			subcode = arg0 & PORT_CODE_MASK;
1229*0Sstevel@tonic-gate 			break;
1230*0Sstevel@tonic-gate 		}
1231*0Sstevel@tonic-gate 	}
1232*0Sstevel@tonic-gate 
1233*0Sstevel@tonic-gate 	return (subcode);
1234*0Sstevel@tonic-gate }
1235*0Sstevel@tonic-gate 
1236*0Sstevel@tonic-gate /*
1237*0Sstevel@tonic-gate  * Return the maximum number of system calls, counting
1238*0Sstevel@tonic-gate  * all system calls with subcodes as separate calls.
1239*0Sstevel@tonic-gate  */
1240*0Sstevel@tonic-gate int
1241*0Sstevel@tonic-gate maxsyscalls()
1242*0Sstevel@tonic-gate {
1243*0Sstevel@tonic-gate 	return (PRMAXSYS + 1
1244*0Sstevel@tonic-gate 		+ NOPENCODE - 1
1245*0Sstevel@tonic-gate 		+ NOPEN64CODE - 1
1246*0Sstevel@tonic-gate 		+ NSIGCODE - 1
1247*0Sstevel@tonic-gate 		+ NMSGCODE - 1
1248*0Sstevel@tonic-gate 		+ NSEMCODE - 1
1249*0Sstevel@tonic-gate 		+ NSHMCODE - 1
1250*0Sstevel@tonic-gate 		+ NPIDCODE - 1
1251*0Sstevel@tonic-gate 		+ NSFSCODE - 1
1252*0Sstevel@tonic-gate 		+ NUTSCODE - 1
1253*0Sstevel@tonic-gate 		+ NSGPCODE - 1
1254*0Sstevel@tonic-gate 		+ NCTXCODE - 1
1255*0Sstevel@tonic-gate 		+ NHRTCODE - 1
1256*0Sstevel@tonic-gate 		+ NCORCODE - 1
1257*0Sstevel@tonic-gate 		+ NAIOCODE - 1
1258*0Sstevel@tonic-gate 		+ NDOORCODE - 1
1259*0Sstevel@tonic-gate 		+ NPSETCODE - 1
1260*0Sstevel@tonic-gate 		+ NLWPCREATECODE - 1
1261*0Sstevel@tonic-gate 		+ NTASKSYSCODE - 1
1262*0Sstevel@tonic-gate 		+ NEXACCTSYSCODE - 1
1263*0Sstevel@tonic-gate 		+ NFSATSYSCODE - 1
1264*0Sstevel@tonic-gate 		+ NLWPPARKCODE - 1
1265*0Sstevel@tonic-gate 		+ NLWPRWLOCKCODE - 1
1266*0Sstevel@tonic-gate 		+ NSENDFILESYSCODE - 1
1267*0Sstevel@tonic-gate 		+ NLGRPSYSCODE - 1
1268*0Sstevel@tonic-gate 		+ NRUSAGESYSCODE - 1
1269*0Sstevel@tonic-gate 		+ NFCNTLCODE - 1
1270*0Sstevel@tonic-gate 		+ NPRIVSYSCODE - 1
1271*0Sstevel@tonic-gate 		+ NUCREDSYSCODE - 1
1272*0Sstevel@tonic-gate 		+ NPORTCODE - 1
1273*0Sstevel@tonic-gate 		+ NZONECODE - 1);
1274*0Sstevel@tonic-gate }
1275*0Sstevel@tonic-gate 
1276*0Sstevel@tonic-gate /*
1277*0Sstevel@tonic-gate  * Return the number of subcodes for the specified system call number.
1278*0Sstevel@tonic-gate  */
1279*0Sstevel@tonic-gate int
1280*0Sstevel@tonic-gate nsubcodes(int syscall)
1281*0Sstevel@tonic-gate {
1282*0Sstevel@tonic-gate 	switch (syscall) {
1283*0Sstevel@tonic-gate 	case SYS_open:
1284*0Sstevel@tonic-gate 		return (NOPENCODE);
1285*0Sstevel@tonic-gate 	case SYS_open64:
1286*0Sstevel@tonic-gate 		return (NOPEN64CODE);
1287*0Sstevel@tonic-gate 	case SYS_signal:	/* signal() + sigset() family */
1288*0Sstevel@tonic-gate 		return (NSIGCODE);
1289*0Sstevel@tonic-gate 	case SYS_msgsys:	/* msgsys() */
1290*0Sstevel@tonic-gate 		return (NMSGCODE);
1291*0Sstevel@tonic-gate 	case SYS_semsys:	/* semsys() */
1292*0Sstevel@tonic-gate 		return (NSEMCODE);
1293*0Sstevel@tonic-gate 	case SYS_shmsys:	/* shmsys() */
1294*0Sstevel@tonic-gate 		return (NSHMCODE);
1295*0Sstevel@tonic-gate 	case SYS_pgrpsys:	/* pgrpsys() */
1296*0Sstevel@tonic-gate 		return (NPIDCODE);
1297*0Sstevel@tonic-gate 	case SYS_utssys:	/* utssys() */
1298*0Sstevel@tonic-gate 		return (NUTSCODE);
1299*0Sstevel@tonic-gate 	case SYS_sysfs:		/* sysfs() */
1300*0Sstevel@tonic-gate 		return (NSFSCODE);
1301*0Sstevel@tonic-gate 	case SYS_sigpending:	/* sigpending()/sigfillset() */
1302*0Sstevel@tonic-gate 		return (NSGPCODE);
1303*0Sstevel@tonic-gate 	case SYS_context:	/* [get|set]context() */
1304*0Sstevel@tonic-gate 		return (NCTXCODE);
1305*0Sstevel@tonic-gate 	case SYS_hrtsys:	/* hrtsys() */
1306*0Sstevel@tonic-gate 		return (NHRTCODE);
1307*0Sstevel@tonic-gate 	case SYS_corectl:	/* corectl() */
1308*0Sstevel@tonic-gate 		return (NCORCODE);
1309*0Sstevel@tonic-gate 	case SYS_kaio:		/* kaio() */
1310*0Sstevel@tonic-gate 		return (NAIOCODE);
1311*0Sstevel@tonic-gate 	case SYS_door:		/* doors */
1312*0Sstevel@tonic-gate 		return (NDOORCODE);
1313*0Sstevel@tonic-gate 	case SYS_pset:		/* pset() */
1314*0Sstevel@tonic-gate 		return (NPSETCODE);
1315*0Sstevel@tonic-gate 	case SYS_lwp_create:	/* lwp_create() */
1316*0Sstevel@tonic-gate 		return (NLWPCREATECODE);
1317*0Sstevel@tonic-gate 	case SYS_tasksys:	/* tasks */
1318*0Sstevel@tonic-gate 		return (NTASKSYSCODE);
1319*0Sstevel@tonic-gate 	case SYS_exacctsys:	/* exacct */
1320*0Sstevel@tonic-gate 		return (NEXACCTSYSCODE);
1321*0Sstevel@tonic-gate 	case SYS_fsat:
1322*0Sstevel@tonic-gate 		return (NFSATSYSCODE);
1323*0Sstevel@tonic-gate 	case SYS_privsys:	/* privileges */
1324*0Sstevel@tonic-gate 		return (NPRIVSYSCODE);
1325*0Sstevel@tonic-gate 	case SYS_lwp_park:	/* lwp_park */
1326*0Sstevel@tonic-gate 		return (NLWPPARKCODE);
1327*0Sstevel@tonic-gate 	case SYS_lwp_rwlock_sys:
1328*0Sstevel@tonic-gate 		return (NLWPRWLOCKCODE);
1329*0Sstevel@tonic-gate 	case SYS_sendfilev:	/* sendfilev */
1330*0Sstevel@tonic-gate 		return (NSENDFILESYSCODE);
1331*0Sstevel@tonic-gate 	case SYS_lgrpsys:	/* lgrpsys */
1332*0Sstevel@tonic-gate 		return (NLGRPSYSCODE);
1333*0Sstevel@tonic-gate 	case SYS_rusagesys:
1334*0Sstevel@tonic-gate 		return (NRUSAGESYSCODE);
1335*0Sstevel@tonic-gate 	case SYS_fcntl:
1336*0Sstevel@tonic-gate 		return (NFCNTLCODE);
1337*0Sstevel@tonic-gate 	case SYS_ucredsys:
1338*0Sstevel@tonic-gate 		return (NUCREDSYSCODE);
1339*0Sstevel@tonic-gate 	case SYS_port:
1340*0Sstevel@tonic-gate 		return (NPORTCODE);
1341*0Sstevel@tonic-gate 	case SYS_zone:		/* zone */
1342*0Sstevel@tonic-gate 		return (NZONECODE);
1343*0Sstevel@tonic-gate 	default:
1344*0Sstevel@tonic-gate 		return (1);
1345*0Sstevel@tonic-gate 	}
1346*0Sstevel@tonic-gate }
1347*0Sstevel@tonic-gate 
1348*0Sstevel@tonic-gate 
1349*0Sstevel@tonic-gate 
1350*0Sstevel@tonic-gate /* Socket address families (and protocol families) */
1351*0Sstevel@tonic-gate const char * const afcodes[] = {
1352*0Sstevel@tonic-gate 	"UNSPEC",	/* 0 */
1353*0Sstevel@tonic-gate 	"UNIX",		/* 1 */
1354*0Sstevel@tonic-gate 	"INET",		/* 2 */
1355*0Sstevel@tonic-gate 	"IMPLINK",	/* 3 */
1356*0Sstevel@tonic-gate 	"PUP",		/* 4 */
1357*0Sstevel@tonic-gate 	"CHAOS",	/* 5 */
1358*0Sstevel@tonic-gate 	"NS",		/* 6 */
1359*0Sstevel@tonic-gate 	"NBS",		/* 7 */
1360*0Sstevel@tonic-gate 	"ECMA",		/* 8 */
1361*0Sstevel@tonic-gate 	"DATAKIT",	/* 9 */
1362*0Sstevel@tonic-gate 	"CCITT",	/* 10 */
1363*0Sstevel@tonic-gate 	"SNA",		/* 11 */
1364*0Sstevel@tonic-gate 	"DECnet",	/* 12 */
1365*0Sstevel@tonic-gate 	"DLI",		/* 13 */
1366*0Sstevel@tonic-gate 	"LAT",		/* 14 */
1367*0Sstevel@tonic-gate 	"HYLINK",	/* 15 */
1368*0Sstevel@tonic-gate 	"APPLETALK",	/* 16 */
1369*0Sstevel@tonic-gate 	"NIT",		/* 17 */
1370*0Sstevel@tonic-gate 	"802",		/* 18 */
1371*0Sstevel@tonic-gate 	"OSI",		/* 19 */
1372*0Sstevel@tonic-gate 	"X25",		/* 20 */
1373*0Sstevel@tonic-gate 	"OSINET",	/* 21 */
1374*0Sstevel@tonic-gate 	"GOSIP",	/* 22 */
1375*0Sstevel@tonic-gate 	"IPX",		/* 23 */
1376*0Sstevel@tonic-gate 	"ROUTE",	/* 24 */
1377*0Sstevel@tonic-gate 	"LINK",		/* 25 */
1378*0Sstevel@tonic-gate 	"INET6",	/* 26 */
1379*0Sstevel@tonic-gate 	"KEY",		/* 27 */
1380*0Sstevel@tonic-gate 	"NCA",		/* 28 */
1381*0Sstevel@tonic-gate 	"POLICY"	/* 29 */
1382*0Sstevel@tonic-gate };
1383*0Sstevel@tonic-gate #if MAX_AFCODES != 30
1384*0Sstevel@tonic-gate #error Need to update address-family table
1385*0Sstevel@tonic-gate #endif
1386*0Sstevel@tonic-gate 
1387*0Sstevel@tonic-gate 
1388*0Sstevel@tonic-gate const char * const socktype_codes[] = {		/* cf socket.h */
1389*0Sstevel@tonic-gate 	NULL,
1390*0Sstevel@tonic-gate 	"SOCK_DGRAM",		/* 1 */
1391*0Sstevel@tonic-gate 	"SOCK_STREAM",		/* 2 */
1392*0Sstevel@tonic-gate 	NULL,
1393*0Sstevel@tonic-gate 	"SOCK_RAW",		/* 4 */
1394*0Sstevel@tonic-gate 	"SOCK_RDM",		/* 5 */
1395*0Sstevel@tonic-gate 	"SOCK_SEQPACKET"	/* 6 */
1396*0Sstevel@tonic-gate };
1397*0Sstevel@tonic-gate #if MAX_SOCKTYPES != 7
1398*0Sstevel@tonic-gate #error Need to update socket-type table
1399*0Sstevel@tonic-gate #endif
1400