xref: /onnv-gate/usr/src/cmd/truss/systable.c (revision 3247)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
51676Sjpk  * Common Development and Distribution License (the "License").
61676Sjpk  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
212248Sraf 
220Sstevel@tonic-gate /*
231676Sjpk  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
280Sstevel@tonic-gate /*	  All Rights Reserved  	*/
290Sstevel@tonic-gate 
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #include <stdio.h>
340Sstevel@tonic-gate #include <stdlib.h>
350Sstevel@tonic-gate #include <fcntl.h>
360Sstevel@tonic-gate #include <unistd.h>
370Sstevel@tonic-gate #include <string.h>
380Sstevel@tonic-gate #include <signal.h>
390Sstevel@tonic-gate #include <sys/types.h>
400Sstevel@tonic-gate #include <libproc.h>
410Sstevel@tonic-gate #include <sys/aio.h>
420Sstevel@tonic-gate #include <sys/port_impl.h>
430Sstevel@tonic-gate #include "ramdata.h"
440Sstevel@tonic-gate #include "systable.h"
450Sstevel@tonic-gate #include "print.h"
460Sstevel@tonic-gate #include "proto.h"
470Sstevel@tonic-gate 
480Sstevel@tonic-gate /*
490Sstevel@tonic-gate  * Tables of information about system calls - read-only data.
500Sstevel@tonic-gate  */
510Sstevel@tonic-gate 
520Sstevel@tonic-gate const	char *const	errcode[] = {	/* error code names */
530Sstevel@tonic-gate 	NULL,		/*  0 */
540Sstevel@tonic-gate 	"EPERM",	/*  1 */
550Sstevel@tonic-gate 	"ENOENT",	/*  2 */
560Sstevel@tonic-gate 	"ESRCH",	/*  3 */
570Sstevel@tonic-gate 	"EINTR",	/*  4 */
580Sstevel@tonic-gate 	"EIO",		/*  5 */
590Sstevel@tonic-gate 	"ENXIO",	/*  6 */
600Sstevel@tonic-gate 	"E2BIG",	/*  7 */
610Sstevel@tonic-gate 	"ENOEXEC",	/*  8 */
620Sstevel@tonic-gate 	"EBADF",	/*  9 */
630Sstevel@tonic-gate 	"ECHILD",	/* 10 */
640Sstevel@tonic-gate 	"EAGAIN",	/* 11 */
650Sstevel@tonic-gate 	"ENOMEM",	/* 12 */
660Sstevel@tonic-gate 	"EACCES",	/* 13 */
670Sstevel@tonic-gate 	"EFAULT",	/* 14 */
680Sstevel@tonic-gate 	"ENOTBLK",	/* 15 */
690Sstevel@tonic-gate 	"EBUSY",	/* 16 */
700Sstevel@tonic-gate 	"EEXIST",	/* 17 */
710Sstevel@tonic-gate 	"EXDEV",	/* 18 */
720Sstevel@tonic-gate 	"ENODEV",	/* 19 */
730Sstevel@tonic-gate 	"ENOTDIR",	/* 20 */
740Sstevel@tonic-gate 	"EISDIR",	/* 21 */
750Sstevel@tonic-gate 	"EINVAL",	/* 22 */
760Sstevel@tonic-gate 	"ENFILE",	/* 23 */
770Sstevel@tonic-gate 	"EMFILE",	/* 24 */
780Sstevel@tonic-gate 	"ENOTTY",	/* 25 */
790Sstevel@tonic-gate 	"ETXTBSY",	/* 26 */
800Sstevel@tonic-gate 	"EFBIG",	/* 27 */
810Sstevel@tonic-gate 	"ENOSPC",	/* 28 */
820Sstevel@tonic-gate 	"ESPIPE",	/* 29 */
830Sstevel@tonic-gate 	"EROFS",	/* 30 */
840Sstevel@tonic-gate 	"EMLINK",	/* 31 */
850Sstevel@tonic-gate 	"EPIPE",	/* 32 */
860Sstevel@tonic-gate 	"EDOM",		/* 33 */
870Sstevel@tonic-gate 	"ERANGE",	/* 34 */
880Sstevel@tonic-gate 	"ENOMSG",	/* 35 */
890Sstevel@tonic-gate 	"EIDRM",	/* 36 */
900Sstevel@tonic-gate 	"ECHRNG",	/* 37 */
910Sstevel@tonic-gate 	"EL2NSYNC",	/* 38 */
920Sstevel@tonic-gate 	"EL3HLT",	/* 39 */
930Sstevel@tonic-gate 	"EL3RST",	/* 40 */
940Sstevel@tonic-gate 	"ELNRNG",	/* 41 */
950Sstevel@tonic-gate 	"EUNATCH",	/* 42 */
960Sstevel@tonic-gate 	"ENOCSI",	/* 43 */
970Sstevel@tonic-gate 	"EL2HLT",	/* 44 */
980Sstevel@tonic-gate 	"EDEADLK",	/* 45 */
990Sstevel@tonic-gate 	"ENOLCK",	/* 46 */
1000Sstevel@tonic-gate 	"ECANCELED",	/* 47 */
1010Sstevel@tonic-gate 	"ENOTSUP",	/* 48 */
1020Sstevel@tonic-gate 	"EDQUOT",	/* 49 */
1030Sstevel@tonic-gate 	"EBADE",	/* 50 */
1040Sstevel@tonic-gate 	"EBADR",	/* 51 */
1050Sstevel@tonic-gate 	"EXFULL",	/* 52 */
1060Sstevel@tonic-gate 	"ENOANO",	/* 53 */
1070Sstevel@tonic-gate 	"EBADRQC",	/* 54 */
1080Sstevel@tonic-gate 	"EBADSLT",	/* 55 */
1090Sstevel@tonic-gate 	"EDEADLOCK",	/* 56 */
1100Sstevel@tonic-gate 	"EBFONT",	/* 57 */
1110Sstevel@tonic-gate 	"EOWNERDEAD",	/* 58 */
1120Sstevel@tonic-gate 	"ENOTRECOVERABLE",	/* 59 */
1130Sstevel@tonic-gate 	"ENOSTR",	/* 60 */
1140Sstevel@tonic-gate 	"ENODATA",	/* 61 */
1150Sstevel@tonic-gate 	"ETIME",	/* 62 */
1160Sstevel@tonic-gate 	"ENOSR",	/* 63 */
1170Sstevel@tonic-gate 	"ENONET",	/* 64 */
1180Sstevel@tonic-gate 	"ENOPKG",	/* 65 */
1190Sstevel@tonic-gate 	"EREMOTE",	/* 66 */
1200Sstevel@tonic-gate 	"ENOLINK",	/* 67 */
1210Sstevel@tonic-gate 	"EADV",		/* 68 */
1220Sstevel@tonic-gate 	"ESRMNT",	/* 69 */
1230Sstevel@tonic-gate 	"ECOMM",	/* 70 */
1240Sstevel@tonic-gate 	"EPROTO",	/* 71 */
1250Sstevel@tonic-gate 	"ELOCKUNMAPPED",	/* 72 */
1260Sstevel@tonic-gate 	"ENOTACTIVE",	/* 73 */
1270Sstevel@tonic-gate 	"EMULTIHOP",	/* 74 */
1280Sstevel@tonic-gate 	NULL,		/* 75 */
1290Sstevel@tonic-gate 	NULL,		/* 76 */
1300Sstevel@tonic-gate 	"EBADMSG",	/* 77 */
1310Sstevel@tonic-gate 	"ENAMETOOLONG",	/* 78 */
1320Sstevel@tonic-gate 	"EOVERFLOW",	/* 79 */
1330Sstevel@tonic-gate 	"ENOTUNIQ",	/* 80 */
1340Sstevel@tonic-gate 	"EBADFD",	/* 81 */
1350Sstevel@tonic-gate 	"EREMCHG",	/* 82 */
1360Sstevel@tonic-gate 	"ELIBACC",	/* 83 */
1370Sstevel@tonic-gate 	"ELIBBAD",	/* 84 */
1380Sstevel@tonic-gate 	"ELIBSCN",	/* 85 */
1390Sstevel@tonic-gate 	"ELIBMAX",	/* 86 */
1400Sstevel@tonic-gate 	"ELIBEXEC",	/* 87 */
1410Sstevel@tonic-gate 	"EILSEQ",	/* 88 */
1420Sstevel@tonic-gate 	"ENOSYS",	/* 89 */
1430Sstevel@tonic-gate 	"ELOOP",	/* 90 */
1440Sstevel@tonic-gate 	"ERESTART",	/* 91 */
1450Sstevel@tonic-gate 	"ESTRPIPE",	/* 92 */
1460Sstevel@tonic-gate 	"ENOTEMPTY",	/* 93 */
1470Sstevel@tonic-gate 	"EUSERS",	/* 94 */
1480Sstevel@tonic-gate 	"ENOTSOCK",	/* 95 */
1490Sstevel@tonic-gate 	"EDESTADDRREQ",	/* 96 */
1500Sstevel@tonic-gate 	"EMSGSIZE",	/* 97 */
1510Sstevel@tonic-gate 	"EPROTOTYPE",	/* 98 */
1520Sstevel@tonic-gate 	"ENOPROTOOPT",	/* 99 */
1530Sstevel@tonic-gate 	NULL,		/* 100 */
1540Sstevel@tonic-gate 	NULL,		/* 101 */
1550Sstevel@tonic-gate 	NULL,		/* 102 */
1560Sstevel@tonic-gate 	NULL,		/* 103 */
1570Sstevel@tonic-gate 	NULL,		/* 104 */
1580Sstevel@tonic-gate 	NULL,		/* 105 */
1590Sstevel@tonic-gate 	NULL,		/* 106 */
1600Sstevel@tonic-gate 	NULL,		/* 107 */
1610Sstevel@tonic-gate 	NULL,		/* 108 */
1620Sstevel@tonic-gate 	NULL,		/* 109 */
1630Sstevel@tonic-gate 	NULL,		/* 110 */
1640Sstevel@tonic-gate 	NULL,		/* 111 */
1650Sstevel@tonic-gate 	NULL,		/* 112 */
1660Sstevel@tonic-gate 	NULL,		/* 113 */
1670Sstevel@tonic-gate 	NULL,		/* 114 */
1680Sstevel@tonic-gate 	NULL,		/* 115 */
1690Sstevel@tonic-gate 	NULL,		/* 116 */
1700Sstevel@tonic-gate 	NULL,		/* 117 */
1710Sstevel@tonic-gate 	NULL,		/* 118 */
1720Sstevel@tonic-gate 	NULL,		/* 119 */
1730Sstevel@tonic-gate 	"EPROTONOSUPPORT",	/* 120 */
1740Sstevel@tonic-gate 	"ESOCKTNOSUPPORT",	/* 121 */
1750Sstevel@tonic-gate 	"EOPNOTSUPP",	/* 122 */
1760Sstevel@tonic-gate 	"EPFNOSUPPORT",	/* 123 */
1770Sstevel@tonic-gate 	"EAFNOSUPPORT",	/* 124 */
1780Sstevel@tonic-gate 	"EADDRINUSE",	/* 125 */
1790Sstevel@tonic-gate 	"EADDRNOTAVAIL", /* 126 */
1800Sstevel@tonic-gate 	"ENETDOWN",	/* 127 */
1810Sstevel@tonic-gate 	"ENETUNREACH",	/* 128 */
1820Sstevel@tonic-gate 	"ENETRESET",	/* 129 */
1830Sstevel@tonic-gate 	"ECONNABORTED",	/* 130 */
1840Sstevel@tonic-gate 	"ECONNRESET",	/* 131 */
1850Sstevel@tonic-gate 	"ENOBUFS",	/* 132 */
1860Sstevel@tonic-gate 	"EISCONN",	/* 133 */
1870Sstevel@tonic-gate 	"ENOTCONN",	/* 134 */
1880Sstevel@tonic-gate 	NULL,		/* 135 */
1890Sstevel@tonic-gate 	NULL,		/* 136 */
1900Sstevel@tonic-gate 	NULL,		/* 137 */
1910Sstevel@tonic-gate 	NULL,		/* 138 */
1920Sstevel@tonic-gate 	NULL,		/* 139 */
1930Sstevel@tonic-gate 	NULL,		/* 140 */
1940Sstevel@tonic-gate 	NULL,		/* 141 */
1950Sstevel@tonic-gate 	NULL,		/* 142 */
1960Sstevel@tonic-gate 	"ESHUTDOWN",	/* 143 */
1970Sstevel@tonic-gate 	"ETOOMANYREFS",	/* 144 */
1980Sstevel@tonic-gate 	"ETIMEDOUT",	/* 145 */
1990Sstevel@tonic-gate 	"ECONNREFUSED",	/* 146 */
2000Sstevel@tonic-gate 	"EHOSTDOWN",	/* 147 */
2010Sstevel@tonic-gate 	"EHOSTUNREACH",	/* 148 */
2020Sstevel@tonic-gate 	"EALREADY",	/* 149 */
2030Sstevel@tonic-gate 	"EINPROGRESS",	/* 150 */
2040Sstevel@tonic-gate 	"ESTALE"	/* 151 */
2050Sstevel@tonic-gate };
2060Sstevel@tonic-gate 
2070Sstevel@tonic-gate #define	NERRCODE	(sizeof (errcode) / sizeof (char *))
2080Sstevel@tonic-gate 
2090Sstevel@tonic-gate 
2100Sstevel@tonic-gate const char *
2110Sstevel@tonic-gate errname(int err)	/* return the error code name (NULL if none) */
2120Sstevel@tonic-gate {
2130Sstevel@tonic-gate 	const char *ename = NULL;
2140Sstevel@tonic-gate 
2150Sstevel@tonic-gate 	if (err >= 0 && err < NERRCODE)
2160Sstevel@tonic-gate 		ename = errcode[err];
2170Sstevel@tonic-gate 
2180Sstevel@tonic-gate 	return (ename);
2190Sstevel@tonic-gate }
2200Sstevel@tonic-gate 
2210Sstevel@tonic-gate 
2220Sstevel@tonic-gate const struct systable systable[] = {
2230Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2240Sstevel@tonic-gate {"_exit",	1, DEC, NOV, DEC},				/*   1 */
2250Sstevel@tonic-gate {"forkall",	0, DEC, NOV},					/*   2 */
2260Sstevel@tonic-gate {"read",	3, DEC, NOV, DEC, IOB, UNS},			/*   3 */
2270Sstevel@tonic-gate {"write",	3, DEC, NOV, DEC, IOB, UNS},			/*   4 */
2280Sstevel@tonic-gate {"open",	3, DEC, NOV, STG, OPN, OCT},			/*   5 */
2290Sstevel@tonic-gate {"close",	1, DEC, NOV, DEC},				/*   6 */
2300Sstevel@tonic-gate {"wait",	0, DEC, HHX},					/*   7 */
2310Sstevel@tonic-gate {"creat",	2, DEC, NOV, STG, OCT},				/*   8 */
2320Sstevel@tonic-gate {"link",	2, DEC, NOV, STG, STG},				/*   9 */
2330Sstevel@tonic-gate {"unlink",	1, DEC, NOV, STG},				/*  10 */
2340Sstevel@tonic-gate {"exec",	2, DEC, NOV, STG, DEC},				/*  11 */
2350Sstevel@tonic-gate {"chdir",	1, DEC, NOV, STG},				/*  12 */
2360Sstevel@tonic-gate {"time",	0, DEC, NOV},					/*  13 */
2370Sstevel@tonic-gate {"mknod",	3, DEC, NOV, STG, OCT, HEX},			/*  14 */
2380Sstevel@tonic-gate {"chmod",	2, DEC, NOV, STG, OCT},				/*  15 */
2390Sstevel@tonic-gate {"chown",	3, DEC, NOV, STG, DEC, DEC},			/*  16 */
2400Sstevel@tonic-gate {"brk",		1, DEC, NOV, HEX},				/*  17 */
2410Sstevel@tonic-gate {"stat",	2, DEC, NOV, STG, HEX},				/*  18 */
2420Sstevel@tonic-gate {"lseek",	3, DEC, NOV, DEC, DEX, WHN},			/*  19 */
2430Sstevel@tonic-gate {"getpid",	0, DEC, DEC},					/*  20 */
2440Sstevel@tonic-gate {"mount",	8, DEC, NOV, STG, STG, MTF, MFT, HEX, DEC, HEX, DEC},	/* 21 */
2450Sstevel@tonic-gate {"umount",	1, DEC, NOV, STG},				/*  22 */
2460Sstevel@tonic-gate {"setuid",	1, DEC, NOV, DEC},				/*  23 */
2470Sstevel@tonic-gate {"getuid",	0, DEC, DEC},					/*  24 */
2480Sstevel@tonic-gate {"stime",	1, DEC, NOV, DEC},				/*  25 */
2490Sstevel@tonic-gate {"pcsample",	2, DEC, NOV, HEX, DEC},				/*  26 */
2500Sstevel@tonic-gate {"alarm",	1, DEC, NOV, UNS},				/*  27 */
2510Sstevel@tonic-gate {"fstat",	2, DEC, NOV, DEC, HEX},				/*  28 */
2520Sstevel@tonic-gate {"pause",	0, DEC, NOV},					/*  29 */
2530Sstevel@tonic-gate {"utime",	2, DEC, NOV, STG, HEX},				/*  30 */
2540Sstevel@tonic-gate {"stty",	2, DEC, NOV, DEC, DEC},				/*  31 */
2550Sstevel@tonic-gate {"gtty",	2, DEC, NOV, DEC, DEC},				/*  32 */
2560Sstevel@tonic-gate {"access",	2, DEC, NOV, STG, ACC},				/*  33 */
2570Sstevel@tonic-gate {"nice",	1, DEC, NOV, DEC},				/*  34 */
2580Sstevel@tonic-gate {"statfs",	4, DEC, NOV, STG, HEX, DEC, DEC},		/*  35 */
2590Sstevel@tonic-gate {"sync",	0, DEC, NOV},					/*  36 */
2600Sstevel@tonic-gate {"kill",	2, DEC, NOV, DEC, SIG},				/*  37 */
2610Sstevel@tonic-gate {"fstatfs",	4, DEC, NOV, DEC, HEX, DEC, DEC},		/*  38 */
2620Sstevel@tonic-gate {"pgrpsys",	3, DEC, NOV, DEC, DEC, DEC},			/*  39 */
2632712Snn35248 {"uucopystr",	3, DEC, NOV, STG, RST, UNS},			/*  40 */
2640Sstevel@tonic-gate {"dup",		1, DEC, NOV, DEC},				/*  41 */
2650Sstevel@tonic-gate {"pipe",	0, DEC, DEC},					/*  42 */
2660Sstevel@tonic-gate {"times",	1, DEC, NOV, HEX},				/*  43 */
2670Sstevel@tonic-gate {"profil",	4, DEC, NOV, HEX, UNS, HEX, OCT},		/*  44 */
2680Sstevel@tonic-gate {"plock",	1, DEC, NOV, PLK},				/*  45 */
2690Sstevel@tonic-gate {"setgid",	1, DEC, NOV, DEC},				/*  46 */
2700Sstevel@tonic-gate {"getgid",	0, DEC, DEC},					/*  47 */
2710Sstevel@tonic-gate {"signal",	2, HEX, NOV, SIG, ACT},				/*  48 */
2720Sstevel@tonic-gate {"msgsys",	6, DEC, NOV, DEC, DEC, DEC, DEC, DEC, DEC},	/*  49 */
2730Sstevel@tonic-gate {"sysi86",	4, HEX, NOV, S86, HEX, HEX, HEX, DEC, DEC},	/*  50 */
2740Sstevel@tonic-gate {"acct",	1, DEC, NOV, STG},				/*  51 */
2750Sstevel@tonic-gate {"shmsys",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/*  52 */
2760Sstevel@tonic-gate {"semsys",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/*  53 */
2770Sstevel@tonic-gate {"ioctl",	3, DEC, NOV, DEC, IOC, IOA},			/*  54 */
2780Sstevel@tonic-gate {"uadmin",	3, DEC, NOV, DEC, DEC, DEC},			/*  55 */
2790Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2800Sstevel@tonic-gate {"utssys",	4, DEC, NOV, HEX, DEC, UTS, HEX},		/*  57 */
2810Sstevel@tonic-gate {"fdsync",	2, DEC, NOV, DEC, FFG},				/*  58 */
2820Sstevel@tonic-gate {"execve",	3, DEC, NOV, STG, HEX, HEX},			/*  59 */
2830Sstevel@tonic-gate {"umask",	1, OCT, NOV, OCT},				/*  60 */
2840Sstevel@tonic-gate {"chroot",	1, DEC, NOV, STG},				/*  61 */
2850Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, HEX},			/*  62 */
2860Sstevel@tonic-gate {"ulimit",	2, DEX, NOV, ULM, DEC},				/*  63 */
2870Sstevel@tonic-gate 
2880Sstevel@tonic-gate /*  The following 6 entries were reserved for the UNIX PC */
2890Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2900Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2910Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2920Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2930Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2940Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2950Sstevel@tonic-gate 
2960Sstevel@tonic-gate {"tasksys",	5, DEC, NOV, DEC, DEC, DEC, HEX, DEC},		/*  70 */
2970Sstevel@tonic-gate {"acctctl",	3, DEC, NOV, HEX, HEX, UNS},			/*  71 */
2980Sstevel@tonic-gate {"exacctsys",	6, DEC, NOV, DEC, IDT, DEC, HEX, DEC, HEX},	/*  72 */
2990Sstevel@tonic-gate {"getpagesizes", 2, DEC, NOV, HEX, DEC},			/*  73 */
3002447Snf202958 {"rctlsys",	6, DEC, NOV, RSC, STG, HEX, HEX, DEC, DEC},	/*  74 */
3010Sstevel@tonic-gate {"issetugid",	0, DEC, NOV},					/*  75 */
3020Sstevel@tonic-gate {"fsat",	6, DEC, NOV, HEX, HEX, HEX, HEX, HEX, HEX},	/*  76 */
3030Sstevel@tonic-gate {"lwp_park",	3, DEC, NOV, DEC, HEX, DEC},			/*  77 */
3040Sstevel@tonic-gate {"sendfilev",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/*  78 */
3050Sstevel@tonic-gate {"rmdir",	1, DEC, NOV, STG},				/*  79 */
3060Sstevel@tonic-gate {"mkdir",	2, DEC, NOV, STG, OCT},				/*  80 */
3070Sstevel@tonic-gate {"getdents",	3, DEC, NOV, DEC, HEX, UNS},			/*  81 */
3080Sstevel@tonic-gate {"privsys",	5, HEX, NOV, DEC, DEC, DEC, HEX, DEC},		/*  82 */
3090Sstevel@tonic-gate {"ucredsys",	3, DEC, NOV, DEC, DEC, HEX},			/*  83 */
3100Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEX, DEX},			/*  84 */
3110Sstevel@tonic-gate {"getmsg",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/*  85 */
3120Sstevel@tonic-gate {"putmsg",	4, DEC, NOV, DEC, HEX, HEX, SMF},		/*  86 */
3130Sstevel@tonic-gate {"poll",	3, DEC, NOV, HEX, DEC, DEC},			/*  87 */
3140Sstevel@tonic-gate {"lstat",	2, DEC, NOV, STG, HEX},				/*  88 */
3150Sstevel@tonic-gate {"symlink",	2, DEC, NOV, STG, STG},				/*  89 */
3160Sstevel@tonic-gate {"readlink",	3, DEC, NOV, STG, RLK, UNS},			/*  90 */
3170Sstevel@tonic-gate {"setgroups",	2, DEC, NOV, DEC, HEX},				/*  91 */
3180Sstevel@tonic-gate {"getgroups",	2, DEC, NOV, DEC, HEX},				/*  92 */
3190Sstevel@tonic-gate {"fchmod",	2, DEC, NOV, DEC, OCT},				/*  93 */
3200Sstevel@tonic-gate {"fchown",	3, DEC, NOV, DEC, DEC, DEC},			/*  94 */
3210Sstevel@tonic-gate {"sigprocmask",	3, DEC, NOV, SPM, HEX, HEX},			/*  95 */
3220Sstevel@tonic-gate {"sigsuspend",	1, DEC, NOV, HEX},				/*  96 */
3230Sstevel@tonic-gate {"sigaltstack",	2, DEC, NOV, HEX, HEX},				/*  97 */
3240Sstevel@tonic-gate {"sigaction",	3, DEC, NOV, SIG, HEX, HEX},			/*  98 */
3250Sstevel@tonic-gate {"sigpendsys",	2, DEC, NOV, DEC, HEX},				/*  99 */
3260Sstevel@tonic-gate {"context",	2, DEC, NOV, DEC, HEX},				/* 100 */
3270Sstevel@tonic-gate {"evsys",	3, DEC, NOV, DEC, DEC, HEX},			/* 101 */
3280Sstevel@tonic-gate {"evtrapret",	0, DEC, NOV},					/* 102 */
3290Sstevel@tonic-gate {"statvfs",	2, DEC, NOV, STG, HEX},				/* 103 */
3300Sstevel@tonic-gate {"fstatvfs",	2, DEC, NOV, DEC, HEX},				/* 104 */
3310Sstevel@tonic-gate {"getloadavg",	2, DEC, NOV, HEX, DEC},				/* 105 */
3320Sstevel@tonic-gate {"nfssys",	2, DEC, NOV, DEC, HEX},				/* 106 */
3330Sstevel@tonic-gate {"waitid",	4, DEC, NOV, IDT, DEC, HEX, WOP},		/* 107 */
3340Sstevel@tonic-gate {"sigsendsys",	2, DEC, NOV, HEX, SIG},				/* 108 */
3350Sstevel@tonic-gate {"hrtsys",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 109 */
3360Sstevel@tonic-gate {"acancel",	3, DEC, NOV, DEC, HEX, DEC},			/* 110 */
3370Sstevel@tonic-gate {"async",	3, DEC, NOV, DEC, HEX, DEC},			/* 111 */
3380Sstevel@tonic-gate {"priocntlsys",	5, DEC, NOV, DEC, HEX, DEC, PC4, PC5},		/* 112 */
3390Sstevel@tonic-gate {"pathconf",	2, DEC, NOV, STG, PTC},				/* 113 */
3400Sstevel@tonic-gate {"mincore",	3, DEC, NOV, HEX, UNS, HEX},			/* 114 */
3410Sstevel@tonic-gate {"mmap",	6, HEX, NOV, HEX, UNS, MPR, MTY, DEC, DEC},	/* 115 */
3420Sstevel@tonic-gate {"mprotect",	3, DEC, NOV, HEX, UNS, MPR},			/* 116 */
3430Sstevel@tonic-gate {"munmap",	2, DEC, NOV, HEX, UNS},				/* 117 */
3440Sstevel@tonic-gate {"fpathconf",	2, DEC, NOV, DEC, PTC},				/* 118 */
3450Sstevel@tonic-gate {"vfork",	0, DEC, NOV},					/* 119 */
3460Sstevel@tonic-gate {"fchdir",	1, DEC, NOV, DEC},				/* 120 */
3470Sstevel@tonic-gate {"readv",	3, DEC, NOV, DEC, HEX, DEC},			/* 121 */
3480Sstevel@tonic-gate {"writev",	3, DEC, NOV, DEC, HEX, DEC},			/* 122 */
3490Sstevel@tonic-gate {"xstat",	3, DEC, NOV, DEC, STG, HEX},			/* 123 */
3500Sstevel@tonic-gate {"lxstat",	3, DEC, NOV, DEC, STG, HEX},			/* 124 */
3510Sstevel@tonic-gate {"fxstat",	3, DEC, NOV, DEC, DEC, HEX},			/* 125 */
3520Sstevel@tonic-gate {"xmknod",	4, DEC, NOV, DEC, STG, OCT, HEX},		/* 126 */
3530Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3540Sstevel@tonic-gate {"setrlimit",	2, DEC, NOV, RLM, HEX},				/* 128 */
3550Sstevel@tonic-gate {"getrlimit",	2, DEC, NOV, RLM, HEX},				/* 129 */
3560Sstevel@tonic-gate {"lchown",	3, DEC, NOV, STG, DEC, DEC},			/* 130 */
3570Sstevel@tonic-gate {"memcntl",	6, DEC, NOV, HEX, UNS, MCF, MC4, MC5, DEC},	/* 131 */
3580Sstevel@tonic-gate {"getpmsg",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 132 */
3590Sstevel@tonic-gate {"putpmsg",	5, DEC, NOV, DEC, HEX, HEX, DEC, HHX},		/* 133 */
3600Sstevel@tonic-gate {"rename",	2, DEC, NOV, STG, STG},				/* 134 */
3610Sstevel@tonic-gate {"uname",	1, DEC, NOV, HEX},				/* 135 */
3620Sstevel@tonic-gate {"setegid",	1, DEC, NOV, DEC},				/* 136 */
3630Sstevel@tonic-gate {"sysconfig",	1, DEC, NOV, CNF},				/* 137 */
3640Sstevel@tonic-gate {"adjtime",	2, DEC, NOV, HEX, HEX},				/* 138 */
3650Sstevel@tonic-gate {"sysinfo",	3, DEC, NOV, INF, RST, DEC},			/* 139 */
3660Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3670Sstevel@tonic-gate {"seteuid",	1, DEC, NOV, DEC},				/* 141 */
3683235Sraf {"forksys",	2, DEC, NOV, DEC, HHX},				/* 142 */
3690Sstevel@tonic-gate {"fork1",	0, DEC, NOV},					/* 143 */
3700Sstevel@tonic-gate {"sigtimedwait", 3, DEC, NOV, HEX, HEX, HEX},			/* 144 */
3710Sstevel@tonic-gate {"lwp_info",	1, DEC, NOV, HEX},				/* 145 */
3720Sstevel@tonic-gate {"yield",	0, DEC, NOV},					/* 146 */
3730Sstevel@tonic-gate {"lwp_sema_wait", 1, DEC, NOV, HEX},				/* 147 */
3740Sstevel@tonic-gate {"lwp_sema_post", 1, DEC, NOV, HEX},				/* 148 */
3750Sstevel@tonic-gate {"lwp_sema_trywait", 1, DEC, NOV, HEX},				/* 149 */
3760Sstevel@tonic-gate {"lwp_detach",	1, DEC, NOV, DEC},				/* 150 */
3770Sstevel@tonic-gate {"corectl",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/* 151 */
3780Sstevel@tonic-gate {"modctl",	5, DEC, NOV, MOD, HEX, HEX, HEX, HEX},		/* 152 */
3790Sstevel@tonic-gate {"fchroot",	1, DEC, NOV, DEC},				/* 153 */
3800Sstevel@tonic-gate {"utimes",	2, DEC, NOV, STG, HEX},				/* 154 */
3810Sstevel@tonic-gate {"vhangup",	0, DEC, NOV},					/* 155 */
3820Sstevel@tonic-gate {"gettimeofday", 1, DEC, NOV, HEX},				/* 156 */
3830Sstevel@tonic-gate {"getitimer",	2, DEC, NOV, ITM, HEX},				/* 157 */
3840Sstevel@tonic-gate {"setitimer",	3, DEC, NOV, ITM, HEX, HEX},			/* 158 */
3850Sstevel@tonic-gate {"lwp_create",	3, DEC, NOV, HEX, LWF, HEX},			/* 159 */
3860Sstevel@tonic-gate {"lwp_exit",	0, DEC, NOV},					/* 160 */
3870Sstevel@tonic-gate {"lwp_suspend",	1, DEC, NOV, DEC},				/* 161 */
3880Sstevel@tonic-gate {"lwp_continue", 1, DEC, NOV, DEC},				/* 162 */
3890Sstevel@tonic-gate {"lwp_kill",	2, DEC, NOV, DEC, SIG},				/* 163 */
3900Sstevel@tonic-gate {"lwp_self",	0, DEC, NOV},					/* 164 */
3910Sstevel@tonic-gate {"lwp_sigmask",	3, HEX, HEX, SPM, HEX, HEX},			/* 165 */
3920Sstevel@tonic-gate {"lwp_private",	3, HEX, NOV, DEC, DEC, HEX},			/* 166 */
3930Sstevel@tonic-gate {"lwp_wait",	2, DEC, NOV, DEC, HEX},				/* 167 */
3940Sstevel@tonic-gate {"lwp_mutex_wakeup", 1, DEC, NOV, HEX},				/* 168 */
3950Sstevel@tonic-gate {"lwp_mutex_lock", 1, DEC, NOV, HEX},				/* 169 */
3960Sstevel@tonic-gate {"lwp_cond_wait", 4, DEC, NOV, HEX, HEX, HEX, DEC},		/* 170 */
3970Sstevel@tonic-gate {"lwp_cond_signal", 1, DEC, NOV, HEX},				/* 171 */
3980Sstevel@tonic-gate {"lwp_cond_broadcast", 1, DEC, NOV, HEX},			/* 172 */
3990Sstevel@tonic-gate {"pread",	4, DEC, NOV, DEC, IOB, UNS, DEX},		/* 173 */
4000Sstevel@tonic-gate {"pwrite",	4, DEC, NOV, DEC, IOB, UNS, DEX},		/* 174 */
4010Sstevel@tonic-gate {"llseek",	4, LLO, NOV, DEC, LLO, HID, WHN},		/* 175 */
4020Sstevel@tonic-gate {"inst_sync",	2, DEC, NOV, STG, DEC},				/* 176 */
4032712Snn35248 {"brand",	6, DEC, NOV, DEC, HEX, HEX, HEX, HEX, HEX},	/* 177 */
4040Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, HEX, HEX, HEX, HEX, HEX, HEX}, /* 178 */
4050Sstevel@tonic-gate {"cpc",		5, DEC, NOV, CPC, DEC, HEX, HEX, HEX},		/* 179 */
4060Sstevel@tonic-gate {"lgrpsys",	3, DEC, NOV, DEC, DEC, HEX},			/* 180 */
407*3247Sgjelinek {"rusagesys",	5, DEC, NOV, DEC, HEX, DEC, HEX, HEX},		/* 181 */
4080Sstevel@tonic-gate {"portfs",	6, HEX, HEX, DEC, HEX, HEX, HEX, HEX, HEX},	/* 182 */
4090Sstevel@tonic-gate {"pollsys",	4, DEC, NOV, HEX, DEC, HEX, HEX},		/* 183 */
4101676Sjpk {"labelsys",	2, DEC, NOV, DEC, HEX},				/* 184 */
4110Sstevel@tonic-gate {"acl",		4, DEC, NOV, STG, ACL, DEC, HEX},		/* 185 */
4120Sstevel@tonic-gate {"auditsys",	4, DEC, NOV, AUD, HEX, HEX, HEX},		/* 186 */
4130Sstevel@tonic-gate {"processor_bind", 4, DEC, NOV, IDT, DEC, DEC, HEX},		/* 187 */
4140Sstevel@tonic-gate {"processor_info", 2, DEC, NOV, DEC, HEX},			/* 188 */
4150Sstevel@tonic-gate {"p_online",	2, DEC, NOV, DEC, DEC},				/* 189 */
4162248Sraf {"sigqueue",	5, DEC, NOV, DEC, SIG, HEX, SQC, DEC},		/* 190 */
4170Sstevel@tonic-gate {"clock_gettime", 2, DEC, NOV, DEC, HEX},			/* 191 */
4180Sstevel@tonic-gate {"clock_settime", 2, DEC, NOV, DEC, HEX},			/* 192 */
4190Sstevel@tonic-gate {"clock_getres", 2, DEC, NOV, DEC, HEX},			/* 193 */
4200Sstevel@tonic-gate {"timer_create", 3, DEC, NOV, DEC, HEX, HEX},			/* 194 */
4210Sstevel@tonic-gate {"timer_delete", 1, DEC, NOV, DEC},				/* 195 */
4220Sstevel@tonic-gate {"timer_settime", 4, DEC, NOV, DEC, DEC, HEX, HEX},		/* 196 */
4230Sstevel@tonic-gate {"timer_gettime", 2, DEC, NOV, DEC, HEX},			/* 197 */
4240Sstevel@tonic-gate {"timer_getoverrun", 1, DEC, NOV, DEC},				/* 198 */
4250Sstevel@tonic-gate {"nanosleep",	2, DEC, NOV, HEX, HEX},				/* 199 */
4260Sstevel@tonic-gate {"facl",	4, DEC, NOV, DEC, ACL, DEC, HEX},		/* 200 */
4270Sstevel@tonic-gate {"door",	6, DEC, NOV, DEC, HEX, HEX, HEX, HEX, DEC},	/* 201 */
4280Sstevel@tonic-gate {"setreuid",	2, DEC, NOV, DEC, DEC},				/* 202 */
4290Sstevel@tonic-gate {"setregid",	2, DEC, NOV, DEC, DEC},				/* 203 */
4300Sstevel@tonic-gate {"install_utrap", 3, DEC, NOV, DEC, HEX, HEX},			/* 204 */
4310Sstevel@tonic-gate {"signotify",	3, DEC, NOV, DEC, HEX, HEX},			/* 205 */
4320Sstevel@tonic-gate {"schedctl",	0, HEX, NOV},					/* 206 */
4330Sstevel@tonic-gate {"pset",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 207 */
4340Sstevel@tonic-gate {"sparc_utrap_install", 5, DEC, NOV, UTT, UTH, UTH, HEX, HEX},	/* 208 */
4350Sstevel@tonic-gate {"resolvepath",	3, DEC, NOV, STG, RLK, DEC},			/* 209 */
4360Sstevel@tonic-gate {"lwp_mutex_timedlock", 2, DEC, NOV, HEX, HEX},			/* 210 */
4370Sstevel@tonic-gate {"lwp_sema_timedwait", 3, DEC, NOV, HEX, HEX, DEC},		/* 211 */
4380Sstevel@tonic-gate {"lwp_rwlock_sys", 3, DEC, NOV, DEC, HEX, HEX},			/* 212 */
4390Sstevel@tonic-gate {"getdents64",	3, DEC, NOV, DEC, HEX, UNS},			/* 213 */
4400Sstevel@tonic-gate {"mmap64",	7, HEX, NOV, HEX, UNS, MPR, MTY, DEC, LLO, HID}, /* 214 */
4410Sstevel@tonic-gate {"stat64",	2, DEC, NOV, STG, HEX},				/* 215 */
4420Sstevel@tonic-gate {"lstat64",	2, DEC, NOV, STG, HEX},				/* 216 */
4430Sstevel@tonic-gate {"fstat64",	2, DEC, NOV, DEC, HEX},				/* 217 */
4440Sstevel@tonic-gate {"statvfs64",	2, DEC, NOV, STG, HEX},				/* 218 */
4450Sstevel@tonic-gate {"fstatvfs64",	2, DEC, NOV, DEC, HEX},				/* 219 */
4460Sstevel@tonic-gate {"setrlimit64",	2, DEC, NOV, RLM, HEX},				/* 220 */
4470Sstevel@tonic-gate {"getrlimit64",	2, DEC, NOV, RLM, HEX},				/* 221 */
4480Sstevel@tonic-gate {"pread64",	5, DEC, NOV, DEC, IOB, UNS, LLO, HID},		/* 222 */
4490Sstevel@tonic-gate {"pwrite64",	5, DEC, NOV, DEC, IOB, UNS, LLO, HID},		/* 223 */
4500Sstevel@tonic-gate {"creat64",	2, DEC, NOV, STG, OCT},				/* 224 */
4510Sstevel@tonic-gate {"open64",	3, DEC, NOV, STG, OPN, OCT},			/* 225 */
4520Sstevel@tonic-gate {"rpcmod",	3, DEC, NOV, DEC, HEX},				/* 226 */
4530Sstevel@tonic-gate {"zone",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 227 */
4540Sstevel@tonic-gate {"autofssys",	2, DEC, NOV, DEC, HEX},				/* 228 */
4550Sstevel@tonic-gate {"getcwd",	3, DEC, NOV, RST, DEC},				/* 229 */
4560Sstevel@tonic-gate {"so_socket",	5, DEC, NOV, PFM, SKT, SKP, STG, SKV},		/* 230 */
4570Sstevel@tonic-gate {"so_socketpair", 1, DEC, NOV, HEX},				/* 231 */
4580Sstevel@tonic-gate {"bind",	4, DEC, NOV, DEC, HEX, DEC, SKV},		/* 232 */
4590Sstevel@tonic-gate {"listen",	3, DEC, NOV, DEC, DEC, SKV},			/* 233 */
4600Sstevel@tonic-gate {"accept",	4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 234 */
4610Sstevel@tonic-gate {"connect",	4, DEC, NOV, DEC, HEX, DEC, SKV},		/* 235 */
4620Sstevel@tonic-gate {"shutdown",	3, DEC, NOV, DEC, SHT, SKV},			/* 236 */
4630Sstevel@tonic-gate {"recv",	4, DEC, NOV, DEC, IOB, DEC, DEC},		/* 237 */
4640Sstevel@tonic-gate {"recvfrom",	6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, HEX},	/* 238 */
4650Sstevel@tonic-gate {"recvmsg",	3, DEC, NOV, DEC, HEX, DEC},			/* 239 */
4660Sstevel@tonic-gate {"send",	4, DEC, NOV, DEC, IOB, DEC, DEC},		/* 240 */
4670Sstevel@tonic-gate {"sendmsg",	3, DEC, NOV, DEC, HEX, DEC},			/* 241 */
4680Sstevel@tonic-gate {"sendto",	6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, DEC},	/* 242 */
4690Sstevel@tonic-gate {"getpeername", 4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 243 */
4700Sstevel@tonic-gate {"getsockname", 4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 244 */
4710Sstevel@tonic-gate {"getsockopt",	6, DEC, NOV, DEC, SOL, SON, HEX, HEX, SKV},	/* 245 */
4720Sstevel@tonic-gate {"setsockopt",	6, DEC, NOV, DEC, SOL, SON, HEX, DEC, SKV},	/* 246 */
4730Sstevel@tonic-gate {"sockconfig",	4, DEC, NOV, DEC, DEC, DEC, STG},		/* 247 */
4740Sstevel@tonic-gate {"ntp_gettime",	1, DEC, NOV, HEX},				/* 248 */
4750Sstevel@tonic-gate {"ntp_adjtime",	1, DEC, NOV, HEX},				/* 249 */
4760Sstevel@tonic-gate {"lwp_mutex_unlock", 1, DEC, NOV, HEX},				/* 250 */
4770Sstevel@tonic-gate {"lwp_mutex_trylock", 1, DEC, NOV, HEX},			/* 251 */
4780Sstevel@tonic-gate {"lwp_mutex_init", 2, DEC, NOV, HEX, HEX},			/* 252 */
4790Sstevel@tonic-gate {"cladm",	3, DEC, NOV, CLC, CLF, HEX},			/* 253 */
4802712Snn35248 {"uucopy",	3, DEC, NOV, HEX, HEX, UNS},			/* 254 */
4810Sstevel@tonic-gate {"umount2",	2, DEC, NOV, STG, MTF},				/* 255 */
4820Sstevel@tonic-gate { NULL, -1, DEC, NOV},
4830Sstevel@tonic-gate };
4840Sstevel@tonic-gate 
4850Sstevel@tonic-gate /* SYSEND == max syscall number + 1 */
4860Sstevel@tonic-gate #define	SYSEND	((sizeof (systable) / sizeof (struct systable))-1)
4870Sstevel@tonic-gate 
4880Sstevel@tonic-gate 
4890Sstevel@tonic-gate /*
4900Sstevel@tonic-gate  * The following are for interpreting syscalls with sub-codes.
4910Sstevel@tonic-gate  */
4920Sstevel@tonic-gate 
4930Sstevel@tonic-gate const	struct systable opentable[] = {
4940Sstevel@tonic-gate {"open",	2, DEC, NOV, STG, OPN},				/* 0 */
4950Sstevel@tonic-gate {"open",	3, DEC, NOV, STG, OPN, OCT},			/* 1 */
4960Sstevel@tonic-gate };
4970Sstevel@tonic-gate #define	NOPENCODE	(sizeof (opentable) / sizeof (struct systable))
4980Sstevel@tonic-gate 
4990Sstevel@tonic-gate const	struct systable open64table[] = {
5000Sstevel@tonic-gate {"open64",	2, DEC, NOV, STG, OPN},				/* 0 */
5010Sstevel@tonic-gate {"open64",	3, DEC, NOV, STG, OPN, OCT},			/* 1 */
5020Sstevel@tonic-gate };
5030Sstevel@tonic-gate #define	NOPEN64CODE	(sizeof (open64table) / sizeof (struct systable))
5040Sstevel@tonic-gate 
5050Sstevel@tonic-gate const	struct systable fcntltable[] = {
5060Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, HEX},			/* 0: default */
5070Sstevel@tonic-gate {"fcntl",	2, DEC, NOV, DEC, FCN},				/* 1: no arg */
5080Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, FFG},			/* 2: F_SETFL */
5090Sstevel@tonic-gate };
5100Sstevel@tonic-gate #define	NFCNTLCODE	(sizeof (fcntltable) / sizeof (struct systable))
5110Sstevel@tonic-gate 
5120Sstevel@tonic-gate const	struct systable sigtable[] = {
5130Sstevel@tonic-gate {"signal",	2, HEX, NOV, SIG, ACT},				/* 0 */
5140Sstevel@tonic-gate {"sigset",	2, HEX, NOV, SIX, ACT},				/* 1 */
5150Sstevel@tonic-gate {"sighold",	1, HEX, NOV, SIX},				/* 2 */
5160Sstevel@tonic-gate {"sigrelse",	1, HEX, NOV, SIX},				/* 3 */
5170Sstevel@tonic-gate {"sigignore",	1, HEX, NOV, SIX},				/* 4 */
5180Sstevel@tonic-gate {"sigpause",	1, HEX, NOV, SIX},				/* 5 */
5190Sstevel@tonic-gate };
5200Sstevel@tonic-gate #define	NSIGCODE	(sizeof (sigtable) / sizeof (struct systable))
5210Sstevel@tonic-gate 
5220Sstevel@tonic-gate const	struct systable msgtable[] = {
5230Sstevel@tonic-gate {"msgget",	3, DEC, NOV, HID, KEY, MSF},			/* 0 */
5240Sstevel@tonic-gate {"msgctl",	4, DEC, NOV, HID, DEC, MSC, HEX},		/* 1 */
5250Sstevel@tonic-gate {"msgrcv",	6, DEC, NOV, HID, DEC, HEX, UNS, DEC, MSF},	/* 2 */
5260Sstevel@tonic-gate {"msgsnd",	5, DEC, NOV, HID, DEC, HEX, UNS, MSF},		/* 3 */
5270Sstevel@tonic-gate {"msgids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 4 */
5280Sstevel@tonic-gate {"msgsnap",	5, DEC, NOV, HID, DEC, HEX, UNS, DEC},		/* 5 */
5290Sstevel@tonic-gate };
5300Sstevel@tonic-gate #define	NMSGCODE	(sizeof (msgtable) / sizeof (struct systable))
5310Sstevel@tonic-gate 
5320Sstevel@tonic-gate const	struct systable semtable[] = {
5330Sstevel@tonic-gate {"semctl",	5, DEC, NOV, HID, DEC, DEC, SMC, DEX},		/* 0 */
5340Sstevel@tonic-gate {"semget",	4, DEC, NOV, HID, KEY, DEC, SEF},		/* 1 */
5350Sstevel@tonic-gate {"semop",	4, DEC, NOV, HID, DEC, HEX, UNS},		/* 2 */
5360Sstevel@tonic-gate {"semids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 3 */
5370Sstevel@tonic-gate {"semtimedop",	5, DEC, NOV, HID, DEC, HEX, UNS, HEX},		/* 4 */
5380Sstevel@tonic-gate };
5390Sstevel@tonic-gate #define	NSEMCODE	(sizeof (semtable) / sizeof (struct systable))
5400Sstevel@tonic-gate 
5410Sstevel@tonic-gate const	struct systable shmtable[] = {
5420Sstevel@tonic-gate {"shmat",	4, HEX, NOV, HID, DEC, DEX, SHF},		/* 0 */
5430Sstevel@tonic-gate {"shmctl",	4, DEC, NOV, HID, DEC, SHC, DEX},		/* 1 */
5440Sstevel@tonic-gate {"shmdt",	2, DEC, NOV, HID, HEX},				/* 2 */
5450Sstevel@tonic-gate {"shmget",	4, DEC, NOV, HID, KEY, UNS, SHF},		/* 3 */
5460Sstevel@tonic-gate {"shmids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 4 */
5470Sstevel@tonic-gate };
5480Sstevel@tonic-gate #define	NSHMCODE	(sizeof (shmtable) / sizeof (struct systable))
5490Sstevel@tonic-gate 
5500Sstevel@tonic-gate const	struct systable pidtable[] = {
5510Sstevel@tonic-gate {"getpgrp",	1, DEC, NOV, HID},				/* 0 */
5520Sstevel@tonic-gate {"setpgrp",	1, DEC, NOV, HID},				/* 1 */
5530Sstevel@tonic-gate {"getsid",	2, DEC, NOV, HID, DEC},				/* 2 */
5540Sstevel@tonic-gate {"setsid",	1, DEC, NOV, HID},				/* 3 */
5550Sstevel@tonic-gate {"getpgid",	2, DEC, NOV, HID, DEC},				/* 4 */
5560Sstevel@tonic-gate {"setpgid",	3, DEC, NOV, HID, DEC, DEC},			/* 5 */
5570Sstevel@tonic-gate };
5580Sstevel@tonic-gate #define	NPIDCODE	(sizeof (pidtable) / sizeof (struct systable))
5590Sstevel@tonic-gate 
5600Sstevel@tonic-gate const	struct systable sfstable[] = {
5610Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEX, DEX},			/* 0 */
5620Sstevel@tonic-gate {"sysfs",	2, DEC, NOV, SFS, STG},				/* 1 */
5630Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEC, RST},			/* 2 */
5640Sstevel@tonic-gate {"sysfs",	1, DEC, NOV, SFS},				/* 3 */
5650Sstevel@tonic-gate };
5660Sstevel@tonic-gate #define	NSFSCODE	(sizeof (sfstable) / sizeof (struct systable))
5670Sstevel@tonic-gate 
5680Sstevel@tonic-gate const	struct systable utstable[] = {
5690Sstevel@tonic-gate {"utssys",	3, DEC, NOV, HEX, DEC, UTS},			/* 0 */
5700Sstevel@tonic-gate {"utssys",	4, DEC, NOV, HEX, HEX, HEX, HEX},		/* err */
5710Sstevel@tonic-gate {"utssys",	3, DEC, NOV, HEX, HHX, UTS},			/* 2 */
5720Sstevel@tonic-gate {"utssys",	4, DEC, NOV, STG, FUI, UTS, HEX}		/* 3 */
5730Sstevel@tonic-gate };
5740Sstevel@tonic-gate #define	NUTSCODE	(sizeof (utstable) / sizeof (struct systable))
5750Sstevel@tonic-gate 
5762447Snf202958 const	struct systable rctltable[] = {
5772447Snf202958 {"getrctl",	6, DEC, NOV, HID, STG, HEX, HEX, HID, RGF},	/* 0 */
5782447Snf202958 {"setrctl",	6, DEC, NOV, HID, STG, HEX, HEX, HID, RSF},	/* 1 */
5792447Snf202958 {"rctlsys_lst",	6, DEC, NOV, HID, HID, HEX, HID, HEX, HID},	/* 2 */
5802447Snf202958 {"rctlsys_ctl",	6, DEC, NOV, HID, STG, HEX, HID, HID, RCF},	/* 3 */
5812447Snf202958 };
5822447Snf202958 #define	NRCTLCODE	(sizeof (rctltable) / sizeof (struct systable))
5832447Snf202958 
5840Sstevel@tonic-gate const	struct systable sgptable[] = {
5850Sstevel@tonic-gate {"sigpendsys",	2, DEC, NOV, DEC, HEX},				/* err */
5860Sstevel@tonic-gate {"sigpending",	2, DEC, NOV, HID, HEX},				/* 1 */
5870Sstevel@tonic-gate {"sigfillset",	2, DEC, NOV, HID, HEX},				/* 2 */
5880Sstevel@tonic-gate };
5890Sstevel@tonic-gate #define	NSGPCODE	(sizeof (sgptable) / sizeof (struct systable))
5900Sstevel@tonic-gate 
5910Sstevel@tonic-gate const	struct systable ctxtable[] = {
5920Sstevel@tonic-gate {"getcontext",	2, DEC, NOV, HID, HEX},				/* 0 */
5930Sstevel@tonic-gate {"setcontext",	2, DEC, NOV, HID, HEX},				/* 1 */
5940Sstevel@tonic-gate {"getustack",	2, DEC, NOV, HID, HEX},				/* 2 */
5950Sstevel@tonic-gate {"setustack",	2, DEC, NOV, HID, HEX},				/* 3 */
5960Sstevel@tonic-gate };
5970Sstevel@tonic-gate #define	NCTXCODE	(sizeof (ctxtable) / sizeof (struct systable))
5980Sstevel@tonic-gate 
5990Sstevel@tonic-gate const	struct systable hrttable[] = {
6000Sstevel@tonic-gate {"hrtcntl",	5, DEC, NOV, HID, DEC, DEC, HEX, HEX},		/* 0 */
6010Sstevel@tonic-gate {"hrtalarm",	3, DEC, NOV, HID, HEX, DEC},			/* 1 */
6020Sstevel@tonic-gate {"hrtsleep",	2, DEC, NOV, HID, HEX},				/* 2 */
6030Sstevel@tonic-gate {"hrtcancel",	3, DEC, NOV, HID, HEX, DEC},			/* 3 */
6040Sstevel@tonic-gate };
6050Sstevel@tonic-gate #define	NHRTCODE	(sizeof (hrttable) / sizeof (struct systable))
6060Sstevel@tonic-gate 
6070Sstevel@tonic-gate const	struct systable cortable[] = {
6080Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, HEX, HEX, HEX},		/* 0 */
6090Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCO},				/* 1 */
6100Sstevel@tonic-gate {"corectl",	1, HHX, NOV, COR},				/* 2 */
6110Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, STG, DEC},			/* 3 */
6120Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RST, DEC},			/* 4 */
6130Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, STG, DEC, DEC},		/* 5 */
6140Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, RST, DEC, DEC},		/* 6 */
6150Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCC},				/* 7 */
6160Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, RCC},				/* 8 */
6170Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, CCC, DEC},			/* 9 */
6180Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RCC, DEC},			/* 10 */
6190Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, STG, DEC},			/* 11 */
6200Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RST, DEC},			/* 12 */
6210Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCC},				/* 13 */
6220Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, RCC},				/* 14 */
6230Sstevel@tonic-gate };
6240Sstevel@tonic-gate #define	NCORCODE	(sizeof (cortable) / sizeof (struct systable))
6250Sstevel@tonic-gate 
6260Sstevel@tonic-gate const	struct systable aiotable[] = {
6270Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 0 */
6280Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 1 */
6290Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, HEX, DEC},			/* 2 */
6300Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, DEC, HEX},			/* 3 */
6310Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 4 */
6320Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 5 */
6330Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 6 */
6340Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 7 */
6350Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, DEC},		/* 8 */
6360Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 9 */
6370Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 10 */
6380Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 11 */
6390Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 12 */
6400Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 13 */
6410Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, DEC},		/* 14 */
6420Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 15 */
6430Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 16 */
6440Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 17 */
6450Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 18 */
6460Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, DEC, HEX},			/* 19 */
6470Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 20 */
6480Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, HEX},		/* 21 */
6490Sstevel@tonic-gate };
6500Sstevel@tonic-gate #define	NAIOCODE	(sizeof (aiotable) / sizeof (struct systable))
6510Sstevel@tonic-gate 
6520Sstevel@tonic-gate const	struct systable doortable[] = {
6530Sstevel@tonic-gate {"door_create", 3, DEC, NOV, HEX, HEX, DFL},			/* 0 */
6540Sstevel@tonic-gate {"door_revoke", 1, DEC, NOV, DEC},				/* 1 */
6550Sstevel@tonic-gate {"door_info",	2, DEC, NOV, DEC, HEX},				/* 2 */
6560Sstevel@tonic-gate {"door_call",	2, DEC, NOV, DEC, HEX},				/* 3 */
6570Sstevel@tonic-gate {"door_return", 4, DEC, NOV, HEX, DEC, HEX, DEC},		/* 4 (old) */
6580Sstevel@tonic-gate {"door_cred",	1, DEC, NOV, HEX},				/* 5 (old) */
6590Sstevel@tonic-gate {"door_bind",	1, DEC, NOV, DEC},				/* 6 */
6600Sstevel@tonic-gate {"door_unbind", 0, DEC, NOV},					/* 7 */
6610Sstevel@tonic-gate {"door_unref",	0, DEC, NOV},					/* 8 */
6620Sstevel@tonic-gate {"door_ucred",	1, DEC, NOV, HEX},				/* 9 */
6630Sstevel@tonic-gate {"door_return", 5, DEC, NOV, HEX, DEC, HEX, HEX, DEC},		/* 10 */
6640Sstevel@tonic-gate {"door_getparam", 3, DEC, NOV, DEC, DPM, HEX},			/* 11 */
6650Sstevel@tonic-gate {"door_setparam", 3, DEC, NOV, DEC, DPM, DEC},			/* 12 */
6660Sstevel@tonic-gate };
6670Sstevel@tonic-gate #define	NDOORCODE	(sizeof (doortable) / sizeof (struct systable))
6680Sstevel@tonic-gate 
6690Sstevel@tonic-gate const	struct systable psettable[] = {
6700Sstevel@tonic-gate {"pset_create", 2, DEC, NOV, HID, HEX},				/* 0 */
6710Sstevel@tonic-gate {"pset_destroy", 2, DEC, NOV, HID, PST},			/* 1 */
6720Sstevel@tonic-gate {"pset_assign",	4, DEC, NOV, HID, PST, DEC, HEX},		/* 2 */
6730Sstevel@tonic-gate {"pset_info",	5, DEC, NOV, HID, PST, HEX, HEX, HEX},		/* 3 */
6740Sstevel@tonic-gate {"pset_bind",	5, DEC, NOV, HID, PST, IDT, DEC, HEX},		/* 4 */
6750Sstevel@tonic-gate {"pset_getloadavg", 4, DEC, NOV, HID, PST, HEX, DEC},		/* 5 */
6760Sstevel@tonic-gate {"pset_list",	3, DEC, NOV, HID, HEX, HEX},			/* 6 */
6770Sstevel@tonic-gate {"pset_setattr", 3, DEC, NOV, HID, PST, HEX},			/* 7 */
6780Sstevel@tonic-gate {"pset_getattr", 3, DEC, NOV, HID, PST, HEX},			/* 8 */
6790Sstevel@tonic-gate {"pset_assign_forced",	4, DEC, NOV, HID, PST, DEC, HEX},	/* 9 */
6800Sstevel@tonic-gate };
6810Sstevel@tonic-gate #define	NPSETCODE	(sizeof (psettable) / sizeof (struct systable))
6820Sstevel@tonic-gate 
6830Sstevel@tonic-gate const	struct systable lwpcreatetable[] = {
6840Sstevel@tonic-gate {"lwp_create",	3, DEC, NOV, HEX, LWF, HEX},			/* 0 */
6850Sstevel@tonic-gate {"lwp_create",	0, DEC, NOV},					/* 1 */
6860Sstevel@tonic-gate };
6870Sstevel@tonic-gate #define	NLWPCREATECODE	(sizeof (lwpcreatetable) / sizeof (struct systable))
6880Sstevel@tonic-gate 
6890Sstevel@tonic-gate static	const	struct systable tasksystable[] = {
6900Sstevel@tonic-gate {"settaskid",	3, DEC, NOV, HID, DEC, HEX},			/* 0 */
6910Sstevel@tonic-gate {"gettaskid",	1, DEC, NOV, HID},				/* 1 */
6920Sstevel@tonic-gate {"getprojid",	1, DEC, NOV, HID},				/* 2 */
6930Sstevel@tonic-gate };
6940Sstevel@tonic-gate #define	NTASKSYSCODE	(sizeof (tasksystable) / sizeof (struct systable))
6950Sstevel@tonic-gate 
6960Sstevel@tonic-gate static const	struct systable privsystable[] = {
6970Sstevel@tonic-gate {"setppriv",		4, DEC, NOV, HID, PRO, PRN, PRS},	/* 0 */
6980Sstevel@tonic-gate {"getppriv",		4, DEC, NOV, HID, HID, PRN, PRS},	/* 1 */
6990Sstevel@tonic-gate {"getprivimplinfo",	5, DEC, NOV, HID, HID, HID, HEX, DEC},	/* 2 */
7000Sstevel@tonic-gate {"setpflags",		3, DEC, NOV, HID, PFL, DEC},		/* 3 */
7010Sstevel@tonic-gate {"getpflags",		2, DEC, NOV, HID, PFL},			/* 4 */
7020Sstevel@tonic-gate };
7030Sstevel@tonic-gate #define	NPRIVSYSCODE	(sizeof (privsystable) / sizeof (struct systable))
7040Sstevel@tonic-gate 
7050Sstevel@tonic-gate static	const	struct systable exacctsystable[] = {
7060Sstevel@tonic-gate {"getacct",	5, DEC, NOV, HID, IDT, DEC, HEX, UNS},		/* 0 */
7070Sstevel@tonic-gate {"putacct",	6, DEC, NOV, HID, IDT, DEC, HEX, UNS, HEX},	/* 1 */
7080Sstevel@tonic-gate {"wracct",	4, DEC, NOV, HID, IDT, DEC, HEX},		/* 2 */
7090Sstevel@tonic-gate };
7100Sstevel@tonic-gate #define	NEXACCTSYSCODE	(sizeof (exacctsystable) / sizeof (struct systable))
7110Sstevel@tonic-gate 
7120Sstevel@tonic-gate static const	struct systable fsatsystable[] = {
7130Sstevel@tonic-gate {"openat",	5, DEC, NOV, HID, ATC, STG, OPN, OCT},		/* 0 */
7140Sstevel@tonic-gate {"openat64",	5, DEC, NOV, HID, ATC, STG, OPN, OCT},		/* 1 */
7150Sstevel@tonic-gate {"fstatat64",	5, DEC, NOV, HID, ATC, STG, HEX, HEX},		/* 2 */
7160Sstevel@tonic-gate {"fstatat",	5, DEC, NOV, HID, ATC, STG, HEX, HEX},		/* 3 */
7170Sstevel@tonic-gate {"fchownat",	6, DEC, NOV, HID, ATC, STG, HEX, HEX, HEX},	/* 4 */
7180Sstevel@tonic-gate {"unlinkat",	4, DEC, NOV, HID, ATC, STG, HEX},		/* 5 */
7190Sstevel@tonic-gate {"futimesat",	4, DEC, NOV, HID, ATC, STG, HEX},		/* 6 */
7200Sstevel@tonic-gate {"renameat",	5, DEC, NOV, HID, ATC, STG, DEC, STG},		/* 7 */
7210Sstevel@tonic-gate {"openat",	4, DEC, NOV, HID, ATC, STG, OPN},		/* 8 */
7220Sstevel@tonic-gate {"openat64",	4, DEC, NOV, HID, ATC, STG, OPN},		/* 9 */
7230Sstevel@tonic-gate };
7240Sstevel@tonic-gate #define	NFSATSYSCODE	(sizeof (fsatsystable) / sizeof (struct systable))
7250Sstevel@tonic-gate 
7260Sstevel@tonic-gate static	const	struct systable lwpparktable[] = {
7270Sstevel@tonic-gate {"lwp_park",	3, DEC, NOV, HID, HEX, DEC},			/* 0 */
7280Sstevel@tonic-gate {"lwp_unpark",	2, DEC, NOV, HID, DEC},				/* 1 */
7290Sstevel@tonic-gate {"lwp_unpark_all", 3, DEC, NOV, HID, HEX, DEC},			/* 2 */
7300Sstevel@tonic-gate };
7310Sstevel@tonic-gate #define	NLWPPARKCODE	(sizeof (lwpparktable) / sizeof (struct systable))
7320Sstevel@tonic-gate 
7330Sstevel@tonic-gate static	const	struct systable lwprwlocktable[] = {
7340Sstevel@tonic-gate {"lwp_rwlock_rdlock", 3, DEC, NOV, HID, HEX, HEX},		/* 0 */
7350Sstevel@tonic-gate {"lwp_rwlock_wrlock", 3, DEC, NOV, HID, HEX, HEX},		/* 1 */
7360Sstevel@tonic-gate {"lwp_rwlock_tryrdlock", 2, DEC, NOV, HID, HEX},		/* 2 */
7370Sstevel@tonic-gate {"lwp_rwlock_trywrlock", 2, DEC, NOV, HID, HEX},		/* 3 */
7380Sstevel@tonic-gate {"lwp_rwlock_unlock", 2, DEC, NOV, HID, HEX},			/* 4 */
7390Sstevel@tonic-gate };
7400Sstevel@tonic-gate #define	NLWPRWLOCKCODE	(sizeof (lwprwlocktable) / sizeof (struct systable))
7410Sstevel@tonic-gate 
7420Sstevel@tonic-gate static	const	struct systable sendfilevsystable[] = {
7430Sstevel@tonic-gate {"sendfilev",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/* 0 */
7440Sstevel@tonic-gate {"sendfilev64",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/* 1 */
7450Sstevel@tonic-gate };
7460Sstevel@tonic-gate #define	NSENDFILESYSCODE \
7470Sstevel@tonic-gate 		(sizeof (sendfilevsystable) / sizeof (struct systable))
7480Sstevel@tonic-gate 
7490Sstevel@tonic-gate static	const	struct systable lgrpsystable[] = {
7500Sstevel@tonic-gate {"meminfo",		3, DEC, NOV, HID, NOV, MIF},		/* 0 */
7510Sstevel@tonic-gate {"_lgrpsys",		3, DEC, NOV, DEC, DEC, NOV},		/* 1 */
7520Sstevel@tonic-gate {"lgrp_version",	3, DEC, NOV, HID, DEC, NOV},		/* 2 */
7530Sstevel@tonic-gate {"_lgrpsys",		3, DEC, NOV, DEC, HEX, HEX},		/* 3 */
7540Sstevel@tonic-gate {"lgrp_affinity_get",	3, DEC, NOV, HID, NOV, LAF},		/* 4 */
7550Sstevel@tonic-gate {"lgrp_affinity_set",	3, DEC, NOV, HID, NOV, LAF},		/* 5 */
7560Sstevel@tonic-gate {"lgrp_latency",	3, DEC, NOV, HID, DEC, DEC},		/* 6 */
7570Sstevel@tonic-gate };
7580Sstevel@tonic-gate #define	NLGRPSYSCODE	(sizeof (lgrpsystable) / sizeof (struct systable))
7590Sstevel@tonic-gate 
7600Sstevel@tonic-gate static	const	struct systable rusagesystable[] = {
7610Sstevel@tonic-gate {"getrusage",		2, DEC, NOV, HID, HEX},			/* 0 */
7620Sstevel@tonic-gate {"getrusage_chld",	2, DEC, NOV, HID, HEX},			/* 1 */
7630Sstevel@tonic-gate {"getrusage_lwp",	2, DEC, NOV, HID, HEX},			/* 2 */
764*3247Sgjelinek {"getvmusage",		5, DEC, NOV, HID, HEX, DEC, HEX, HEX},	/* 3 */
7650Sstevel@tonic-gate };
7660Sstevel@tonic-gate #define	NRUSAGESYSCODE \
7670Sstevel@tonic-gate 		(sizeof (rusagesystable) / sizeof (struct systable))
7680Sstevel@tonic-gate 
7690Sstevel@tonic-gate static const	struct systable ucredsystable[] = {
7700Sstevel@tonic-gate {"ucred_get",	3, DEC, NOV, HID, DEC, HEX},
7710Sstevel@tonic-gate {"getpeerucred", 3, DEC, NOV, HID, DEC, HEX},
7720Sstevel@tonic-gate };
7730Sstevel@tonic-gate #define	NUCREDSYSCODE \
7740Sstevel@tonic-gate 		(sizeof (ucredsystable) / sizeof (struct systable))
7750Sstevel@tonic-gate 
7760Sstevel@tonic-gate const	struct systable portfstable[] = {
7770Sstevel@tonic-gate {"port_create",	2, DEC, NOV, HID, DEC},				/* 0 */
7780Sstevel@tonic-gate {"port_associate",	6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX}, /* 1 */
7790Sstevel@tonic-gate {"port_dissociate",	4, DEC, NOV, HID, DEC, DEC, HEX}, 	/* 2 */
7800Sstevel@tonic-gate {"port_send",	4, DEC, NOV, HID, DEC, HEX, HEX},		/* 3 */
7810Sstevel@tonic-gate {"port_sendn",	6, DEC, DEC, HID, HEX, HEX, DEC, HEX, HEX},	/* 4 */
7820Sstevel@tonic-gate {"port_get",	4, DEC, NOV, HID, DEC, HEX, HEX},		/* 5 */
7830Sstevel@tonic-gate {"port_getn",	6, DEC, DEC, HID, DEC, HEX, DEC, DEC, HEX},	/* 6 */
7840Sstevel@tonic-gate {"port_alert",	5, DEC, NOV, HID, DEC, HEX, HEX, HEX},		/* 7 */
7850Sstevel@tonic-gate {"port_dispatch", 6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX},	/* 8 */
7860Sstevel@tonic-gate };
7870Sstevel@tonic-gate #define	NPORTCODE	(sizeof (portfstable) / sizeof (struct systable))
7880Sstevel@tonic-gate 
7890Sstevel@tonic-gate static const struct systable zonetable[] = {
790813Sdp {"zone_create",	2, DEC, NOV, HID, HEX},				/* 0 */
7910Sstevel@tonic-gate {"zone_destroy", 2, DEC, NOV, HID, DEC},			/* 1 */
7920Sstevel@tonic-gate {"zone_getattr", 5, DEC, NOV, HID, DEC, ZGA, HEX, DEC},		/* 2 */
7930Sstevel@tonic-gate {"zone_enter",	2, DEC, NOV, HID, DEC},				/* 3 */
7940Sstevel@tonic-gate {"zone_list",	3, DEC, NOV, HID, HEX, HEX},			/* 4 */
7950Sstevel@tonic-gate {"zone_shutdown", 2, DEC, NOV, HID, DEC},			/* 5 */
7963235Sraf {"zone_lookup",	2, DEC, NOV, HID, STG},				/* 6 */
7973235Sraf {"zone_boot",	2, DEC, NOV, HID, DEC},				/* 7 */
798813Sdp {"zone_version", 2, HEX, NOV, HID, DEC},			/* 8 */
7992267Sdp {"zone_setattr", 5, DEC, NOV, HID, DEC, ZGA, HEX, DEC},		/* 9 */
8000Sstevel@tonic-gate };
8010Sstevel@tonic-gate #define	NZONECODE	(sizeof (zonetable) / sizeof (struct systable))
8020Sstevel@tonic-gate 
8031676Sjpk static const struct systable labeltable[] = {
8043235Sraf {"labelsys",	3, DEC, NOV, HID, HEX, HEX},			/* 0 */
8051676Sjpk {"is_system_labeled", 1, DEC, NOV, HID},			/* 1 */
8063235Sraf {"tnrh",	3, DEC, NOV, HID, TND, HEX},			/* 2 */
8073235Sraf {"tnrhtp",	3, DEC, NOV, HID, TND, HEX},			/* 3 */
8083235Sraf {"tnmlp",	3, DEC, NOV, HID, TND, HEX},			/* 4 */
8093235Sraf {"getlabel",	3, DEC, NOV, HID, STG, HEX},			/* 5 */
8103235Sraf {"fgetlabel",	3, DEC, NOV, HID, DEC, HEX},			/* 6 */
8111676Sjpk };
8121676Sjpk #define	NLABELCODE	(sizeof (labeltable) / sizeof (struct systable))
8131676Sjpk 
8143235Sraf const	struct systable forktable[] = {
8153235Sraf /* parent codes */
8163235Sraf {"forkx",	2, DEC, NOV, HID, FXF},				/* 0 */
8173235Sraf {"forkallx",	2, DEC, NOV, HID, FXF},				/* 1 */
8183235Sraf {"vforkx",	2, DEC, NOV, HID, FXF},				/* 2 */
8193235Sraf /* child codes */
8203235Sraf {"forkx",	0, DEC, NOV},					/* 3 */
8213235Sraf {"forkallx",	0, DEC, NOV},					/* 4 */
8223235Sraf {"vforkx",	0, DEC, NOV},					/* 5 */
8233235Sraf };
8243235Sraf #define	NFORKCODE	(sizeof (forktable) / sizeof (struct systable))
8253235Sraf 
8260Sstevel@tonic-gate const	struct sysalias sysalias[] = {
8270Sstevel@tonic-gate 	{ "exit",	SYS_exit	},
8283235Sraf 	{ "fork",	SYS_forksys	},
8293235Sraf 	{ "forkx",	SYS_forksys	},
8303235Sraf 	{ "forkallx",	SYS_forksys	},
8313235Sraf 	{ "vforkx",	SYS_forksys	},
8320Sstevel@tonic-gate 	{ "sbrk",	SYS_brk		},
8330Sstevel@tonic-gate 	{ "getppid",	SYS_getpid	},
8340Sstevel@tonic-gate 	{ "geteuid",	SYS_getuid	},
8350Sstevel@tonic-gate 	{ "getpgrp",	SYS_pgrpsys	},
8360Sstevel@tonic-gate 	{ "setpgrp",	SYS_pgrpsys	},
8370Sstevel@tonic-gate 	{ "getsid",	SYS_pgrpsys	},
8380Sstevel@tonic-gate 	{ "setsid",	SYS_pgrpsys	},
8390Sstevel@tonic-gate 	{ "getpgid",	SYS_pgrpsys	},
8400Sstevel@tonic-gate 	{ "setpgid",	SYS_pgrpsys	},
8410Sstevel@tonic-gate 	{ "getegid",	SYS_getgid	},
8420Sstevel@tonic-gate 	{ "sigset",	SYS_signal	},
8430Sstevel@tonic-gate 	{ "sighold",	SYS_signal	},
8440Sstevel@tonic-gate 	{ "sigrelse",	SYS_signal	},
8450Sstevel@tonic-gate 	{ "sigignore",	SYS_signal	},
8460Sstevel@tonic-gate 	{ "sigpause",	SYS_signal	},
8470Sstevel@tonic-gate 	{ "msgget",	SYS_msgsys	},
8480Sstevel@tonic-gate 	{ "msgctl",	SYS_msgsys	},
8490Sstevel@tonic-gate 	{ "msgctl64",	SYS_msgsys	},
8500Sstevel@tonic-gate 	{ "msgrcv",	SYS_msgsys	},
8510Sstevel@tonic-gate 	{ "msgsnd",	SYS_msgsys	},
8520Sstevel@tonic-gate 	{ "msgids",	SYS_msgsys	},
8530Sstevel@tonic-gate 	{ "msgsnap",	SYS_msgsys	},
8540Sstevel@tonic-gate 	{ "msgop",	SYS_msgsys	},
8550Sstevel@tonic-gate 	{ "shmat",	SYS_shmsys	},
8560Sstevel@tonic-gate 	{ "shmctl",	SYS_shmsys	},
8570Sstevel@tonic-gate 	{ "shmctl64",	SYS_shmsys	},
8580Sstevel@tonic-gate 	{ "shmdt",	SYS_shmsys	},
8590Sstevel@tonic-gate 	{ "shmget",	SYS_shmsys	},
8600Sstevel@tonic-gate 	{ "shmids",	SYS_shmsys	},
8610Sstevel@tonic-gate 	{ "shmop",	SYS_shmsys	},
8620Sstevel@tonic-gate 	{ "semctl",	SYS_semsys	},
8630Sstevel@tonic-gate 	{ "semctl64",	SYS_semsys	},
8640Sstevel@tonic-gate 	{ "semget",	SYS_semsys	},
8650Sstevel@tonic-gate 	{ "semids",	SYS_semsys	},
8660Sstevel@tonic-gate 	{ "semop",	SYS_semsys	},
8670Sstevel@tonic-gate 	{ "semtimedop",	SYS_semsys	},
8680Sstevel@tonic-gate 	{ "uname",	SYS_utssys	},
8690Sstevel@tonic-gate 	{ "ustat",	SYS_utssys	},
8700Sstevel@tonic-gate 	{ "fusers",	SYS_utssys	},
8710Sstevel@tonic-gate 	{ "exec",	SYS_execve	},
8720Sstevel@tonic-gate 	{ "execl",	SYS_execve	},
8730Sstevel@tonic-gate 	{ "execv",	SYS_execve	},
8740Sstevel@tonic-gate 	{ "execle",	SYS_execve	},
8750Sstevel@tonic-gate 	{ "execlp",	SYS_execve	},
8760Sstevel@tonic-gate 	{ "execvp",	SYS_execve	},
8770Sstevel@tonic-gate 	{ "sigfillset",	SYS_sigpending	},
8780Sstevel@tonic-gate 	{ "getcontext",	SYS_context	},
8790Sstevel@tonic-gate 	{ "setcontext",	SYS_context	},
8800Sstevel@tonic-gate 	{ "getustack",	SYS_context	},
8810Sstevel@tonic-gate 	{ "setustack",	SYS_context	},
8820Sstevel@tonic-gate 	{ "hrtcntl",	SYS_hrtsys	},
8830Sstevel@tonic-gate 	{ "hrtalarm",	SYS_hrtsys	},
8840Sstevel@tonic-gate 	{ "hrtsleep",	SYS_hrtsys	},
8850Sstevel@tonic-gate 	{ "hrtcancel",	SYS_hrtsys	},
8860Sstevel@tonic-gate 	{ "aioread",	SYS_kaio	},
8870Sstevel@tonic-gate 	{ "aiowrite",	SYS_kaio	},
8880Sstevel@tonic-gate 	{ "aiowait",	SYS_kaio	},
8890Sstevel@tonic-gate 	{ "aiocancel",	SYS_kaio	},
8900Sstevel@tonic-gate 	{ "aionotify",	SYS_kaio	},
8910Sstevel@tonic-gate 	{ "audit",	SYS_auditsys	},
8920Sstevel@tonic-gate 	{ "door_create",	SYS_door	},
8930Sstevel@tonic-gate 	{ "door_revoke",	SYS_door	},
8940Sstevel@tonic-gate 	{ "door_info",		SYS_door	},
8950Sstevel@tonic-gate 	{ "door_call",		SYS_door	},
8960Sstevel@tonic-gate 	{ "door_return",	SYS_door	},
8970Sstevel@tonic-gate 	{ "door_bind",		SYS_door	},
8980Sstevel@tonic-gate 	{ "door_unbind",	SYS_door	},
8990Sstevel@tonic-gate 	{ "door_unref",		SYS_door	},
9000Sstevel@tonic-gate 	{ "door_ucred",		SYS_door	},
9010Sstevel@tonic-gate 	{ "door_getparam",	SYS_door	},
9020Sstevel@tonic-gate 	{ "door_setparam",	SYS_door	},
9030Sstevel@tonic-gate 	{ "pset_create",	SYS_pset	},
9040Sstevel@tonic-gate 	{ "pset_destroy",	SYS_pset	},
9050Sstevel@tonic-gate 	{ "pset_assign",	SYS_pset	},
9060Sstevel@tonic-gate 	{ "pset_info",		SYS_pset	},
9070Sstevel@tonic-gate 	{ "pset_bind",		SYS_pset	},
9080Sstevel@tonic-gate 	{ "pset_getloadavg",	SYS_pset	},
9090Sstevel@tonic-gate 	{ "pset_list",		SYS_pset	},
9100Sstevel@tonic-gate 	{ "pset_setattr",	SYS_pset	},
9110Sstevel@tonic-gate 	{ "pset_getattr",	SYS_pset	},
9120Sstevel@tonic-gate 	{ "pset_assign_forced",	SYS_pset	},
9130Sstevel@tonic-gate 	{ "settaskid",		SYS_tasksys	},
9140Sstevel@tonic-gate 	{ "gettaskid",		SYS_tasksys	},
9150Sstevel@tonic-gate 	{ "getprojid",		SYS_tasksys	},
9160Sstevel@tonic-gate 	{ "setppriv",		SYS_privsys	},
9170Sstevel@tonic-gate 	{ "getppriv",		SYS_privsys	},
9180Sstevel@tonic-gate 	{ "getprivimplinfo",	SYS_privsys	},
9190Sstevel@tonic-gate 	{ "setpflags",		SYS_privsys	},
9200Sstevel@tonic-gate 	{ "getpflags",		SYS_privsys	},
9210Sstevel@tonic-gate 	{ "getacct",		SYS_exacctsys	},
9220Sstevel@tonic-gate 	{ "putacct",		SYS_exacctsys	},
9230Sstevel@tonic-gate 	{ "wracct",		SYS_exacctsys	},
9240Sstevel@tonic-gate 	{ "lwp_cond_timedwait",	SYS_lwp_cond_wait },
9250Sstevel@tonic-gate 	{ "lwp_park",		SYS_lwp_park	},
9260Sstevel@tonic-gate 	{ "lwp_unpark",		SYS_lwp_park	},
9270Sstevel@tonic-gate 	{ "lwp_unpark_all",	SYS_lwp_park	},
9280Sstevel@tonic-gate 	{ "lwp_rwlock_rdlock",	SYS_lwp_rwlock_sys },
9290Sstevel@tonic-gate 	{ "lwp_rwlock_wrlock",	SYS_lwp_rwlock_sys },
9300Sstevel@tonic-gate 	{ "lwp_rwlock_tryrdlock", SYS_lwp_rwlock_sys },
9310Sstevel@tonic-gate 	{ "lwp_rwlock_trywrlock", SYS_lwp_rwlock_sys },
9320Sstevel@tonic-gate 	{ "lwp_rwlock_unlock",	SYS_lwp_rwlock_sys },
9330Sstevel@tonic-gate 	{ "sendfilev64",	SYS_sendfilev	},
9340Sstevel@tonic-gate 	{ "openat",		SYS_fsat	},
9350Sstevel@tonic-gate 	{ "openat64",		SYS_fsat	},
9360Sstevel@tonic-gate 	{ "fstatat64",		SYS_fsat	},
9370Sstevel@tonic-gate 	{ "fstatat",		SYS_fsat	},
9380Sstevel@tonic-gate 	{ "fchownat",		SYS_fsat	},
9390Sstevel@tonic-gate 	{ "unlinkat",		SYS_fsat	},
9400Sstevel@tonic-gate 	{ "futimesat",		SYS_fsat	},
9410Sstevel@tonic-gate 	{ "renameat",		SYS_fsat	},
9420Sstevel@tonic-gate 	{ "lgrpsys",		SYS_lgrpsys	},
9430Sstevel@tonic-gate 	{ "getrusage",		SYS_rusagesys	},
9440Sstevel@tonic-gate 	{ "getrusage_chld",	SYS_rusagesys	},
9450Sstevel@tonic-gate 	{ "getrusage_lwp",	SYS_rusagesys	},
946*3247Sgjelinek 	{ "getvmusage",		SYS_rusagesys	},
9470Sstevel@tonic-gate 	{ "getpeerucred",	SYS_ucredsys	},
9480Sstevel@tonic-gate 	{ "ucred_get",		SYS_ucredsys	},
9490Sstevel@tonic-gate 	{ "port_create",	SYS_port	},
9500Sstevel@tonic-gate 	{ "port_associate",	SYS_port	},
9510Sstevel@tonic-gate 	{ "port_dissociate",	SYS_port	},
9520Sstevel@tonic-gate 	{ "port_send",		SYS_port	},
9530Sstevel@tonic-gate 	{ "port_sendn",		SYS_port	},
9540Sstevel@tonic-gate 	{ "port_get",		SYS_port	},
9550Sstevel@tonic-gate 	{ "port_getn",		SYS_port	},
9560Sstevel@tonic-gate 	{ "port_alert",		SYS_port	},
9570Sstevel@tonic-gate 	{ "port_dispatch",	SYS_port	},
9580Sstevel@tonic-gate 	{ "zone_create",	SYS_zone	},
9590Sstevel@tonic-gate 	{ "zone_destroy",	SYS_zone	},
9600Sstevel@tonic-gate 	{ "zone_getattr",	SYS_zone	},
961*3247Sgjelinek 	{ "zone_setattr",	SYS_zone	},
9620Sstevel@tonic-gate 	{ "zone_enter",		SYS_zone	},
9630Sstevel@tonic-gate 	{ "getzoneid",		SYS_zone	},
9640Sstevel@tonic-gate 	{ "zone_list",		SYS_zone	},
9650Sstevel@tonic-gate 	{ "zone_shutdown",	SYS_zone	},
9661676Sjpk 	{ "is_system_labeled",	SYS_labelsys	},
9671676Sjpk 	{ "tnrh",		SYS_labelsys	},
9681676Sjpk 	{ "tnrhtp",		SYS_labelsys	},
9691676Sjpk 	{ "tnmlp",		SYS_labelsys	},
9701676Sjpk 	{ "getlabel",		SYS_labelsys	},
9711676Sjpk 	{ "fgetlabel",		SYS_labelsys	},
9722447Snf202958 	{ "getrctl",		SYS_rctlsys	},
9732447Snf202958 	{ "setrctl",		SYS_rctlsys	},
9742447Snf202958 	{ "rctlsys_lst",	SYS_rctlsys	},
9752447Snf202958 	{ "rctlsys_ctl",	SYS_rctlsys	},
9760Sstevel@tonic-gate 	{  NULL,	0	}	/* end-of-list */
9770Sstevel@tonic-gate };
9780Sstevel@tonic-gate 
9790Sstevel@tonic-gate /*
9800Sstevel@tonic-gate  * Return structure to interpret system call with sub-codes.
9810Sstevel@tonic-gate  */
9820Sstevel@tonic-gate const struct systable *
9830Sstevel@tonic-gate subsys(int syscall, int subcode)
9840Sstevel@tonic-gate {
9850Sstevel@tonic-gate 	const struct systable *stp = NULL;
9860Sstevel@tonic-gate 
9870Sstevel@tonic-gate 	if (subcode != -1) {
9880Sstevel@tonic-gate 		switch (syscall) {
9890Sstevel@tonic-gate 		case SYS_open:
9900Sstevel@tonic-gate 			if ((unsigned)subcode < NOPENCODE)
9910Sstevel@tonic-gate 				stp = &opentable[subcode];
9920Sstevel@tonic-gate 			break;
9930Sstevel@tonic-gate 		case SYS_open64:
9940Sstevel@tonic-gate 			if ((unsigned)subcode < NOPEN64CODE)
9950Sstevel@tonic-gate 				stp = &open64table[subcode];
9960Sstevel@tonic-gate 			break;
9970Sstevel@tonic-gate 		case SYS_signal:	/* signal() + sigset() family */
9980Sstevel@tonic-gate 			if ((unsigned)subcode < NSIGCODE)
9990Sstevel@tonic-gate 				stp = &sigtable[subcode];
10000Sstevel@tonic-gate 			break;
10010Sstevel@tonic-gate 		case SYS_msgsys:	/* msgsys() */
10020Sstevel@tonic-gate 			if ((unsigned)subcode < NMSGCODE)
10030Sstevel@tonic-gate 				stp = &msgtable[subcode];
10040Sstevel@tonic-gate 			break;
10050Sstevel@tonic-gate 		case SYS_semsys:	/* semsys() */
10060Sstevel@tonic-gate 			if ((unsigned)subcode < NSEMCODE)
10070Sstevel@tonic-gate 				stp = &semtable[subcode];
10080Sstevel@tonic-gate 			break;
10090Sstevel@tonic-gate 		case SYS_shmsys:	/* shmsys() */
10100Sstevel@tonic-gate 			if ((unsigned)subcode < NSHMCODE)
10110Sstevel@tonic-gate 				stp = &shmtable[subcode];
10120Sstevel@tonic-gate 			break;
10130Sstevel@tonic-gate 		case SYS_pgrpsys:	/* pgrpsys() */
10140Sstevel@tonic-gate 			if ((unsigned)subcode < NPIDCODE)
10150Sstevel@tonic-gate 				stp = &pidtable[subcode];
10160Sstevel@tonic-gate 			break;
10170Sstevel@tonic-gate 		case SYS_utssys:	/* utssys() */
10180Sstevel@tonic-gate 			if ((unsigned)subcode < NUTSCODE)
10190Sstevel@tonic-gate 				stp = &utstable[subcode];
10200Sstevel@tonic-gate 			break;
10210Sstevel@tonic-gate 		case SYS_sysfs:		/* sysfs() */
10220Sstevel@tonic-gate 			if ((unsigned)subcode < NSFSCODE)
10230Sstevel@tonic-gate 				stp = &sfstable[subcode];
10240Sstevel@tonic-gate 			break;
10250Sstevel@tonic-gate 		case SYS_sigpending:	/* sigpending()/sigfillset() */
10260Sstevel@tonic-gate 			if ((unsigned)subcode < NSGPCODE)
10270Sstevel@tonic-gate 				stp = &sgptable[subcode];
10280Sstevel@tonic-gate 			break;
10290Sstevel@tonic-gate 		case SYS_context:	/* [get|set]context() */
10300Sstevel@tonic-gate 			if ((unsigned)subcode < NCTXCODE)
10310Sstevel@tonic-gate 				stp = &ctxtable[subcode];
10320Sstevel@tonic-gate 			break;
10330Sstevel@tonic-gate 		case SYS_hrtsys:	/* hrtsys() */
10340Sstevel@tonic-gate 			if ((unsigned)subcode < NHRTCODE)
10350Sstevel@tonic-gate 				stp = &hrttable[subcode];
10360Sstevel@tonic-gate 			break;
10370Sstevel@tonic-gate 		case SYS_corectl:	/* corectl() */
10380Sstevel@tonic-gate 			if ((unsigned)subcode < NCORCODE)
10390Sstevel@tonic-gate 				stp = &cortable[subcode];
10400Sstevel@tonic-gate 			break;
10410Sstevel@tonic-gate 		case SYS_kaio:		/* kaio() */
10420Sstevel@tonic-gate 			if ((unsigned)subcode < NAIOCODE)
10430Sstevel@tonic-gate 				stp = &aiotable[subcode];
10440Sstevel@tonic-gate 			break;
10450Sstevel@tonic-gate 		case SYS_door:		/* doors */
10460Sstevel@tonic-gate 			if ((unsigned)subcode < NDOORCODE)
10470Sstevel@tonic-gate 				stp = &doortable[subcode];
10480Sstevel@tonic-gate 			break;
10490Sstevel@tonic-gate 		case SYS_pset:		/* pset() */
10500Sstevel@tonic-gate 			if ((unsigned)subcode < NPSETCODE)
10510Sstevel@tonic-gate 				stp = &psettable[subcode];
10520Sstevel@tonic-gate 			break;
10530Sstevel@tonic-gate 		case SYS_lwp_create:	/* lwp_create() */
10540Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPCREATECODE)
10550Sstevel@tonic-gate 				stp = &lwpcreatetable[subcode];
10560Sstevel@tonic-gate 			break;
10570Sstevel@tonic-gate 		case SYS_tasksys:	/* tasks */
10580Sstevel@tonic-gate 			if ((unsigned)subcode < NTASKSYSCODE)
10590Sstevel@tonic-gate 				stp = &tasksystable[subcode];
10600Sstevel@tonic-gate 			break;
10610Sstevel@tonic-gate 		case SYS_exacctsys:	/* exacct */
10620Sstevel@tonic-gate 			if ((unsigned)subcode < NEXACCTSYSCODE)
10630Sstevel@tonic-gate 				stp = &exacctsystable[subcode];
10640Sstevel@tonic-gate 			break;
10650Sstevel@tonic-gate 		case SYS_fsat:
10660Sstevel@tonic-gate 			if ((unsigned)subcode < NFSATSYSCODE)
10670Sstevel@tonic-gate 				stp = &fsatsystable[subcode];
10680Sstevel@tonic-gate 			break;
10690Sstevel@tonic-gate 		case SYS_privsys:	/* privileges */
10700Sstevel@tonic-gate 			if ((unsigned)subcode < NPRIVSYSCODE)
10710Sstevel@tonic-gate 				stp = &privsystable[subcode];
10720Sstevel@tonic-gate 			break;
10730Sstevel@tonic-gate 		case SYS_lwp_park:	/* lwp_park */
10740Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPPARKCODE)
10750Sstevel@tonic-gate 				stp = &lwpparktable[subcode];
10760Sstevel@tonic-gate 			break;
10770Sstevel@tonic-gate 		case SYS_lwp_rwlock_sys:
10780Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPRWLOCKCODE)
10790Sstevel@tonic-gate 				stp = &lwprwlocktable[subcode];
10800Sstevel@tonic-gate 			break;
10810Sstevel@tonic-gate 		case SYS_sendfilev:	/* sendfilev */
10820Sstevel@tonic-gate 			if ((unsigned)subcode < NSENDFILESYSCODE)
10830Sstevel@tonic-gate 				stp = &sendfilevsystable[subcode];
10840Sstevel@tonic-gate 			break;
10850Sstevel@tonic-gate 		case SYS_lgrpsys:	/* lgrpsys */
10860Sstevel@tonic-gate 			if ((unsigned)subcode < NLGRPSYSCODE)
10870Sstevel@tonic-gate 				stp = &lgrpsystable[subcode];
10880Sstevel@tonic-gate 			break;
10890Sstevel@tonic-gate 		case SYS_rusagesys:	/* rusagesys */
10900Sstevel@tonic-gate 			if ((unsigned)subcode < NRUSAGESYSCODE)
10910Sstevel@tonic-gate 				stp = &rusagesystable[subcode];
10920Sstevel@tonic-gate 			break;
10930Sstevel@tonic-gate 		case SYS_fcntl:		/* fcntl */
10940Sstevel@tonic-gate 			if ((unsigned)subcode < NFCNTLCODE)
10950Sstevel@tonic-gate 				stp = &fcntltable[subcode];
10960Sstevel@tonic-gate 			break;
10970Sstevel@tonic-gate 		case SYS_ucredsys:
10980Sstevel@tonic-gate 			if ((unsigned)subcode < NUCREDSYSCODE)
10990Sstevel@tonic-gate 				stp = &ucredsystable[subcode];
11000Sstevel@tonic-gate 			break;
11010Sstevel@tonic-gate 		case SYS_port:	/* portfs */
11020Sstevel@tonic-gate 			if ((unsigned)subcode < NPORTCODE)
11030Sstevel@tonic-gate 				stp = &portfstable[subcode];
11040Sstevel@tonic-gate 			break;
11050Sstevel@tonic-gate 		case SYS_zone:		/* zone family */
11060Sstevel@tonic-gate 			if ((unsigned)subcode < NZONECODE)
11070Sstevel@tonic-gate 				stp = &zonetable[subcode];
11080Sstevel@tonic-gate 			break;
11091676Sjpk 		case SYS_labelsys:	/* label family */
11101676Sjpk 			if ((unsigned)subcode < NLABELCODE)
11111676Sjpk 				stp = &labeltable[subcode];
11121676Sjpk 			break;
11132447Snf202958 		case SYS_rctlsys:	/* rctl family */
11142447Snf202958 			if ((unsigned)subcode < NRCTLCODE)
11152447Snf202958 				stp = &rctltable[subcode];
11162447Snf202958 			break;
11173235Sraf 		case SYS_forksys:	/* fork family */
11183235Sraf 			if ((unsigned)subcode < NFORKCODE)
11193235Sraf 				stp = &forktable[subcode];
11203235Sraf 			break;
11210Sstevel@tonic-gate 		}
11220Sstevel@tonic-gate 	}
11230Sstevel@tonic-gate 
11240Sstevel@tonic-gate 	if (stp == NULL)
11250Sstevel@tonic-gate 		stp = &systable[((unsigned)syscall < SYSEND)? syscall : 0];
11260Sstevel@tonic-gate 
11270Sstevel@tonic-gate 	return (stp);
11280Sstevel@tonic-gate }
11290Sstevel@tonic-gate 
11300Sstevel@tonic-gate /*
11310Sstevel@tonic-gate  * Return the name of the system call.
11320Sstevel@tonic-gate  */
11330Sstevel@tonic-gate const char *
11340Sstevel@tonic-gate sysname(private_t *pri, int syscall, int subcode)
11350Sstevel@tonic-gate {
11360Sstevel@tonic-gate 	const struct systable *stp = subsys(syscall, subcode);
11370Sstevel@tonic-gate 	const char *name = stp->name;	/* may be NULL */
11380Sstevel@tonic-gate 
11390Sstevel@tonic-gate 	if (name == NULL) {		/* manufacture a name */
11400Sstevel@tonic-gate 		(void) sprintf(pri->sys_name, "sys#%d", syscall);
11410Sstevel@tonic-gate 		name = pri->sys_name;
11420Sstevel@tonic-gate 	}
11430Sstevel@tonic-gate 
11440Sstevel@tonic-gate 	return (name);
11450Sstevel@tonic-gate }
11460Sstevel@tonic-gate 
11470Sstevel@tonic-gate /*
11480Sstevel@tonic-gate  * Return the name of the signal.
11490Sstevel@tonic-gate  * Return NULL if unknown signal.
11500Sstevel@tonic-gate  */
11510Sstevel@tonic-gate const char *
11520Sstevel@tonic-gate rawsigname(private_t *pri, int sig)
11530Sstevel@tonic-gate {
11540Sstevel@tonic-gate 	/*
11550Sstevel@tonic-gate 	 * The C library function sig2str() omits the leading "SIG".
11560Sstevel@tonic-gate 	 */
11570Sstevel@tonic-gate 	(void) strcpy(pri->raw_sig_name, "SIG");
11580Sstevel@tonic-gate 
11590Sstevel@tonic-gate 	if (sig > 0 && sig2str(sig, pri->raw_sig_name+3) == 0)
11600Sstevel@tonic-gate 		return (pri->raw_sig_name);
11610Sstevel@tonic-gate 	return (NULL);
11620Sstevel@tonic-gate }
11630Sstevel@tonic-gate 
11640Sstevel@tonic-gate /*
11650Sstevel@tonic-gate  * Return the name of the signal.
11660Sstevel@tonic-gate  * Manufacture a name for unknown signal.
11670Sstevel@tonic-gate  */
11680Sstevel@tonic-gate const char *
11690Sstevel@tonic-gate signame(private_t *pri, int sig)
11700Sstevel@tonic-gate {
11710Sstevel@tonic-gate 	const char *name = rawsigname(pri, sig);
11720Sstevel@tonic-gate 
11730Sstevel@tonic-gate 	if (name == NULL) {			/* manufacture a name */
11740Sstevel@tonic-gate 		(void) sprintf(pri->sig_name, "SIG#%d", sig);
11750Sstevel@tonic-gate 		name = pri->sig_name;
11760Sstevel@tonic-gate 	}
11770Sstevel@tonic-gate 
11780Sstevel@tonic-gate 	return (name);
11790Sstevel@tonic-gate }
11800Sstevel@tonic-gate 
11810Sstevel@tonic-gate /*
11820Sstevel@tonic-gate  * Determine the subcode for this syscall, if any.
11830Sstevel@tonic-gate  */
11840Sstevel@tonic-gate int
11850Sstevel@tonic-gate getsubcode(private_t *pri)
11860Sstevel@tonic-gate {
11870Sstevel@tonic-gate 	const lwpstatus_t *Lsp = pri->lwpstat;
11880Sstevel@tonic-gate 	int syscall = Lsp->pr_syscall;
11890Sstevel@tonic-gate 	int nsysarg = Lsp->pr_nsysarg;
11900Sstevel@tonic-gate 	int subcode = -1;
11910Sstevel@tonic-gate 	int arg0;
11920Sstevel@tonic-gate 
11930Sstevel@tonic-gate 	if (syscall > 0 && nsysarg > 0) {
11940Sstevel@tonic-gate 		arg0 = Lsp->pr_sysarg[0];
11950Sstevel@tonic-gate 		switch (syscall) {
11960Sstevel@tonic-gate 		case SYS_utssys:	/* utssys() */
11970Sstevel@tonic-gate 			if (nsysarg > 2)
11980Sstevel@tonic-gate 				subcode = Lsp->pr_sysarg[2];
11990Sstevel@tonic-gate 			break;
12000Sstevel@tonic-gate 		case SYS_open:		/* open() w/ and w/o O_CREAT */
12010Sstevel@tonic-gate 		case SYS_open64:
12020Sstevel@tonic-gate 			if (nsysarg > 1)
12030Sstevel@tonic-gate 				subcode = (Lsp->pr_sysarg[1] & O_CREAT)? 1 : 0;
12040Sstevel@tonic-gate 			break;
12050Sstevel@tonic-gate 		case SYS_fsat:
12060Sstevel@tonic-gate 			switch (arg0) {
12070Sstevel@tonic-gate 			case 0:  /* openat */
12080Sstevel@tonic-gate 				if (nsysarg > 3)
12090Sstevel@tonic-gate 					subcode =
12100Sstevel@tonic-gate 					    (Lsp->pr_sysarg[3] & O_CREAT) ?
12110Sstevel@tonic-gate 					    0 : 8;
12120Sstevel@tonic-gate 				break;
12130Sstevel@tonic-gate 			case 1: /* openat64 */
12140Sstevel@tonic-gate 				if (nsysarg > 3)
12150Sstevel@tonic-gate 					subcode =
12160Sstevel@tonic-gate 					    (Lsp->pr_sysarg[3] & O_CREAT) ?
12170Sstevel@tonic-gate 					    1 : 9;
12180Sstevel@tonic-gate 				break;
12190Sstevel@tonic-gate 			case 2:
12200Sstevel@tonic-gate 			case 3:
12210Sstevel@tonic-gate 			case 4:
12220Sstevel@tonic-gate 			case 5:
12230Sstevel@tonic-gate 			case 6:
12240Sstevel@tonic-gate 			case 7:
12250Sstevel@tonic-gate 				subcode = arg0;
12260Sstevel@tonic-gate 			}
12270Sstevel@tonic-gate 			break;
12280Sstevel@tonic-gate 		case SYS_signal:	/* signal() + sigset() family */
12290Sstevel@tonic-gate 			switch (arg0 & ~SIGNO_MASK) {
12300Sstevel@tonic-gate 			default:	subcode = 0;	break;
12310Sstevel@tonic-gate 			case SIGDEFER:	subcode = 1;	break;
12320Sstevel@tonic-gate 			case SIGHOLD:	subcode = 2;	break;
12330Sstevel@tonic-gate 			case SIGRELSE:	subcode = 3;	break;
12340Sstevel@tonic-gate 			case SIGIGNORE:	subcode = 4;	break;
12350Sstevel@tonic-gate 			case SIGPAUSE:	subcode = 5;	break;
12360Sstevel@tonic-gate 			}
12370Sstevel@tonic-gate 			break;
12380Sstevel@tonic-gate 		case SYS_kaio:		/* kaio() */
12390Sstevel@tonic-gate 			subcode = arg0 & ~AIO_POLL_BIT;
12400Sstevel@tonic-gate 			break;
12410Sstevel@tonic-gate 		case SYS_door:		/* doors */
12420Sstevel@tonic-gate 			if (nsysarg > 5)
12430Sstevel@tonic-gate 				subcode = Lsp->pr_sysarg[5];
12440Sstevel@tonic-gate 			break;
12450Sstevel@tonic-gate 		case SYS_lwp_create:	/* lwp_create() */
12460Sstevel@tonic-gate 			subcode =	/* 0 for parent, 1 for child */
12472267Sdp 			    (Lsp->pr_why == PR_SYSEXIT && Lsp->pr_errno == 0 &&
12482267Sdp 			    Lsp->pr_rval1 == 0);
12490Sstevel@tonic-gate 			break;
12503235Sraf 		case SYS_forksys:	/* forksys */
12513235Sraf 			subcode = arg0;
12523235Sraf 			if (Lsp->pr_why == PR_SYSEXIT && Lsp->pr_errno == 0 &&
12533235Sraf 			    pri->Rval2 != 0)	/* this is the child */
12543235Sraf 				subcode += 3;
12553235Sraf 			break;
12560Sstevel@tonic-gate 		case SYS_msgsys:	/* msgsys() */
12570Sstevel@tonic-gate 		case SYS_semsys:	/* semsys() */
12580Sstevel@tonic-gate 		case SYS_shmsys:	/* shmsys() */
12590Sstevel@tonic-gate 		case SYS_pgrpsys:	/* pgrpsys() */
12600Sstevel@tonic-gate 		case SYS_sysfs:		/* sysfs() */
12610Sstevel@tonic-gate 		case SYS_sigpending:	/* sigpending()/sigfillset() */
12620Sstevel@tonic-gate 		case SYS_context:	/* [get|set]context() */
12630Sstevel@tonic-gate 		case SYS_hrtsys:	/* hrtsys() */
12640Sstevel@tonic-gate 		case SYS_corectl:	/* corectl() */
12650Sstevel@tonic-gate 		case SYS_pset:		/* pset() */
12660Sstevel@tonic-gate 		case SYS_tasksys:	/* tasks */
12670Sstevel@tonic-gate 		case SYS_privsys:	/* privileges */
12680Sstevel@tonic-gate 		case SYS_exacctsys:	/* exacct */
12690Sstevel@tonic-gate 		case SYS_lwp_park:	/* lwp_park */
12700Sstevel@tonic-gate 		case SYS_lwp_rwlock_sys: /* lwp_rwlock_*() */
12710Sstevel@tonic-gate 		case SYS_sendfilev:	/* sendfilev */
12720Sstevel@tonic-gate 		case SYS_lgrpsys:	/* lgrpsys */
12730Sstevel@tonic-gate 		case SYS_rusagesys:	/* rusagesys */
12740Sstevel@tonic-gate 		case SYS_ucredsys:	/* ucredsys */
12750Sstevel@tonic-gate 		case SYS_zone:		/* zone */
12761676Sjpk 		case SYS_labelsys:	/* labelsys */
12772447Snf202958 		case SYS_rctlsys:	/* rctlsys */
12780Sstevel@tonic-gate 			subcode = arg0;
12790Sstevel@tonic-gate 			break;
12800Sstevel@tonic-gate 		case SYS_fcntl:		/* fcntl() */
12810Sstevel@tonic-gate 			if (nsysarg > 2) {
12820Sstevel@tonic-gate 				switch (Lsp->pr_sysarg[1]) {
12830Sstevel@tonic-gate 				default:	subcode = 0; break;
12840Sstevel@tonic-gate 				case F_GETFL:
12850Sstevel@tonic-gate 				case F_GETOWN:
12860Sstevel@tonic-gate 				case F_GETXFL:	subcode = 1; break;
12870Sstevel@tonic-gate 				case F_SETFL:	subcode = 2; break;
12880Sstevel@tonic-gate 				}
12890Sstevel@tonic-gate 			}
12900Sstevel@tonic-gate 			break;
12910Sstevel@tonic-gate 		case SYS_port:		/* portfs */
12920Sstevel@tonic-gate 			subcode = arg0 & PORT_CODE_MASK;
12930Sstevel@tonic-gate 			break;
12940Sstevel@tonic-gate 		}
12950Sstevel@tonic-gate 	}
12960Sstevel@tonic-gate 
12970Sstevel@tonic-gate 	return (subcode);
12980Sstevel@tonic-gate }
12990Sstevel@tonic-gate 
13000Sstevel@tonic-gate /*
13010Sstevel@tonic-gate  * Return the maximum number of system calls, counting
13020Sstevel@tonic-gate  * all system calls with subcodes as separate calls.
13030Sstevel@tonic-gate  */
13040Sstevel@tonic-gate int
13050Sstevel@tonic-gate maxsyscalls()
13060Sstevel@tonic-gate {
13070Sstevel@tonic-gate 	return (PRMAXSYS + 1
13082267Sdp 	    + NOPENCODE - 1
13092267Sdp 	    + NOPEN64CODE - 1
13102267Sdp 	    + NSIGCODE - 1
13112267Sdp 	    + NMSGCODE - 1
13122267Sdp 	    + NSEMCODE - 1
13132267Sdp 	    + NSHMCODE - 1
13142267Sdp 	    + NPIDCODE - 1
13152267Sdp 	    + NSFSCODE - 1
13162267Sdp 	    + NUTSCODE - 1
13172267Sdp 	    + NSGPCODE - 1
13182267Sdp 	    + NCTXCODE - 1
13192267Sdp 	    + NHRTCODE - 1
13202267Sdp 	    + NCORCODE - 1
13212267Sdp 	    + NAIOCODE - 1
13222267Sdp 	    + NDOORCODE - 1
13232267Sdp 	    + NPSETCODE - 1
13242267Sdp 	    + NLWPCREATECODE - 1
13252267Sdp 	    + NTASKSYSCODE - 1
13262267Sdp 	    + NEXACCTSYSCODE - 1
13272267Sdp 	    + NFSATSYSCODE - 1
13282267Sdp 	    + NLWPPARKCODE - 1
13292267Sdp 	    + NLWPRWLOCKCODE - 1
13302267Sdp 	    + NSENDFILESYSCODE - 1
13312267Sdp 	    + NLGRPSYSCODE - 1
13322267Sdp 	    + NRUSAGESYSCODE - 1
13332267Sdp 	    + NFCNTLCODE - 1
13342267Sdp 	    + NPRIVSYSCODE - 1
13352267Sdp 	    + NUCREDSYSCODE - 1
13362267Sdp 	    + NPORTCODE - 1
13372267Sdp 	    + NZONECODE - 1
13382447Snf202958 	    + NLABELCODE - 1
13393235Sraf 	    + NRCTLCODE - 1
13403235Sraf 	    + NFORKCODE - 1);
13410Sstevel@tonic-gate }
13420Sstevel@tonic-gate 
13430Sstevel@tonic-gate /*
13440Sstevel@tonic-gate  * Return the number of subcodes for the specified system call number.
13450Sstevel@tonic-gate  */
13460Sstevel@tonic-gate int
13470Sstevel@tonic-gate nsubcodes(int syscall)
13480Sstevel@tonic-gate {
13490Sstevel@tonic-gate 	switch (syscall) {
13500Sstevel@tonic-gate 	case SYS_open:
13510Sstevel@tonic-gate 		return (NOPENCODE);
13520Sstevel@tonic-gate 	case SYS_open64:
13530Sstevel@tonic-gate 		return (NOPEN64CODE);
13540Sstevel@tonic-gate 	case SYS_signal:	/* signal() + sigset() family */
13550Sstevel@tonic-gate 		return (NSIGCODE);
13560Sstevel@tonic-gate 	case SYS_msgsys:	/* msgsys() */
13570Sstevel@tonic-gate 		return (NMSGCODE);
13580Sstevel@tonic-gate 	case SYS_semsys:	/* semsys() */
13590Sstevel@tonic-gate 		return (NSEMCODE);
13600Sstevel@tonic-gate 	case SYS_shmsys:	/* shmsys() */
13610Sstevel@tonic-gate 		return (NSHMCODE);
13620Sstevel@tonic-gate 	case SYS_pgrpsys:	/* pgrpsys() */
13630Sstevel@tonic-gate 		return (NPIDCODE);
13640Sstevel@tonic-gate 	case SYS_utssys:	/* utssys() */
13650Sstevel@tonic-gate 		return (NUTSCODE);
13660Sstevel@tonic-gate 	case SYS_sysfs:		/* sysfs() */
13670Sstevel@tonic-gate 		return (NSFSCODE);
13680Sstevel@tonic-gate 	case SYS_sigpending:	/* sigpending()/sigfillset() */
13690Sstevel@tonic-gate 		return (NSGPCODE);
13700Sstevel@tonic-gate 	case SYS_context:	/* [get|set]context() */
13710Sstevel@tonic-gate 		return (NCTXCODE);
13720Sstevel@tonic-gate 	case SYS_hrtsys:	/* hrtsys() */
13730Sstevel@tonic-gate 		return (NHRTCODE);
13740Sstevel@tonic-gate 	case SYS_corectl:	/* corectl() */
13750Sstevel@tonic-gate 		return (NCORCODE);
13760Sstevel@tonic-gate 	case SYS_kaio:		/* kaio() */
13770Sstevel@tonic-gate 		return (NAIOCODE);
13780Sstevel@tonic-gate 	case SYS_door:		/* doors */
13790Sstevel@tonic-gate 		return (NDOORCODE);
13800Sstevel@tonic-gate 	case SYS_pset:		/* pset() */
13810Sstevel@tonic-gate 		return (NPSETCODE);
13820Sstevel@tonic-gate 	case SYS_lwp_create:	/* lwp_create() */
13830Sstevel@tonic-gate 		return (NLWPCREATECODE);
13840Sstevel@tonic-gate 	case SYS_tasksys:	/* tasks */
13850Sstevel@tonic-gate 		return (NTASKSYSCODE);
13860Sstevel@tonic-gate 	case SYS_exacctsys:	/* exacct */
13870Sstevel@tonic-gate 		return (NEXACCTSYSCODE);
13880Sstevel@tonic-gate 	case SYS_fsat:
13890Sstevel@tonic-gate 		return (NFSATSYSCODE);
13900Sstevel@tonic-gate 	case SYS_privsys:	/* privileges */
13910Sstevel@tonic-gate 		return (NPRIVSYSCODE);
13920Sstevel@tonic-gate 	case SYS_lwp_park:	/* lwp_park */
13930Sstevel@tonic-gate 		return (NLWPPARKCODE);
13940Sstevel@tonic-gate 	case SYS_lwp_rwlock_sys:
13950Sstevel@tonic-gate 		return (NLWPRWLOCKCODE);
13960Sstevel@tonic-gate 	case SYS_sendfilev:	/* sendfilev */
13970Sstevel@tonic-gate 		return (NSENDFILESYSCODE);
13980Sstevel@tonic-gate 	case SYS_lgrpsys:	/* lgrpsys */
13990Sstevel@tonic-gate 		return (NLGRPSYSCODE);
14000Sstevel@tonic-gate 	case SYS_rusagesys:
14010Sstevel@tonic-gate 		return (NRUSAGESYSCODE);
14020Sstevel@tonic-gate 	case SYS_fcntl:
14030Sstevel@tonic-gate 		return (NFCNTLCODE);
14040Sstevel@tonic-gate 	case SYS_ucredsys:
14050Sstevel@tonic-gate 		return (NUCREDSYSCODE);
14060Sstevel@tonic-gate 	case SYS_port:
14070Sstevel@tonic-gate 		return (NPORTCODE);
14080Sstevel@tonic-gate 	case SYS_zone:		/* zone */
14090Sstevel@tonic-gate 		return (NZONECODE);
14101676Sjpk 	case SYS_labelsys:
14111676Sjpk 		return (NLABELCODE);
14122447Snf202958 	case SYS_rctlsys:
14132447Snf202958 		return (NRCTLCODE);
14143235Sraf 	case SYS_forksys:
14153235Sraf 		return (NFORKCODE);
14160Sstevel@tonic-gate 	default:
14170Sstevel@tonic-gate 		return (1);
14180Sstevel@tonic-gate 	}
14190Sstevel@tonic-gate }
14200Sstevel@tonic-gate 
14210Sstevel@tonic-gate 
14220Sstevel@tonic-gate 
14230Sstevel@tonic-gate /* Socket address families (and protocol families) */
14240Sstevel@tonic-gate const char * const afcodes[] = {
14250Sstevel@tonic-gate 	"UNSPEC",	/* 0 */
14260Sstevel@tonic-gate 	"UNIX",		/* 1 */
14270Sstevel@tonic-gate 	"INET",		/* 2 */
14280Sstevel@tonic-gate 	"IMPLINK",	/* 3 */
14290Sstevel@tonic-gate 	"PUP",		/* 4 */
14300Sstevel@tonic-gate 	"CHAOS",	/* 5 */
14310Sstevel@tonic-gate 	"NS",		/* 6 */
14320Sstevel@tonic-gate 	"NBS",		/* 7 */
14330Sstevel@tonic-gate 	"ECMA",		/* 8 */
14340Sstevel@tonic-gate 	"DATAKIT",	/* 9 */
14350Sstevel@tonic-gate 	"CCITT",	/* 10 */
14360Sstevel@tonic-gate 	"SNA",		/* 11 */
14370Sstevel@tonic-gate 	"DECnet",	/* 12 */
14380Sstevel@tonic-gate 	"DLI",		/* 13 */
14390Sstevel@tonic-gate 	"LAT",		/* 14 */
14400Sstevel@tonic-gate 	"HYLINK",	/* 15 */
14410Sstevel@tonic-gate 	"APPLETALK",	/* 16 */
14420Sstevel@tonic-gate 	"NIT",		/* 17 */
14430Sstevel@tonic-gate 	"802",		/* 18 */
14440Sstevel@tonic-gate 	"OSI",		/* 19 */
14450Sstevel@tonic-gate 	"X25",		/* 20 */
14460Sstevel@tonic-gate 	"OSINET",	/* 21 */
14470Sstevel@tonic-gate 	"GOSIP",	/* 22 */
14480Sstevel@tonic-gate 	"IPX",		/* 23 */
14490Sstevel@tonic-gate 	"ROUTE",	/* 24 */
14500Sstevel@tonic-gate 	"LINK",		/* 25 */
14510Sstevel@tonic-gate 	"INET6",	/* 26 */
14520Sstevel@tonic-gate 	"KEY",		/* 27 */
14530Sstevel@tonic-gate 	"NCA",		/* 28 */
14540Sstevel@tonic-gate 	"POLICY"	/* 29 */
14550Sstevel@tonic-gate };
14560Sstevel@tonic-gate #if MAX_AFCODES != 30
14570Sstevel@tonic-gate #error Need to update address-family table
14580Sstevel@tonic-gate #endif
14590Sstevel@tonic-gate 
14600Sstevel@tonic-gate 
14610Sstevel@tonic-gate const char * const socktype_codes[] = {		/* cf socket.h */
14620Sstevel@tonic-gate 	NULL,
14630Sstevel@tonic-gate 	"SOCK_DGRAM",		/* 1 */
14640Sstevel@tonic-gate 	"SOCK_STREAM",		/* 2 */
14650Sstevel@tonic-gate 	NULL,
14660Sstevel@tonic-gate 	"SOCK_RAW",		/* 4 */
14670Sstevel@tonic-gate 	"SOCK_RDM",		/* 5 */
14680Sstevel@tonic-gate 	"SOCK_SEQPACKET"	/* 6 */
14690Sstevel@tonic-gate };
14700Sstevel@tonic-gate #if MAX_SOCKTYPES != 7
14710Sstevel@tonic-gate #error Need to update socket-type table
14720Sstevel@tonic-gate #endif
1473