xref: /onnv-gate/usr/src/cmd/truss/systable.c (revision 12643)
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 /*
23*12643SAnders.Persson@Sun.COM  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
270Sstevel@tonic-gate /*	  All Rights Reserved  	*/
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #include <stdio.h>
300Sstevel@tonic-gate #include <stdlib.h>
310Sstevel@tonic-gate #include <fcntl.h>
320Sstevel@tonic-gate #include <unistd.h>
330Sstevel@tonic-gate #include <string.h>
340Sstevel@tonic-gate #include <signal.h>
350Sstevel@tonic-gate #include <sys/types.h>
360Sstevel@tonic-gate #include <libproc.h>
370Sstevel@tonic-gate #include <sys/aio.h>
380Sstevel@tonic-gate #include <sys/port_impl.h>
390Sstevel@tonic-gate #include "ramdata.h"
400Sstevel@tonic-gate #include "systable.h"
410Sstevel@tonic-gate #include "print.h"
420Sstevel@tonic-gate #include "proto.h"
430Sstevel@tonic-gate 
440Sstevel@tonic-gate /*
450Sstevel@tonic-gate  * Tables of information about system calls - read-only data.
460Sstevel@tonic-gate  */
470Sstevel@tonic-gate 
480Sstevel@tonic-gate const	char *const	errcode[] = {	/* error code names */
490Sstevel@tonic-gate 	NULL,		/*  0 */
500Sstevel@tonic-gate 	"EPERM",	/*  1 */
510Sstevel@tonic-gate 	"ENOENT",	/*  2 */
520Sstevel@tonic-gate 	"ESRCH",	/*  3 */
530Sstevel@tonic-gate 	"EINTR",	/*  4 */
540Sstevel@tonic-gate 	"EIO",		/*  5 */
550Sstevel@tonic-gate 	"ENXIO",	/*  6 */
560Sstevel@tonic-gate 	"E2BIG",	/*  7 */
570Sstevel@tonic-gate 	"ENOEXEC",	/*  8 */
580Sstevel@tonic-gate 	"EBADF",	/*  9 */
590Sstevel@tonic-gate 	"ECHILD",	/* 10 */
600Sstevel@tonic-gate 	"EAGAIN",	/* 11 */
610Sstevel@tonic-gate 	"ENOMEM",	/* 12 */
620Sstevel@tonic-gate 	"EACCES",	/* 13 */
630Sstevel@tonic-gate 	"EFAULT",	/* 14 */
640Sstevel@tonic-gate 	"ENOTBLK",	/* 15 */
650Sstevel@tonic-gate 	"EBUSY",	/* 16 */
660Sstevel@tonic-gate 	"EEXIST",	/* 17 */
670Sstevel@tonic-gate 	"EXDEV",	/* 18 */
680Sstevel@tonic-gate 	"ENODEV",	/* 19 */
690Sstevel@tonic-gate 	"ENOTDIR",	/* 20 */
700Sstevel@tonic-gate 	"EISDIR",	/* 21 */
710Sstevel@tonic-gate 	"EINVAL",	/* 22 */
720Sstevel@tonic-gate 	"ENFILE",	/* 23 */
730Sstevel@tonic-gate 	"EMFILE",	/* 24 */
740Sstevel@tonic-gate 	"ENOTTY",	/* 25 */
750Sstevel@tonic-gate 	"ETXTBSY",	/* 26 */
760Sstevel@tonic-gate 	"EFBIG",	/* 27 */
770Sstevel@tonic-gate 	"ENOSPC",	/* 28 */
780Sstevel@tonic-gate 	"ESPIPE",	/* 29 */
790Sstevel@tonic-gate 	"EROFS",	/* 30 */
800Sstevel@tonic-gate 	"EMLINK",	/* 31 */
810Sstevel@tonic-gate 	"EPIPE",	/* 32 */
820Sstevel@tonic-gate 	"EDOM",		/* 33 */
830Sstevel@tonic-gate 	"ERANGE",	/* 34 */
840Sstevel@tonic-gate 	"ENOMSG",	/* 35 */
850Sstevel@tonic-gate 	"EIDRM",	/* 36 */
860Sstevel@tonic-gate 	"ECHRNG",	/* 37 */
870Sstevel@tonic-gate 	"EL2NSYNC",	/* 38 */
880Sstevel@tonic-gate 	"EL3HLT",	/* 39 */
890Sstevel@tonic-gate 	"EL3RST",	/* 40 */
900Sstevel@tonic-gate 	"ELNRNG",	/* 41 */
910Sstevel@tonic-gate 	"EUNATCH",	/* 42 */
920Sstevel@tonic-gate 	"ENOCSI",	/* 43 */
930Sstevel@tonic-gate 	"EL2HLT",	/* 44 */
940Sstevel@tonic-gate 	"EDEADLK",	/* 45 */
950Sstevel@tonic-gate 	"ENOLCK",	/* 46 */
960Sstevel@tonic-gate 	"ECANCELED",	/* 47 */
970Sstevel@tonic-gate 	"ENOTSUP",	/* 48 */
980Sstevel@tonic-gate 	"EDQUOT",	/* 49 */
990Sstevel@tonic-gate 	"EBADE",	/* 50 */
1000Sstevel@tonic-gate 	"EBADR",	/* 51 */
1010Sstevel@tonic-gate 	"EXFULL",	/* 52 */
1020Sstevel@tonic-gate 	"ENOANO",	/* 53 */
1030Sstevel@tonic-gate 	"EBADRQC",	/* 54 */
1040Sstevel@tonic-gate 	"EBADSLT",	/* 55 */
1050Sstevel@tonic-gate 	"EDEADLOCK",	/* 56 */
1060Sstevel@tonic-gate 	"EBFONT",	/* 57 */
1070Sstevel@tonic-gate 	"EOWNERDEAD",	/* 58 */
1080Sstevel@tonic-gate 	"ENOTRECOVERABLE",	/* 59 */
1090Sstevel@tonic-gate 	"ENOSTR",	/* 60 */
1100Sstevel@tonic-gate 	"ENODATA",	/* 61 */
1110Sstevel@tonic-gate 	"ETIME",	/* 62 */
1120Sstevel@tonic-gate 	"ENOSR",	/* 63 */
1130Sstevel@tonic-gate 	"ENONET",	/* 64 */
1140Sstevel@tonic-gate 	"ENOPKG",	/* 65 */
1150Sstevel@tonic-gate 	"EREMOTE",	/* 66 */
1160Sstevel@tonic-gate 	"ENOLINK",	/* 67 */
1170Sstevel@tonic-gate 	"EADV",		/* 68 */
1180Sstevel@tonic-gate 	"ESRMNT",	/* 69 */
1190Sstevel@tonic-gate 	"ECOMM",	/* 70 */
1200Sstevel@tonic-gate 	"EPROTO",	/* 71 */
1210Sstevel@tonic-gate 	"ELOCKUNMAPPED",	/* 72 */
1220Sstevel@tonic-gate 	"ENOTACTIVE",	/* 73 */
1230Sstevel@tonic-gate 	"EMULTIHOP",	/* 74 */
1240Sstevel@tonic-gate 	NULL,		/* 75 */
1250Sstevel@tonic-gate 	NULL,		/* 76 */
1260Sstevel@tonic-gate 	"EBADMSG",	/* 77 */
1270Sstevel@tonic-gate 	"ENAMETOOLONG",	/* 78 */
1280Sstevel@tonic-gate 	"EOVERFLOW",	/* 79 */
1290Sstevel@tonic-gate 	"ENOTUNIQ",	/* 80 */
1300Sstevel@tonic-gate 	"EBADFD",	/* 81 */
1310Sstevel@tonic-gate 	"EREMCHG",	/* 82 */
1320Sstevel@tonic-gate 	"ELIBACC",	/* 83 */
1330Sstevel@tonic-gate 	"ELIBBAD",	/* 84 */
1340Sstevel@tonic-gate 	"ELIBSCN",	/* 85 */
1350Sstevel@tonic-gate 	"ELIBMAX",	/* 86 */
1360Sstevel@tonic-gate 	"ELIBEXEC",	/* 87 */
1370Sstevel@tonic-gate 	"EILSEQ",	/* 88 */
1380Sstevel@tonic-gate 	"ENOSYS",	/* 89 */
1390Sstevel@tonic-gate 	"ELOOP",	/* 90 */
1400Sstevel@tonic-gate 	"ERESTART",	/* 91 */
1410Sstevel@tonic-gate 	"ESTRPIPE",	/* 92 */
1420Sstevel@tonic-gate 	"ENOTEMPTY",	/* 93 */
1430Sstevel@tonic-gate 	"EUSERS",	/* 94 */
1440Sstevel@tonic-gate 	"ENOTSOCK",	/* 95 */
1450Sstevel@tonic-gate 	"EDESTADDRREQ",	/* 96 */
1460Sstevel@tonic-gate 	"EMSGSIZE",	/* 97 */
1470Sstevel@tonic-gate 	"EPROTOTYPE",	/* 98 */
1480Sstevel@tonic-gate 	"ENOPROTOOPT",	/* 99 */
1490Sstevel@tonic-gate 	NULL,		/* 100 */
1500Sstevel@tonic-gate 	NULL,		/* 101 */
1510Sstevel@tonic-gate 	NULL,		/* 102 */
1520Sstevel@tonic-gate 	NULL,		/* 103 */
1530Sstevel@tonic-gate 	NULL,		/* 104 */
1540Sstevel@tonic-gate 	NULL,		/* 105 */
1550Sstevel@tonic-gate 	NULL,		/* 106 */
1560Sstevel@tonic-gate 	NULL,		/* 107 */
1570Sstevel@tonic-gate 	NULL,		/* 108 */
1580Sstevel@tonic-gate 	NULL,		/* 109 */
1590Sstevel@tonic-gate 	NULL,		/* 110 */
1600Sstevel@tonic-gate 	NULL,		/* 111 */
1610Sstevel@tonic-gate 	NULL,		/* 112 */
1620Sstevel@tonic-gate 	NULL,		/* 113 */
1630Sstevel@tonic-gate 	NULL,		/* 114 */
1640Sstevel@tonic-gate 	NULL,		/* 115 */
1650Sstevel@tonic-gate 	NULL,		/* 116 */
1660Sstevel@tonic-gate 	NULL,		/* 117 */
1670Sstevel@tonic-gate 	NULL,		/* 118 */
1680Sstevel@tonic-gate 	NULL,		/* 119 */
1690Sstevel@tonic-gate 	"EPROTONOSUPPORT",	/* 120 */
1700Sstevel@tonic-gate 	"ESOCKTNOSUPPORT",	/* 121 */
1710Sstevel@tonic-gate 	"EOPNOTSUPP",	/* 122 */
1720Sstevel@tonic-gate 	"EPFNOSUPPORT",	/* 123 */
1730Sstevel@tonic-gate 	"EAFNOSUPPORT",	/* 124 */
1740Sstevel@tonic-gate 	"EADDRINUSE",	/* 125 */
1750Sstevel@tonic-gate 	"EADDRNOTAVAIL", /* 126 */
1760Sstevel@tonic-gate 	"ENETDOWN",	/* 127 */
1770Sstevel@tonic-gate 	"ENETUNREACH",	/* 128 */
1780Sstevel@tonic-gate 	"ENETRESET",	/* 129 */
1790Sstevel@tonic-gate 	"ECONNABORTED",	/* 130 */
1800Sstevel@tonic-gate 	"ECONNRESET",	/* 131 */
1810Sstevel@tonic-gate 	"ENOBUFS",	/* 132 */
1820Sstevel@tonic-gate 	"EISCONN",	/* 133 */
1830Sstevel@tonic-gate 	"ENOTCONN",	/* 134 */
1840Sstevel@tonic-gate 	NULL,		/* 135 */
1850Sstevel@tonic-gate 	NULL,		/* 136 */
1860Sstevel@tonic-gate 	NULL,		/* 137 */
1870Sstevel@tonic-gate 	NULL,		/* 138 */
1880Sstevel@tonic-gate 	NULL,		/* 139 */
1890Sstevel@tonic-gate 	NULL,		/* 140 */
1900Sstevel@tonic-gate 	NULL,		/* 141 */
1910Sstevel@tonic-gate 	NULL,		/* 142 */
1920Sstevel@tonic-gate 	"ESHUTDOWN",	/* 143 */
1930Sstevel@tonic-gate 	"ETOOMANYREFS",	/* 144 */
1940Sstevel@tonic-gate 	"ETIMEDOUT",	/* 145 */
1950Sstevel@tonic-gate 	"ECONNREFUSED",	/* 146 */
1960Sstevel@tonic-gate 	"EHOSTDOWN",	/* 147 */
1970Sstevel@tonic-gate 	"EHOSTUNREACH",	/* 148 */
1980Sstevel@tonic-gate 	"EALREADY",	/* 149 */
1990Sstevel@tonic-gate 	"EINPROGRESS",	/* 150 */
2000Sstevel@tonic-gate 	"ESTALE"	/* 151 */
2010Sstevel@tonic-gate };
2020Sstevel@tonic-gate 
2030Sstevel@tonic-gate #define	NERRCODE	(sizeof (errcode) / sizeof (char *))
2040Sstevel@tonic-gate 
2050Sstevel@tonic-gate 
2060Sstevel@tonic-gate const char *
2070Sstevel@tonic-gate errname(int err)	/* return the error code name (NULL if none) */
2080Sstevel@tonic-gate {
2090Sstevel@tonic-gate 	const char *ename = NULL;
2100Sstevel@tonic-gate 
2110Sstevel@tonic-gate 	if (err >= 0 && err < NERRCODE)
2120Sstevel@tonic-gate 		ename = errcode[err];
2130Sstevel@tonic-gate 
2140Sstevel@tonic-gate 	return (ename);
2150Sstevel@tonic-gate }
2160Sstevel@tonic-gate 
2170Sstevel@tonic-gate 
2180Sstevel@tonic-gate const struct systable systable[] = {
2190Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2200Sstevel@tonic-gate {"_exit",	1, DEC, NOV, DEC},				/*   1 */
22111798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2220Sstevel@tonic-gate {"read",	3, DEC, NOV, DEC, IOB, UNS},			/*   3 */
2230Sstevel@tonic-gate {"write",	3, DEC, NOV, DEC, IOB, UNS},			/*   4 */
2240Sstevel@tonic-gate {"open",	3, DEC, NOV, STG, OPN, OCT},			/*   5 */
2250Sstevel@tonic-gate {"close",	1, DEC, NOV, DEC},				/*   6 */
22611798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
22711798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2280Sstevel@tonic-gate {"link",	2, DEC, NOV, STG, STG},				/*   9 */
2290Sstevel@tonic-gate {"unlink",	1, DEC, NOV, STG},				/*  10 */
23011798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2310Sstevel@tonic-gate {"chdir",	1, DEC, NOV, STG},				/*  12 */
2320Sstevel@tonic-gate {"time",	0, DEC, NOV},					/*  13 */
2330Sstevel@tonic-gate {"mknod",	3, DEC, NOV, STG, OCT, HEX},			/*  14 */
2340Sstevel@tonic-gate {"chmod",	2, DEC, NOV, STG, OCT},				/*  15 */
2350Sstevel@tonic-gate {"chown",	3, DEC, NOV, STG, DEC, DEC},			/*  16 */
2360Sstevel@tonic-gate {"brk",		1, DEC, NOV, HEX},				/*  17 */
2370Sstevel@tonic-gate {"stat",	2, DEC, NOV, STG, HEX},				/*  18 */
2380Sstevel@tonic-gate {"lseek",	3, DEC, NOV, DEC, DEX, WHN},			/*  19 */
2390Sstevel@tonic-gate {"getpid",	0, DEC, DEC},					/*  20 */
24011798SRoger.Faulkner@Sun.COM {"mount",	8, DEC, NOV, STG, STG, MTF, MFT, HEX, DEC, HEX, DEC}, /* 21 */
24111798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2424321Scasper {"setuid",	1, DEC, NOV, UNS},				/*  23 */
2434321Scasper {"getuid",	0, UNS, UNS},					/*  24 */
2440Sstevel@tonic-gate {"stime",	1, DEC, NOV, DEC},				/*  25 */
2450Sstevel@tonic-gate {"pcsample",	2, DEC, NOV, HEX, DEC},				/*  26 */
2460Sstevel@tonic-gate {"alarm",	1, DEC, NOV, UNS},				/*  27 */
2470Sstevel@tonic-gate {"fstat",	2, DEC, NOV, DEC, HEX},				/*  28 */
2480Sstevel@tonic-gate {"pause",	0, DEC, NOV},					/*  29 */
24911798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2500Sstevel@tonic-gate {"stty",	2, DEC, NOV, DEC, DEC},				/*  31 */
2510Sstevel@tonic-gate {"gtty",	2, DEC, NOV, DEC, DEC},				/*  32 */
2520Sstevel@tonic-gate {"access",	2, DEC, NOV, STG, ACC},				/*  33 */
2530Sstevel@tonic-gate {"nice",	1, DEC, NOV, DEC},				/*  34 */
2540Sstevel@tonic-gate {"statfs",	4, DEC, NOV, STG, HEX, DEC, DEC},		/*  35 */
2550Sstevel@tonic-gate {"sync",	0, DEC, NOV},					/*  36 */
2560Sstevel@tonic-gate {"kill",	2, DEC, NOV, DEC, SIG},				/*  37 */
2570Sstevel@tonic-gate {"fstatfs",	4, DEC, NOV, DEC, HEX, DEC, DEC},		/*  38 */
2580Sstevel@tonic-gate {"pgrpsys",	3, DEC, NOV, DEC, DEC, DEC},			/*  39 */
2592712Snn35248 {"uucopystr",	3, DEC, NOV, STG, RST, UNS},			/*  40 */
26011798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2610Sstevel@tonic-gate {"pipe",	0, DEC, DEC},					/*  42 */
2620Sstevel@tonic-gate {"times",	1, DEC, NOV, HEX},				/*  43 */
2630Sstevel@tonic-gate {"profil",	4, DEC, NOV, HEX, UNS, HEX, OCT},		/*  44 */
26411798SRoger.Faulkner@Sun.COM {"faccessat",	4, DEC, NOV, ATC, STG, ACC, DEC},		/*  45 */
2654321Scasper {"setgid",	1, DEC, NOV, UNS},				/*  46 */
2664321Scasper {"getgid",	0, UNS, UNS},					/*  47 */
26710927SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2680Sstevel@tonic-gate {"msgsys",	6, DEC, NOV, DEC, DEC, DEC, DEC, DEC, DEC},	/*  49 */
2690Sstevel@tonic-gate {"sysi86",	4, HEX, NOV, S86, HEX, HEX, HEX, DEC, DEC},	/*  50 */
2700Sstevel@tonic-gate {"acct",	1, DEC, NOV, STG},				/*  51 */
2710Sstevel@tonic-gate {"shmsys",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/*  52 */
2720Sstevel@tonic-gate {"semsys",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/*  53 */
2730Sstevel@tonic-gate {"ioctl",	3, DEC, NOV, DEC, IOC, IOA},			/*  54 */
2740Sstevel@tonic-gate {"uadmin",	3, DEC, NOV, DEC, DEC, DEC},			/*  55 */
27511798SRoger.Faulkner@Sun.COM {"fchownat",	5, DEC, NOV, ATC, STG, DEC, DEC, UTF},		/*  56 */
2760Sstevel@tonic-gate {"utssys",	4, DEC, NOV, HEX, DEC, UTS, HEX},		/*  57 */
2770Sstevel@tonic-gate {"fdsync",	2, DEC, NOV, DEC, FFG},				/*  58 */
2780Sstevel@tonic-gate {"execve",	3, DEC, NOV, STG, HEX, HEX},			/*  59 */
2790Sstevel@tonic-gate {"umask",	1, OCT, NOV, OCT},				/*  60 */
2800Sstevel@tonic-gate {"chroot",	1, DEC, NOV, STG},				/*  61 */
2810Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, HEX},			/*  62 */
2820Sstevel@tonic-gate {"ulimit",	2, DEX, NOV, ULM, DEC},				/*  63 */
28311798SRoger.Faulkner@Sun.COM {"renameat",	4, DEC, NOV, ATC, STG, ATC, STG},		/*  64 */
28411798SRoger.Faulkner@Sun.COM {"unlinkat",	3, DEC, NOV, ATC, STG, DEC},			/*  65 */
28511798SRoger.Faulkner@Sun.COM {"fstatat",	4, DEC, NOV, ATC, STG, HEX, UTF},		/*  66 */
28611798SRoger.Faulkner@Sun.COM {"fstatat64",	4, DEC, NOV, ATC, STG, HEX, UTF},		/*  67 */
28711798SRoger.Faulkner@Sun.COM {"openat",	4, DEC, NOV, ATC, STG, OPN, OCT},		/*  68 */
28811798SRoger.Faulkner@Sun.COM {"openat64",	4, DEC, NOV, ATC, STG, OPN, OCT},		/*  69 */
2890Sstevel@tonic-gate {"tasksys",	5, DEC, NOV, DEC, DEC, DEC, HEX, DEC},		/*  70 */
2900Sstevel@tonic-gate {"acctctl",	3, DEC, NOV, HEX, HEX, UNS},			/*  71 */
2910Sstevel@tonic-gate {"exacctsys",	6, DEC, NOV, DEC, IDT, DEC, HEX, DEC, HEX},	/*  72 */
2920Sstevel@tonic-gate {"getpagesizes", 2, DEC, NOV, HEX, DEC},			/*  73 */
2932447Snf202958 {"rctlsys",	6, DEC, NOV, RSC, STG, HEX, HEX, DEC, DEC},	/*  74 */
2944321Scasper {"sidsys",	4, UNS, UNS, DEC, DEC, DEC, DEC},		/*  75 */
29511798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2960Sstevel@tonic-gate {"lwp_park",	3, DEC, NOV, DEC, HEX, DEC},			/*  77 */
2970Sstevel@tonic-gate {"sendfilev",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/*  78 */
2980Sstevel@tonic-gate {"rmdir",	1, DEC, NOV, STG},				/*  79 */
2990Sstevel@tonic-gate {"mkdir",	2, DEC, NOV, STG, OCT},				/*  80 */
3000Sstevel@tonic-gate {"getdents",	3, DEC, NOV, DEC, HEX, UNS},			/*  81 */
3010Sstevel@tonic-gate {"privsys",	5, HEX, NOV, DEC, DEC, DEC, HEX, DEC},		/*  82 */
3020Sstevel@tonic-gate {"ucredsys",	3, DEC, NOV, DEC, DEC, HEX},			/*  83 */
3030Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEX, DEX},			/*  84 */
3040Sstevel@tonic-gate {"getmsg",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/*  85 */
3050Sstevel@tonic-gate {"putmsg",	4, DEC, NOV, DEC, HEX, HEX, SMF},		/*  86 */
30611798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3070Sstevel@tonic-gate {"lstat",	2, DEC, NOV, STG, HEX},				/*  88 */
3080Sstevel@tonic-gate {"symlink",	2, DEC, NOV, STG, STG},				/*  89 */
3090Sstevel@tonic-gate {"readlink",	3, DEC, NOV, STG, RLK, UNS},			/*  90 */
3100Sstevel@tonic-gate {"setgroups",	2, DEC, NOV, DEC, HEX},				/*  91 */
3110Sstevel@tonic-gate {"getgroups",	2, DEC, NOV, DEC, HEX},				/*  92 */
3120Sstevel@tonic-gate {"fchmod",	2, DEC, NOV, DEC, OCT},				/*  93 */
3130Sstevel@tonic-gate {"fchown",	3, DEC, NOV, DEC, DEC, DEC},			/*  94 */
3140Sstevel@tonic-gate {"sigprocmask",	3, DEC, NOV, SPM, HEX, HEX},			/*  95 */
3150Sstevel@tonic-gate {"sigsuspend",	1, DEC, NOV, HEX},				/*  96 */
3160Sstevel@tonic-gate {"sigaltstack",	2, DEC, NOV, HEX, HEX},				/*  97 */
3170Sstevel@tonic-gate {"sigaction",	3, DEC, NOV, SIG, HEX, HEX},			/*  98 */
3180Sstevel@tonic-gate {"sigpendsys",	2, DEC, NOV, DEC, HEX},				/*  99 */
3190Sstevel@tonic-gate {"context",	2, DEC, NOV, DEC, HEX},				/* 100 */
32011798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
32111798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3220Sstevel@tonic-gate {"statvfs",	2, DEC, NOV, STG, HEX},				/* 103 */
3230Sstevel@tonic-gate {"fstatvfs",	2, DEC, NOV, DEC, HEX},				/* 104 */
3240Sstevel@tonic-gate {"getloadavg",	2, DEC, NOV, HEX, DEC},				/* 105 */
3250Sstevel@tonic-gate {"nfssys",	2, DEC, NOV, DEC, HEX},				/* 106 */
3260Sstevel@tonic-gate {"waitid",	4, DEC, NOV, IDT, DEC, HEX, WOP},		/* 107 */
3270Sstevel@tonic-gate {"sigsendsys",	2, DEC, NOV, HEX, SIG},				/* 108 */
3280Sstevel@tonic-gate {"hrtsys",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 109 */
32910440SRoger.Faulkner@Sun.COM {"utimesys",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 110 */
3304806Sraf {"sigresend",	3, DEC, NOV, SIG, HEX, HEX},			/* 111 */
3310Sstevel@tonic-gate {"priocntlsys",	5, DEC, NOV, DEC, HEX, DEC, PC4, PC5},		/* 112 */
3320Sstevel@tonic-gate {"pathconf",	2, DEC, NOV, STG, PTC},				/* 113 */
3330Sstevel@tonic-gate {"mincore",	3, DEC, NOV, HEX, UNS, HEX},			/* 114 */
3340Sstevel@tonic-gate {"mmap",	6, HEX, NOV, HEX, UNS, MPR, MTY, DEC, DEC},	/* 115 */
3350Sstevel@tonic-gate {"mprotect",	3, DEC, NOV, HEX, UNS, MPR},			/* 116 */
3360Sstevel@tonic-gate {"munmap",	2, DEC, NOV, HEX, UNS},				/* 117 */
3370Sstevel@tonic-gate {"fpathconf",	2, DEC, NOV, DEC, PTC},				/* 118 */
3380Sstevel@tonic-gate {"vfork",	0, DEC, NOV},					/* 119 */
3390Sstevel@tonic-gate {"fchdir",	1, DEC, NOV, DEC},				/* 120 */
3400Sstevel@tonic-gate {"readv",	3, DEC, NOV, DEC, HEX, DEC},			/* 121 */
3410Sstevel@tonic-gate {"writev",	3, DEC, NOV, DEC, HEX, DEC},			/* 122 */
34211798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
34311798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
34411798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
34511798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
34610198SAli.Bahrami@Sun.COM {"mmapobj",	5, DEC, NOV, DEC, MOB, HEX, HEX, HEX},		/* 127 */
3470Sstevel@tonic-gate {"setrlimit",	2, DEC, NOV, RLM, HEX},				/* 128 */
3480Sstevel@tonic-gate {"getrlimit",	2, DEC, NOV, RLM, HEX},				/* 129 */
3490Sstevel@tonic-gate {"lchown",	3, DEC, NOV, STG, DEC, DEC},			/* 130 */
3500Sstevel@tonic-gate {"memcntl",	6, DEC, NOV, HEX, UNS, MCF, MC4, MC5, DEC},	/* 131 */
3510Sstevel@tonic-gate {"getpmsg",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 132 */
3520Sstevel@tonic-gate {"putpmsg",	5, DEC, NOV, DEC, HEX, HEX, DEC, HHX},		/* 133 */
3530Sstevel@tonic-gate {"rename",	2, DEC, NOV, STG, STG},				/* 134 */
3540Sstevel@tonic-gate {"uname",	1, DEC, NOV, HEX},				/* 135 */
3554321Scasper {"setegid",	1, DEC, NOV, UNS},				/* 136 */
3560Sstevel@tonic-gate {"sysconfig",	1, DEC, NOV, CNF},				/* 137 */
3570Sstevel@tonic-gate {"adjtime",	2, DEC, NOV, HEX, HEX},				/* 138 */
3580Sstevel@tonic-gate {"sysinfo",	3, DEC, NOV, INF, RST, DEC},			/* 139 */
3593957Sth199096 {"sharefs",	3, DEC, NOV, DEC, HEX, DEC},			/* 140 */
3604321Scasper {"seteuid",	1, DEC, NOV, UNS},				/* 141 */
3613235Sraf {"forksys",	2, DEC, NOV, DEC, HHX},				/* 142 */
36211798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3630Sstevel@tonic-gate {"sigtimedwait", 3, DEC, NOV, HEX, HEX, HEX},			/* 144 */
3640Sstevel@tonic-gate {"lwp_info",	1, DEC, NOV, HEX},				/* 145 */
3650Sstevel@tonic-gate {"yield",	0, DEC, NOV},					/* 146 */
36611798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3670Sstevel@tonic-gate {"lwp_sema_post", 1, DEC, NOV, HEX},				/* 148 */
3680Sstevel@tonic-gate {"lwp_sema_trywait", 1, DEC, NOV, HEX},				/* 149 */
3690Sstevel@tonic-gate {"lwp_detach",	1, DEC, NOV, DEC},				/* 150 */
3700Sstevel@tonic-gate {"corectl",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/* 151 */
3710Sstevel@tonic-gate {"modctl",	5, DEC, NOV, MOD, HEX, HEX, HEX, HEX},		/* 152 */
3720Sstevel@tonic-gate {"fchroot",	1, DEC, NOV, DEC},				/* 153 */
37311798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3740Sstevel@tonic-gate {"vhangup",	0, DEC, NOV},					/* 155 */
3750Sstevel@tonic-gate {"gettimeofday", 1, DEC, NOV, HEX},				/* 156 */
3760Sstevel@tonic-gate {"getitimer",	2, DEC, NOV, ITM, HEX},				/* 157 */
3770Sstevel@tonic-gate {"setitimer",	3, DEC, NOV, ITM, HEX, HEX},			/* 158 */
3780Sstevel@tonic-gate {"lwp_create",	3, DEC, NOV, HEX, LWF, HEX},			/* 159 */
3790Sstevel@tonic-gate {"lwp_exit",	0, DEC, NOV},					/* 160 */
3800Sstevel@tonic-gate {"lwp_suspend",	1, DEC, NOV, DEC},				/* 161 */
3810Sstevel@tonic-gate {"lwp_continue", 1, DEC, NOV, DEC},				/* 162 */
3820Sstevel@tonic-gate {"lwp_kill",	2, DEC, NOV, DEC, SIG},				/* 163 */
3830Sstevel@tonic-gate {"lwp_self",	0, DEC, NOV},					/* 164 */
38411913SRoger.Faulkner@Sun.COM {"lwp_sigmask",	5, HEX, HEX, SPM, HEX, HEX, HEX, HEX},		/* 165 */
3850Sstevel@tonic-gate {"lwp_private",	3, HEX, NOV, DEC, DEC, HEX},			/* 166 */
3860Sstevel@tonic-gate {"lwp_wait",	2, DEC, NOV, DEC, HEX},				/* 167 */
3874574Sraf {"lwp_mutex_wakeup", 2, DEC, NOV, HEX, DEC},			/* 168 */
38811798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3890Sstevel@tonic-gate {"lwp_cond_wait", 4, DEC, NOV, HEX, HEX, HEX, DEC},		/* 170 */
3900Sstevel@tonic-gate {"lwp_cond_signal", 1, DEC, NOV, HEX},				/* 171 */
3910Sstevel@tonic-gate {"lwp_cond_broadcast", 1, DEC, NOV, HEX},			/* 172 */
3920Sstevel@tonic-gate {"pread",	4, DEC, NOV, DEC, IOB, UNS, DEX},		/* 173 */
3930Sstevel@tonic-gate {"pwrite",	4, DEC, NOV, DEC, IOB, UNS, DEX},		/* 174 */
3940Sstevel@tonic-gate {"llseek",	4, LLO, NOV, DEC, LLO, HID, WHN},		/* 175 */
3950Sstevel@tonic-gate {"inst_sync",	2, DEC, NOV, STG, DEC},				/* 176 */
3962712Snn35248 {"brand",	6, DEC, NOV, DEC, HEX, HEX, HEX, HEX, HEX},	/* 177 */
3970Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, HEX, HEX, HEX, HEX, HEX, HEX}, /* 178 */
3980Sstevel@tonic-gate {"cpc",		5, DEC, NOV, CPC, DEC, HEX, HEX, HEX},		/* 179 */
3990Sstevel@tonic-gate {"lgrpsys",	3, DEC, NOV, DEC, DEC, HEX},			/* 180 */
4003247Sgjelinek {"rusagesys",	5, DEC, NOV, DEC, HEX, DEC, HEX, HEX},		/* 181 */
4010Sstevel@tonic-gate {"portfs",	6, HEX, HEX, DEC, HEX, HEX, HEX, HEX, HEX},	/* 182 */
4020Sstevel@tonic-gate {"pollsys",	4, DEC, NOV, HEX, DEC, HEX, HEX},		/* 183 */
4031676Sjpk {"labelsys",	2, DEC, NOV, DEC, HEX},				/* 184 */
4040Sstevel@tonic-gate {"acl",		4, DEC, NOV, STG, ACL, DEC, HEX},		/* 185 */
4050Sstevel@tonic-gate {"auditsys",	4, DEC, NOV, AUD, HEX, HEX, HEX},		/* 186 */
4060Sstevel@tonic-gate {"processor_bind", 4, DEC, NOV, IDT, DEC, DEC, HEX},		/* 187 */
4070Sstevel@tonic-gate {"processor_info", 2, DEC, NOV, DEC, HEX},			/* 188 */
4080Sstevel@tonic-gate {"p_online",	2, DEC, NOV, DEC, DEC},				/* 189 */
4092248Sraf {"sigqueue",	5, DEC, NOV, DEC, SIG, HEX, SQC, DEC},		/* 190 */
4100Sstevel@tonic-gate {"clock_gettime", 2, DEC, NOV, DEC, HEX},			/* 191 */
4110Sstevel@tonic-gate {"clock_settime", 2, DEC, NOV, DEC, HEX},			/* 192 */
4120Sstevel@tonic-gate {"clock_getres", 2, DEC, NOV, DEC, HEX},			/* 193 */
4130Sstevel@tonic-gate {"timer_create", 3, DEC, NOV, DEC, HEX, HEX},			/* 194 */
4140Sstevel@tonic-gate {"timer_delete", 1, DEC, NOV, DEC},				/* 195 */
4150Sstevel@tonic-gate {"timer_settime", 4, DEC, NOV, DEC, DEC, HEX, HEX},		/* 196 */
4160Sstevel@tonic-gate {"timer_gettime", 2, DEC, NOV, DEC, HEX},			/* 197 */
4170Sstevel@tonic-gate {"timer_getoverrun", 1, DEC, NOV, DEC},				/* 198 */
4180Sstevel@tonic-gate {"nanosleep",	2, DEC, NOV, HEX, HEX},				/* 199 */
4190Sstevel@tonic-gate {"facl",	4, DEC, NOV, DEC, ACL, DEC, HEX},		/* 200 */
4200Sstevel@tonic-gate {"door",	6, DEC, NOV, DEC, HEX, HEX, HEX, HEX, DEC},	/* 201 */
4214321Scasper {"setreuid",	2, DEC, NOV, UN1, UN1},				/* 202 */
4224321Scasper {"setregid",	2, DEC, NOV, UN1, UN1},				/* 203 */
4230Sstevel@tonic-gate {"install_utrap", 3, DEC, NOV, DEC, HEX, HEX},			/* 204 */
4240Sstevel@tonic-gate {"signotify",	3, DEC, NOV, DEC, HEX, HEX},			/* 205 */
4250Sstevel@tonic-gate {"schedctl",	0, HEX, NOV},					/* 206 */
4260Sstevel@tonic-gate {"pset",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 207 */
4270Sstevel@tonic-gate {"sparc_utrap_install", 5, DEC, NOV, UTT, UTH, UTH, HEX, HEX},	/* 208 */
4280Sstevel@tonic-gate {"resolvepath",	3, DEC, NOV, STG, RLK, DEC},			/* 209 */
42910887SRoger.Faulkner@Sun.COM {"lwp_mutex_timedlock", 3, DEC, NOV, HEX, HEX, HEX},		/* 210 */
4300Sstevel@tonic-gate {"lwp_sema_timedwait", 3, DEC, NOV, HEX, HEX, DEC},		/* 211 */
4310Sstevel@tonic-gate {"lwp_rwlock_sys", 3, DEC, NOV, DEC, HEX, HEX},			/* 212 */
4320Sstevel@tonic-gate {"getdents64",	3, DEC, NOV, DEC, HEX, UNS},			/* 213 */
4330Sstevel@tonic-gate {"mmap64",	7, HEX, NOV, HEX, UNS, MPR, MTY, DEC, LLO, HID}, /* 214 */
4340Sstevel@tonic-gate {"stat64",	2, DEC, NOV, STG, HEX},				/* 215 */
4350Sstevel@tonic-gate {"lstat64",	2, DEC, NOV, STG, HEX},				/* 216 */
4360Sstevel@tonic-gate {"fstat64",	2, DEC, NOV, DEC, HEX},				/* 217 */
4370Sstevel@tonic-gate {"statvfs64",	2, DEC, NOV, STG, HEX},				/* 218 */
4380Sstevel@tonic-gate {"fstatvfs64",	2, DEC, NOV, DEC, HEX},				/* 219 */
4390Sstevel@tonic-gate {"setrlimit64",	2, DEC, NOV, RLM, HEX},				/* 220 */
4400Sstevel@tonic-gate {"getrlimit64",	2, DEC, NOV, RLM, HEX},				/* 221 */
4410Sstevel@tonic-gate {"pread64",	5, DEC, NOV, DEC, IOB, UNS, LLO, HID},		/* 222 */
4420Sstevel@tonic-gate {"pwrite64",	5, DEC, NOV, DEC, IOB, UNS, LLO, HID},		/* 223 */
44311798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
4440Sstevel@tonic-gate {"open64",	3, DEC, NOV, STG, OPN, OCT},			/* 225 */
4450Sstevel@tonic-gate {"rpcmod",	3, DEC, NOV, DEC, HEX},				/* 226 */
4460Sstevel@tonic-gate {"zone",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 227 */
4470Sstevel@tonic-gate {"autofssys",	2, DEC, NOV, DEC, HEX},				/* 228 */
4480Sstevel@tonic-gate {"getcwd",	3, DEC, NOV, RST, DEC},				/* 229 */
4490Sstevel@tonic-gate {"so_socket",	5, DEC, NOV, PFM, SKT, SKP, STG, SKV},		/* 230 */
4500Sstevel@tonic-gate {"so_socketpair", 1, DEC, NOV, HEX},				/* 231 */
4510Sstevel@tonic-gate {"bind",	4, DEC, NOV, DEC, HEX, DEC, SKV},		/* 232 */
4520Sstevel@tonic-gate {"listen",	3, DEC, NOV, DEC, DEC, SKV},			/* 233 */
4530Sstevel@tonic-gate {"accept",	4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 234 */
4540Sstevel@tonic-gate {"connect",	4, DEC, NOV, DEC, HEX, DEC, SKV},		/* 235 */
4550Sstevel@tonic-gate {"shutdown",	3, DEC, NOV, DEC, SHT, SKV},			/* 236 */
4560Sstevel@tonic-gate {"recv",	4, DEC, NOV, DEC, IOB, DEC, DEC},		/* 237 */
4570Sstevel@tonic-gate {"recvfrom",	6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, HEX},	/* 238 */
4580Sstevel@tonic-gate {"recvmsg",	3, DEC, NOV, DEC, HEX, DEC},			/* 239 */
4590Sstevel@tonic-gate {"send",	4, DEC, NOV, DEC, IOB, DEC, DEC},		/* 240 */
4600Sstevel@tonic-gate {"sendmsg",	3, DEC, NOV, DEC, HEX, DEC},			/* 241 */
4610Sstevel@tonic-gate {"sendto",	6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, DEC},	/* 242 */
4620Sstevel@tonic-gate {"getpeername", 4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 243 */
4630Sstevel@tonic-gate {"getsockname", 4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 244 */
4640Sstevel@tonic-gate {"getsockopt",	6, DEC, NOV, DEC, SOL, SON, HEX, HEX, SKV},	/* 245 */
4650Sstevel@tonic-gate {"setsockopt",	6, DEC, NOV, DEC, SOL, SON, HEX, DEC, SKV},	/* 246 */
466*12643SAnders.Persson@Sun.COM {"sockconfig",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 247 */
4670Sstevel@tonic-gate {"ntp_gettime",	1, DEC, NOV, HEX},				/* 248 */
4680Sstevel@tonic-gate {"ntp_adjtime",	1, DEC, NOV, HEX},				/* 249 */
4690Sstevel@tonic-gate {"lwp_mutex_unlock", 1, DEC, NOV, HEX},				/* 250 */
47010887SRoger.Faulkner@Sun.COM {"lwp_mutex_trylock", 2, DEC, NOV, HEX, HEX},			/* 251 */
4719264SRoger.Faulkner@Sun.COM {"lwp_mutex_register", 2, DEC, NOV, HEX, HEX},			/* 252 */
4720Sstevel@tonic-gate {"cladm",	3, DEC, NOV, CLC, CLF, HEX},			/* 253 */
4732712Snn35248 {"uucopy",	3, DEC, NOV, HEX, HEX, UNS},			/* 254 */
4740Sstevel@tonic-gate {"umount2",	2, DEC, NOV, STG, MTF},				/* 255 */
4750Sstevel@tonic-gate { NULL, -1, DEC, NOV},
4760Sstevel@tonic-gate };
4770Sstevel@tonic-gate 
4780Sstevel@tonic-gate /* SYSEND == max syscall number + 1 */
4790Sstevel@tonic-gate #define	SYSEND	((sizeof (systable) / sizeof (struct systable))-1)
4800Sstevel@tonic-gate 
4810Sstevel@tonic-gate 
4820Sstevel@tonic-gate /*
4830Sstevel@tonic-gate  * The following are for interpreting syscalls with sub-codes.
4840Sstevel@tonic-gate  */
4850Sstevel@tonic-gate 
48611798SRoger.Faulkner@Sun.COM const	struct systable	faccessattable[] = {
48711798SRoger.Faulkner@Sun.COM {"faccessat",	4, DEC, NOV, ATC, STG, ACC, DEC},		/*  0 */
48811798SRoger.Faulkner@Sun.COM {"access",	3, DEC, NOV, HID, STG, ACC},			/*  1 */
48911798SRoger.Faulkner@Sun.COM };
49011798SRoger.Faulkner@Sun.COM #define	NACCESSCODE	(sizeof (faccessattable) / sizeof (struct systable))
49111798SRoger.Faulkner@Sun.COM 
49211798SRoger.Faulkner@Sun.COM const	struct systable	fchownattable[] = {
49311798SRoger.Faulkner@Sun.COM {"fchownat",	5, DEC, NOV, ATC, STG, DEC, DEC, UTF},		/*  0 */
49411798SRoger.Faulkner@Sun.COM {"chown",	4, DEC, NOV, HID, STG, DEC, DEC},		/*  1 */
49511798SRoger.Faulkner@Sun.COM {"lchown",	4, DEC, NOV, HID, STG, DEC, DEC},		/*  2 */
49611798SRoger.Faulkner@Sun.COM {"fchown",	4, DEC, NOV, DEC, HID, DEC, DEC},		/*  3 */
49711798SRoger.Faulkner@Sun.COM };
49811798SRoger.Faulkner@Sun.COM #define	NCHOWNCODE	(sizeof (fchownattable) / sizeof (struct systable))
49911798SRoger.Faulkner@Sun.COM 
50011798SRoger.Faulkner@Sun.COM const	struct systable	renameattable[] = {
50111798SRoger.Faulkner@Sun.COM {"renameat",	4, DEC, NOV, ATC, STG, ATC, STG},		/*  0 */
50211798SRoger.Faulkner@Sun.COM {"rename",	4, DEC, NOV, HID, STG, HID, STG},		/*  1 */
50311798SRoger.Faulkner@Sun.COM };
50411798SRoger.Faulkner@Sun.COM #define	NRENAMECODE	(sizeof (renameattable) / sizeof (struct systable))
50511798SRoger.Faulkner@Sun.COM 
50611798SRoger.Faulkner@Sun.COM const	struct systable	unlinkattable[] = {
50711798SRoger.Faulkner@Sun.COM {"unlinkat",	3, DEC, NOV, ATC, STG, DEC},			/*  0 */
50811798SRoger.Faulkner@Sun.COM {"unlink",	2, DEC, NOV, HID, STG},				/*  1 */
50911798SRoger.Faulkner@Sun.COM {"rmdir",	2, DEC, NOV, HID, STG},				/*  2 */
51011798SRoger.Faulkner@Sun.COM };
51111798SRoger.Faulkner@Sun.COM #define	NUNLINKCODE	(sizeof (unlinkattable) / sizeof (struct systable))
51211798SRoger.Faulkner@Sun.COM 
51311798SRoger.Faulkner@Sun.COM const	struct systable	fstatattable[] = {
51411798SRoger.Faulkner@Sun.COM {"fstatat",	4, DEC, NOV, ATC, STG, HEX, UTF},		/*  0 */
51511798SRoger.Faulkner@Sun.COM {"stat",	3, DEC, NOV, HID, STG, HEX},			/*  1 */
51611798SRoger.Faulkner@Sun.COM {"lstat",	3, DEC, NOV, HID, STG, HEX},			/*  2 */
51711798SRoger.Faulkner@Sun.COM {"fstat",	3, DEC, NOV, DEC, HID, HEX},			/*  3 */
51811798SRoger.Faulkner@Sun.COM };
51911798SRoger.Faulkner@Sun.COM #define	NSTATCODE	(sizeof (fstatattable) / sizeof (struct systable))
52011798SRoger.Faulkner@Sun.COM 
52111798SRoger.Faulkner@Sun.COM const	struct systable	fstatat64table[] = {
52211798SRoger.Faulkner@Sun.COM {"fstatat64",	4, DEC, NOV, ATC, STG, HEX, UTF},		/*  0 */
52311798SRoger.Faulkner@Sun.COM {"stat64",	3, DEC, NOV, HID, STG, HEX},			/*  1 */
52411798SRoger.Faulkner@Sun.COM {"lstat64",	3, DEC, NOV, HID, STG, HEX},			/*  2 */
52511798SRoger.Faulkner@Sun.COM {"fstat64",	3, DEC, NOV, DEC, HID, HEX},			/*  3 */
52611798SRoger.Faulkner@Sun.COM };
52711798SRoger.Faulkner@Sun.COM #define	NSTAT64CODE	(sizeof (fstatat64table) / sizeof (struct systable))
52811798SRoger.Faulkner@Sun.COM 
52911798SRoger.Faulkner@Sun.COM const	struct systable openattable[] = {
53011798SRoger.Faulkner@Sun.COM {"openat",	3, DEC, NOV, ATC, STG, OPN},			/* 0 */
53111798SRoger.Faulkner@Sun.COM {"openat",	4, DEC, NOV, ATC, STG, OPN, OCT},		/* 1 */
53211798SRoger.Faulkner@Sun.COM {"open",	3, DEC, NOV, HID, STG, OPN},			/* 2 */
53311798SRoger.Faulkner@Sun.COM {"open",	4, DEC, NOV, HID, STG, OPN, OCT},		/* 3 */
53411798SRoger.Faulkner@Sun.COM };
53511798SRoger.Faulkner@Sun.COM #define	NOPENATCODE	(sizeof (openattable) / sizeof (struct systable))
53611798SRoger.Faulkner@Sun.COM 
53711798SRoger.Faulkner@Sun.COM const	struct systable openat64table[] = {
53811798SRoger.Faulkner@Sun.COM {"openat64",	3, DEC, NOV, ATC, STG, OPN},			/* 0 */
53911798SRoger.Faulkner@Sun.COM {"openat64",	4, DEC, NOV, ATC, STG, OPN, OCT},		/* 1 */
54011798SRoger.Faulkner@Sun.COM {"open64",	3, DEC, NOV, HID, STG, OPN},			/* 2 */
54111798SRoger.Faulkner@Sun.COM {"open64",	4, DEC, NOV, HID, STG, OPN, OCT},		/* 3 */
54211798SRoger.Faulkner@Sun.COM };
54311798SRoger.Faulkner@Sun.COM #define	NOPENAT64CODE	(sizeof (openat64table) / sizeof (struct systable))
54411798SRoger.Faulkner@Sun.COM 
5450Sstevel@tonic-gate const	struct systable opentable[] = {
5460Sstevel@tonic-gate {"open",	2, DEC, NOV, STG, OPN},				/* 0 */
5470Sstevel@tonic-gate {"open",	3, DEC, NOV, STG, OPN, OCT},			/* 1 */
5480Sstevel@tonic-gate };
5490Sstevel@tonic-gate #define	NOPENCODE	(sizeof (opentable) / sizeof (struct systable))
5500Sstevel@tonic-gate 
5510Sstevel@tonic-gate const	struct systable open64table[] = {
5520Sstevel@tonic-gate {"open64",	2, DEC, NOV, STG, OPN},				/* 0 */
5530Sstevel@tonic-gate {"open64",	3, DEC, NOV, STG, OPN, OCT},			/* 1 */
5540Sstevel@tonic-gate };
5550Sstevel@tonic-gate #define	NOPEN64CODE	(sizeof (open64table) / sizeof (struct systable))
5560Sstevel@tonic-gate 
5570Sstevel@tonic-gate const	struct systable fcntltable[] = {
5580Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, HEX},			/* 0: default */
5590Sstevel@tonic-gate {"fcntl",	2, DEC, NOV, DEC, FCN},				/* 1: no arg */
5600Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, FFG},			/* 2: F_SETFL */
5610Sstevel@tonic-gate };
5620Sstevel@tonic-gate #define	NFCNTLCODE	(sizeof (fcntltable) / sizeof (struct systable))
5630Sstevel@tonic-gate 
5640Sstevel@tonic-gate const	struct systable msgtable[] = {
5650Sstevel@tonic-gate {"msgget",	3, DEC, NOV, HID, KEY, MSF},			/* 0 */
5660Sstevel@tonic-gate {"msgctl",	4, DEC, NOV, HID, DEC, MSC, HEX},		/* 1 */
5670Sstevel@tonic-gate {"msgrcv",	6, DEC, NOV, HID, DEC, HEX, UNS, DEC, MSF},	/* 2 */
5680Sstevel@tonic-gate {"msgsnd",	5, DEC, NOV, HID, DEC, HEX, UNS, MSF},		/* 3 */
5690Sstevel@tonic-gate {"msgids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 4 */
5700Sstevel@tonic-gate {"msgsnap",	5, DEC, NOV, HID, DEC, HEX, UNS, DEC},		/* 5 */
5710Sstevel@tonic-gate };
5720Sstevel@tonic-gate #define	NMSGCODE	(sizeof (msgtable) / sizeof (struct systable))
5730Sstevel@tonic-gate 
5740Sstevel@tonic-gate const	struct systable semtable[] = {
5750Sstevel@tonic-gate {"semctl",	5, DEC, NOV, HID, DEC, DEC, SMC, DEX},		/* 0 */
5760Sstevel@tonic-gate {"semget",	4, DEC, NOV, HID, KEY, DEC, SEF},		/* 1 */
5770Sstevel@tonic-gate {"semop",	4, DEC, NOV, HID, DEC, HEX, UNS},		/* 2 */
5780Sstevel@tonic-gate {"semids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 3 */
5790Sstevel@tonic-gate {"semtimedop",	5, DEC, NOV, HID, DEC, HEX, UNS, HEX},		/* 4 */
5800Sstevel@tonic-gate };
5810Sstevel@tonic-gate #define	NSEMCODE	(sizeof (semtable) / sizeof (struct systable))
5820Sstevel@tonic-gate 
5830Sstevel@tonic-gate const	struct systable shmtable[] = {
5840Sstevel@tonic-gate {"shmat",	4, HEX, NOV, HID, DEC, DEX, SHF},		/* 0 */
5850Sstevel@tonic-gate {"shmctl",	4, DEC, NOV, HID, DEC, SHC, DEX},		/* 1 */
5860Sstevel@tonic-gate {"shmdt",	2, DEC, NOV, HID, HEX},				/* 2 */
5870Sstevel@tonic-gate {"shmget",	4, DEC, NOV, HID, KEY, UNS, SHF},		/* 3 */
5880Sstevel@tonic-gate {"shmids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 4 */
5890Sstevel@tonic-gate };
5900Sstevel@tonic-gate #define	NSHMCODE	(sizeof (shmtable) / sizeof (struct systable))
5910Sstevel@tonic-gate 
5920Sstevel@tonic-gate const	struct systable pidtable[] = {
5930Sstevel@tonic-gate {"getpgrp",	1, DEC, NOV, HID},				/* 0 */
5940Sstevel@tonic-gate {"setpgrp",	1, DEC, NOV, HID},				/* 1 */
5950Sstevel@tonic-gate {"getsid",	2, DEC, NOV, HID, DEC},				/* 2 */
5960Sstevel@tonic-gate {"setsid",	1, DEC, NOV, HID},				/* 3 */
5970Sstevel@tonic-gate {"getpgid",	2, DEC, NOV, HID, DEC},				/* 4 */
5980Sstevel@tonic-gate {"setpgid",	3, DEC, NOV, HID, DEC, DEC},			/* 5 */
5990Sstevel@tonic-gate };
6000Sstevel@tonic-gate #define	NPIDCODE	(sizeof (pidtable) / sizeof (struct systable))
6010Sstevel@tonic-gate 
6020Sstevel@tonic-gate const	struct systable sfstable[] = {
6030Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEX, DEX},			/* 0 */
6040Sstevel@tonic-gate {"sysfs",	2, DEC, NOV, SFS, STG},				/* 1 */
6050Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEC, RST},			/* 2 */
6060Sstevel@tonic-gate {"sysfs",	1, DEC, NOV, SFS},				/* 3 */
6070Sstevel@tonic-gate };
6080Sstevel@tonic-gate #define	NSFSCODE	(sizeof (sfstable) / sizeof (struct systable))
6090Sstevel@tonic-gate 
6100Sstevel@tonic-gate const	struct systable utstable[] = {
6110Sstevel@tonic-gate {"utssys",	3, DEC, NOV, HEX, DEC, UTS},			/* 0 */
6120Sstevel@tonic-gate {"utssys",	4, DEC, NOV, HEX, HEX, HEX, HEX},		/* err */
6130Sstevel@tonic-gate {"utssys",	3, DEC, NOV, HEX, HHX, UTS},			/* 2 */
6140Sstevel@tonic-gate {"utssys",	4, DEC, NOV, STG, FUI, UTS, HEX}		/* 3 */
6150Sstevel@tonic-gate };
6160Sstevel@tonic-gate #define	NUTSCODE	(sizeof (utstable) / sizeof (struct systable))
6170Sstevel@tonic-gate 
6182447Snf202958 const	struct systable rctltable[] = {
6192447Snf202958 {"getrctl",	6, DEC, NOV, HID, STG, HEX, HEX, HID, RGF},	/* 0 */
6202447Snf202958 {"setrctl",	6, DEC, NOV, HID, STG, HEX, HEX, HID, RSF},	/* 1 */
6212447Snf202958 {"rctlsys_lst",	6, DEC, NOV, HID, HID, HEX, HID, HEX, HID},	/* 2 */
6222447Snf202958 {"rctlsys_ctl",	6, DEC, NOV, HID, STG, HEX, HID, HID, RCF},	/* 3 */
6233684Srd117015 {"setprojrctl",	6, DEC, NOV, HID, STG, HID, HEX, HEX, SPF},	/* 4 */
6242447Snf202958 };
6252447Snf202958 #define	NRCTLCODE	(sizeof (rctltable) / sizeof (struct systable))
6262447Snf202958 
6270Sstevel@tonic-gate const	struct systable sgptable[] = {
6280Sstevel@tonic-gate {"sigpendsys",	2, DEC, NOV, DEC, HEX},				/* err */
6290Sstevel@tonic-gate {"sigpending",	2, DEC, NOV, HID, HEX},				/* 1 */
6300Sstevel@tonic-gate {"sigfillset",	2, DEC, NOV, HID, HEX},				/* 2 */
6310Sstevel@tonic-gate };
6320Sstevel@tonic-gate #define	NSGPCODE	(sizeof (sgptable) / sizeof (struct systable))
6330Sstevel@tonic-gate 
6340Sstevel@tonic-gate const	struct systable ctxtable[] = {
6350Sstevel@tonic-gate {"getcontext",	2, DEC, NOV, HID, HEX},				/* 0 */
6360Sstevel@tonic-gate {"setcontext",	2, DEC, NOV, HID, HEX},				/* 1 */
6370Sstevel@tonic-gate {"getustack",	2, DEC, NOV, HID, HEX},				/* 2 */
6380Sstevel@tonic-gate {"setustack",	2, DEC, NOV, HID, HEX},				/* 3 */
6390Sstevel@tonic-gate };
6400Sstevel@tonic-gate #define	NCTXCODE	(sizeof (ctxtable) / sizeof (struct systable))
6410Sstevel@tonic-gate 
6420Sstevel@tonic-gate const	struct systable hrttable[] = {
6430Sstevel@tonic-gate {"hrtcntl",	5, DEC, NOV, HID, DEC, DEC, HEX, HEX},		/* 0 */
6440Sstevel@tonic-gate {"hrtalarm",	3, DEC, NOV, HID, HEX, DEC},			/* 1 */
6450Sstevel@tonic-gate {"hrtsleep",	2, DEC, NOV, HID, HEX},				/* 2 */
6460Sstevel@tonic-gate {"hrtcancel",	3, DEC, NOV, HID, HEX, DEC},			/* 3 */
6470Sstevel@tonic-gate };
6480Sstevel@tonic-gate #define	NHRTCODE	(sizeof (hrttable) / sizeof (struct systable))
6490Sstevel@tonic-gate 
6500Sstevel@tonic-gate const	struct systable cortable[] = {
6510Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, HEX, HEX, HEX},		/* 0 */
6520Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCO},				/* 1 */
6530Sstevel@tonic-gate {"corectl",	1, HHX, NOV, COR},				/* 2 */
6540Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, STG, DEC},			/* 3 */
6550Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RST, DEC},			/* 4 */
6560Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, STG, DEC, DEC},		/* 5 */
6570Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, RST, DEC, DEC},		/* 6 */
6580Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCC},				/* 7 */
6590Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, RCC},				/* 8 */
6600Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, CCC, DEC},			/* 9 */
6610Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RCC, DEC},			/* 10 */
6620Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, STG, DEC},			/* 11 */
6630Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RST, DEC},			/* 12 */
6640Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCC},				/* 13 */
6650Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, RCC},				/* 14 */
6660Sstevel@tonic-gate };
6670Sstevel@tonic-gate #define	NCORCODE	(sizeof (cortable) / sizeof (struct systable))
6680Sstevel@tonic-gate 
6690Sstevel@tonic-gate const	struct systable aiotable[] = {
6700Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 0 */
6710Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 1 */
6720Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, HEX, DEC},			/* 2 */
6730Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, DEC, HEX},			/* 3 */
6740Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 4 */
6750Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 5 */
6760Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 6 */
6770Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 7 */
6780Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, DEC},		/* 8 */
6790Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 9 */
6800Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 10 */
6810Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 11 */
6820Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 12 */
6830Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 13 */
6840Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, DEC},		/* 14 */
6850Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 15 */
6860Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 16 */
6870Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 17 */
6880Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 18 */
6890Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, DEC, HEX},			/* 19 */
6900Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 20 */
6910Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, HEX},		/* 21 */
6920Sstevel@tonic-gate };
6930Sstevel@tonic-gate #define	NAIOCODE	(sizeof (aiotable) / sizeof (struct systable))
6940Sstevel@tonic-gate 
6950Sstevel@tonic-gate const	struct systable doortable[] = {
6960Sstevel@tonic-gate {"door_create", 3, DEC, NOV, HEX, HEX, DFL},			/* 0 */
6970Sstevel@tonic-gate {"door_revoke", 1, DEC, NOV, DEC},				/* 1 */
6980Sstevel@tonic-gate {"door_info",	2, DEC, NOV, DEC, HEX},				/* 2 */
6990Sstevel@tonic-gate {"door_call",	2, DEC, NOV, DEC, HEX},				/* 3 */
7000Sstevel@tonic-gate {"door_return", 4, DEC, NOV, HEX, DEC, HEX, DEC},		/* 4 (old) */
7010Sstevel@tonic-gate {"door_cred",	1, DEC, NOV, HEX},				/* 5 (old) */
7020Sstevel@tonic-gate {"door_bind",	1, DEC, NOV, DEC},				/* 6 */
7030Sstevel@tonic-gate {"door_unbind", 0, DEC, NOV},					/* 7 */
7040Sstevel@tonic-gate {"door_unref",	0, DEC, NOV},					/* 8 */
7050Sstevel@tonic-gate {"door_ucred",	1, DEC, NOV, HEX},				/* 9 */
7060Sstevel@tonic-gate {"door_return", 5, DEC, NOV, HEX, DEC, HEX, HEX, DEC},		/* 10 */
7070Sstevel@tonic-gate {"door_getparam", 3, DEC, NOV, DEC, DPM, HEX},			/* 11 */
7080Sstevel@tonic-gate {"door_setparam", 3, DEC, NOV, DEC, DPM, DEC},			/* 12 */
7090Sstevel@tonic-gate };
7100Sstevel@tonic-gate #define	NDOORCODE	(sizeof (doortable) / sizeof (struct systable))
7110Sstevel@tonic-gate 
7120Sstevel@tonic-gate const	struct systable psettable[] = {
7130Sstevel@tonic-gate {"pset_create", 2, DEC, NOV, HID, HEX},				/* 0 */
7140Sstevel@tonic-gate {"pset_destroy", 2, DEC, NOV, HID, PST},			/* 1 */
7150Sstevel@tonic-gate {"pset_assign",	4, DEC, NOV, HID, PST, DEC, HEX},		/* 2 */
7160Sstevel@tonic-gate {"pset_info",	5, DEC, NOV, HID, PST, HEX, HEX, HEX},		/* 3 */
7170Sstevel@tonic-gate {"pset_bind",	5, DEC, NOV, HID, PST, IDT, DEC, HEX},		/* 4 */
7180Sstevel@tonic-gate {"pset_getloadavg", 4, DEC, NOV, HID, PST, HEX, DEC},		/* 5 */
7190Sstevel@tonic-gate {"pset_list",	3, DEC, NOV, HID, HEX, HEX},			/* 6 */
7200Sstevel@tonic-gate {"pset_setattr", 3, DEC, NOV, HID, PST, HEX},			/* 7 */
7210Sstevel@tonic-gate {"pset_getattr", 3, DEC, NOV, HID, PST, HEX},			/* 8 */
7220Sstevel@tonic-gate {"pset_assign_forced",	4, DEC, NOV, HID, PST, DEC, HEX},	/* 9 */
7230Sstevel@tonic-gate };
7240Sstevel@tonic-gate #define	NPSETCODE	(sizeof (psettable) / sizeof (struct systable))
7250Sstevel@tonic-gate 
7260Sstevel@tonic-gate const	struct systable lwpcreatetable[] = {
7270Sstevel@tonic-gate {"lwp_create",	3, DEC, NOV, HEX, LWF, HEX},			/* 0 */
7280Sstevel@tonic-gate {"lwp_create",	0, DEC, NOV},					/* 1 */
7290Sstevel@tonic-gate };
7300Sstevel@tonic-gate #define	NLWPCREATECODE	(sizeof (lwpcreatetable) / sizeof (struct systable))
7310Sstevel@tonic-gate 
7320Sstevel@tonic-gate static	const	struct systable tasksystable[] = {
7330Sstevel@tonic-gate {"settaskid",	3, DEC, NOV, HID, DEC, HEX},			/* 0 */
7340Sstevel@tonic-gate {"gettaskid",	1, DEC, NOV, HID},				/* 1 */
7350Sstevel@tonic-gate {"getprojid",	1, DEC, NOV, HID},				/* 2 */
7360Sstevel@tonic-gate };
7370Sstevel@tonic-gate #define	NTASKSYSCODE	(sizeof (tasksystable) / sizeof (struct systable))
7380Sstevel@tonic-gate 
7390Sstevel@tonic-gate static const	struct systable privsystable[] = {
7400Sstevel@tonic-gate {"setppriv",		4, DEC, NOV, HID, PRO, PRN, PRS},	/* 0 */
7410Sstevel@tonic-gate {"getppriv",		4, DEC, NOV, HID, HID, PRN, PRS},	/* 1 */
7420Sstevel@tonic-gate {"getprivimplinfo",	5, DEC, NOV, HID, HID, HID, HEX, DEC},	/* 2 */
7430Sstevel@tonic-gate {"setpflags",		3, DEC, NOV, HID, PFL, DEC},		/* 3 */
7440Sstevel@tonic-gate {"getpflags",		2, DEC, NOV, HID, PFL},			/* 4 */
7454321Scasper {"issetugid",		0, DEC, NOV, HID},			/* 5 */
7460Sstevel@tonic-gate };
7470Sstevel@tonic-gate #define	NPRIVSYSCODE	(sizeof (privsystable) / sizeof (struct systable))
7480Sstevel@tonic-gate 
7490Sstevel@tonic-gate static	const	struct systable exacctsystable[] = {
7500Sstevel@tonic-gate {"getacct",	5, DEC, NOV, HID, IDT, DEC, HEX, UNS},		/* 0 */
7510Sstevel@tonic-gate {"putacct",	6, DEC, NOV, HID, IDT, DEC, HEX, UNS, HEX},	/* 1 */
7520Sstevel@tonic-gate {"wracct",	4, DEC, NOV, HID, IDT, DEC, HEX},		/* 2 */
7530Sstevel@tonic-gate };
7540Sstevel@tonic-gate #define	NEXACCTSYSCODE	(sizeof (exacctsystable) / sizeof (struct systable))
7550Sstevel@tonic-gate 
7560Sstevel@tonic-gate static	const	struct systable lwpparktable[] = {
7570Sstevel@tonic-gate {"lwp_park",	3, DEC, NOV, HID, HEX, DEC},			/* 0 */
7580Sstevel@tonic-gate {"lwp_unpark",	2, DEC, NOV, HID, DEC},				/* 1 */
7590Sstevel@tonic-gate {"lwp_unpark_all", 3, DEC, NOV, HID, HEX, DEC},			/* 2 */
7604389Ssl108498 {"lwp_unpark_cancel",	2, DEC, NOV, HID, DEC},			/* 3 */
7614389Ssl108498 {"lwp_set_park",	3, DEC, NOV, HID, HEX, DEC},		/* 4 */
7620Sstevel@tonic-gate };
7630Sstevel@tonic-gate #define	NLWPPARKCODE	(sizeof (lwpparktable) / sizeof (struct systable))
7640Sstevel@tonic-gate 
7650Sstevel@tonic-gate static	const	struct systable lwprwlocktable[] = {
7660Sstevel@tonic-gate {"lwp_rwlock_rdlock", 3, DEC, NOV, HID, HEX, HEX},		/* 0 */
7670Sstevel@tonic-gate {"lwp_rwlock_wrlock", 3, DEC, NOV, HID, HEX, HEX},		/* 1 */
7680Sstevel@tonic-gate {"lwp_rwlock_tryrdlock", 2, DEC, NOV, HID, HEX},		/* 2 */
7690Sstevel@tonic-gate {"lwp_rwlock_trywrlock", 2, DEC, NOV, HID, HEX},		/* 3 */
7700Sstevel@tonic-gate {"lwp_rwlock_unlock", 2, DEC, NOV, HID, HEX},			/* 4 */
7710Sstevel@tonic-gate };
7720Sstevel@tonic-gate #define	NLWPRWLOCKCODE	(sizeof (lwprwlocktable) / sizeof (struct systable))
7730Sstevel@tonic-gate 
7740Sstevel@tonic-gate static	const	struct systable sendfilevsystable[] = {
7750Sstevel@tonic-gate {"sendfilev",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/* 0 */
7760Sstevel@tonic-gate {"sendfilev64",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/* 1 */
7770Sstevel@tonic-gate };
7780Sstevel@tonic-gate #define	NSENDFILESYSCODE \
7790Sstevel@tonic-gate 		(sizeof (sendfilevsystable) / sizeof (struct systable))
7800Sstevel@tonic-gate 
7810Sstevel@tonic-gate static	const	struct systable lgrpsystable[] = {
7820Sstevel@tonic-gate {"meminfo",		3, DEC, NOV, HID, NOV, MIF},		/* 0 */
7830Sstevel@tonic-gate {"_lgrpsys",		3, DEC, NOV, DEC, DEC, NOV},		/* 1 */
7840Sstevel@tonic-gate {"lgrp_version",	3, DEC, NOV, HID, DEC, NOV},		/* 2 */
7850Sstevel@tonic-gate {"_lgrpsys",		3, DEC, NOV, DEC, HEX, HEX},		/* 3 */
7860Sstevel@tonic-gate {"lgrp_affinity_get",	3, DEC, NOV, HID, NOV, LAF},		/* 4 */
7870Sstevel@tonic-gate {"lgrp_affinity_set",	3, DEC, NOV, HID, NOV, LAF},		/* 5 */
7880Sstevel@tonic-gate {"lgrp_latency",	3, DEC, NOV, HID, DEC, DEC},		/* 6 */
7890Sstevel@tonic-gate };
7900Sstevel@tonic-gate #define	NLGRPSYSCODE	(sizeof (lgrpsystable) / sizeof (struct systable))
7910Sstevel@tonic-gate 
7920Sstevel@tonic-gate static	const	struct systable rusagesystable[] = {
7930Sstevel@tonic-gate {"getrusage",		2, DEC, NOV, HID, HEX},			/* 0 */
7940Sstevel@tonic-gate {"getrusage_chld",	2, DEC, NOV, HID, HEX},			/* 1 */
7950Sstevel@tonic-gate {"getrusage_lwp",	2, DEC, NOV, HID, HEX},			/* 2 */
7963247Sgjelinek {"getvmusage",		5, DEC, NOV, HID, HEX, DEC, HEX, HEX},	/* 3 */
7970Sstevel@tonic-gate };
7980Sstevel@tonic-gate #define	NRUSAGESYSCODE \
7990Sstevel@tonic-gate 		(sizeof (rusagesystable) / sizeof (struct systable))
8000Sstevel@tonic-gate 
8010Sstevel@tonic-gate static const	struct systable ucredsystable[] = {
8020Sstevel@tonic-gate {"ucred_get",	3, DEC, NOV, HID, DEC, HEX},
8030Sstevel@tonic-gate {"getpeerucred", 3, DEC, NOV, HID, DEC, HEX},
8040Sstevel@tonic-gate };
8050Sstevel@tonic-gate #define	NUCREDSYSCODE \
8060Sstevel@tonic-gate 		(sizeof (ucredsystable) / sizeof (struct systable))
8070Sstevel@tonic-gate 
8080Sstevel@tonic-gate const	struct systable portfstable[] = {
8090Sstevel@tonic-gate {"port_create",	2, DEC, NOV, HID, DEC},				/* 0 */
8100Sstevel@tonic-gate {"port_associate",	6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX}, /* 1 */
8110Sstevel@tonic-gate {"port_dissociate",	4, DEC, NOV, HID, DEC, DEC, HEX}, 	/* 2 */
8120Sstevel@tonic-gate {"port_send",	4, DEC, NOV, HID, DEC, HEX, HEX},		/* 3 */
8130Sstevel@tonic-gate {"port_sendn",	6, DEC, DEC, HID, HEX, HEX, DEC, HEX, HEX},	/* 4 */
8140Sstevel@tonic-gate {"port_get",	4, DEC, NOV, HID, DEC, HEX, HEX},		/* 5 */
8150Sstevel@tonic-gate {"port_getn",	6, DEC, DEC, HID, DEC, HEX, DEC, DEC, HEX},	/* 6 */
8160Sstevel@tonic-gate {"port_alert",	5, DEC, NOV, HID, DEC, HEX, HEX, HEX},		/* 7 */
8170Sstevel@tonic-gate {"port_dispatch", 6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX},	/* 8 */
8180Sstevel@tonic-gate };
8190Sstevel@tonic-gate #define	NPORTCODE	(sizeof (portfstable) / sizeof (struct systable))
8200Sstevel@tonic-gate 
8210Sstevel@tonic-gate static const struct systable zonetable[] = {
822813Sdp {"zone_create",	2, DEC, NOV, HID, HEX},				/* 0 */
8230Sstevel@tonic-gate {"zone_destroy", 2, DEC, NOV, HID, DEC},			/* 1 */
8240Sstevel@tonic-gate {"zone_getattr", 5, DEC, NOV, HID, DEC, ZGA, HEX, DEC},		/* 2 */
8250Sstevel@tonic-gate {"zone_enter",	2, DEC, NOV, HID, DEC},				/* 3 */
8260Sstevel@tonic-gate {"zone_list",	3, DEC, NOV, HID, HEX, HEX},			/* 4 */
8270Sstevel@tonic-gate {"zone_shutdown", 2, DEC, NOV, HID, DEC},			/* 5 */
8283235Sraf {"zone_lookup",	2, DEC, NOV, HID, STG},				/* 6 */
8293235Sraf {"zone_boot",	2, DEC, NOV, HID, DEC},				/* 7 */
830813Sdp {"zone_version", 2, HEX, NOV, HID, DEC},			/* 8 */
8312267Sdp {"zone_setattr", 5, DEC, NOV, HID, DEC, ZGA, HEX, DEC},		/* 9 */
8323448Sdh155122 {"zone_add_datalink", 3, DEC, NOV, HID, DEC, STG},		/* 10 */
8333448Sdh155122 {"zone_remove_datalink", 3, DEC, NOV, HID, DEC, STG},		/* 11 */
8343448Sdh155122 {"zone_check_datalink", 3, DEC, NOV, HID, HEX, STG},		/* 12 */
8353448Sdh155122 {"zone_list_datalink", 4, DEC, NOV, HID, DEC, HEX, HEX},	/* 13 */
8360Sstevel@tonic-gate };
8370Sstevel@tonic-gate #define	NZONECODE	(sizeof (zonetable) / sizeof (struct systable))
8380Sstevel@tonic-gate 
8391676Sjpk static const struct systable labeltable[] = {
8403235Sraf {"labelsys",	3, DEC, NOV, HID, HEX, HEX},			/* 0 */
8411676Sjpk {"is_system_labeled", 1, DEC, NOV, HID},			/* 1 */
8423235Sraf {"tnrh",	3, DEC, NOV, HID, TND, HEX},			/* 2 */
8433235Sraf {"tnrhtp",	3, DEC, NOV, HID, TND, HEX},			/* 3 */
8443235Sraf {"tnmlp",	3, DEC, NOV, HID, TND, HEX},			/* 4 */
8453235Sraf {"getlabel",	3, DEC, NOV, HID, STG, HEX},			/* 5 */
8463235Sraf {"fgetlabel",	3, DEC, NOV, HID, DEC, HEX},			/* 6 */
8471676Sjpk };
8481676Sjpk #define	NLABELCODE	(sizeof (labeltable) / sizeof (struct systable))
8491676Sjpk 
8503235Sraf const	struct systable forktable[] = {
8513235Sraf /* parent codes */
8523235Sraf {"forkx",	2, DEC, NOV, HID, FXF},				/* 0 */
8533235Sraf {"forkallx",	2, DEC, NOV, HID, FXF},				/* 1 */
8543235Sraf {"vforkx",	2, DEC, NOV, HID, FXF},				/* 2 */
8553235Sraf /* child codes */
8563235Sraf {"forkx",	0, DEC, NOV},					/* 3 */
8573235Sraf {"forkallx",	0, DEC, NOV},					/* 4 */
8583235Sraf {"vforkx",	0, DEC, NOV},					/* 5 */
8593235Sraf };
8603235Sraf #define	NFORKCODE	(sizeof (forktable) / sizeof (struct systable))
8613235Sraf 
8624321Scasper const	struct systable sidsystable[] = {
8634321Scasper {"allocids",	4, UNS, UNS, HID, DEC, DEC, DEC},		/* 0 */
8644321Scasper {"idmap_reg",	2, DEC, NOV, HID, DEC},				/* 1 */
8654321Scasper {"idmap_unreg",	2, DEC, NOV, HID, DEC},				/* 2 */
8664321Scasper };
8674321Scasper #define	NSIDSYSCODE	(sizeof (sidsystable) / sizeof (struct systable))
8684321Scasper 
86910440SRoger.Faulkner@Sun.COM const	struct systable utimesystable[] = {
87010440SRoger.Faulkner@Sun.COM {"futimens",	3, DEC, NOV, HID, DEC, HEX},			/* 0 */
87110440SRoger.Faulkner@Sun.COM {"utimensat",	5, DEC, NOV, HID, ATC, STG, HEX, UTF},		/* 1 */
87210440SRoger.Faulkner@Sun.COM };
87310440SRoger.Faulkner@Sun.COM #define	NUTIMESYSCODE	(sizeof (utimesystable) / sizeof (struct systable))
87410440SRoger.Faulkner@Sun.COM 
875*12643SAnders.Persson@Sun.COM const	struct systable sockconfigtable[] = {
876*12643SAnders.Persson@Sun.COM {"sockconfig", 5, DEC, NOV, SKC, DEC, DEC, DEC, STG},	/* 0 */
877*12643SAnders.Persson@Sun.COM {"sockconfig", 4, DEC, NOV, SKC, DEC, DEC, DEC},	/* 1 */
878*12643SAnders.Persson@Sun.COM {"sockconfig", 3, DEC, NOV, SKC, STG, HEX },		/* 2 */
879*12643SAnders.Persson@Sun.COM {"sockconfig", 2, DEC, NOV, SKC, STG },			/* 3 */
880*12643SAnders.Persson@Sun.COM };
881*12643SAnders.Persson@Sun.COM #define	NSOCKCONFIGCODE	(sizeof (sockconfigtable) / sizeof (struct systable))
882*12643SAnders.Persson@Sun.COM 
8830Sstevel@tonic-gate const	struct sysalias sysalias[] = {
8840Sstevel@tonic-gate 	{ "exit",	SYS_exit	},
8853235Sraf 	{ "fork",	SYS_forksys	},
88611798SRoger.Faulkner@Sun.COM 	{ "fork1",	SYS_forksys	},
88711798SRoger.Faulkner@Sun.COM 	{ "forkall",	SYS_forksys	},
8883235Sraf 	{ "forkx",	SYS_forksys	},
8893235Sraf 	{ "forkallx",	SYS_forksys	},
8903235Sraf 	{ "vforkx",	SYS_forksys	},
8910Sstevel@tonic-gate 	{ "sbrk",	SYS_brk		},
8920Sstevel@tonic-gate 	{ "getppid",	SYS_getpid	},
8930Sstevel@tonic-gate 	{ "geteuid",	SYS_getuid	},
8940Sstevel@tonic-gate 	{ "getpgrp",	SYS_pgrpsys	},
8950Sstevel@tonic-gate 	{ "setpgrp",	SYS_pgrpsys	},
8960Sstevel@tonic-gate 	{ "getsid",	SYS_pgrpsys	},
8970Sstevel@tonic-gate 	{ "setsid",	SYS_pgrpsys	},
8980Sstevel@tonic-gate 	{ "getpgid",	SYS_pgrpsys	},
8990Sstevel@tonic-gate 	{ "setpgid",	SYS_pgrpsys	},
9000Sstevel@tonic-gate 	{ "getegid",	SYS_getgid	},
9010Sstevel@tonic-gate 	{ "msgget",	SYS_msgsys	},
9020Sstevel@tonic-gate 	{ "msgctl",	SYS_msgsys	},
9030Sstevel@tonic-gate 	{ "msgctl64",	SYS_msgsys	},
9040Sstevel@tonic-gate 	{ "msgrcv",	SYS_msgsys	},
9050Sstevel@tonic-gate 	{ "msgsnd",	SYS_msgsys	},
9060Sstevel@tonic-gate 	{ "msgids",	SYS_msgsys	},
9070Sstevel@tonic-gate 	{ "msgsnap",	SYS_msgsys	},
9080Sstevel@tonic-gate 	{ "msgop",	SYS_msgsys	},
9090Sstevel@tonic-gate 	{ "shmat",	SYS_shmsys	},
9100Sstevel@tonic-gate 	{ "shmctl",	SYS_shmsys	},
9110Sstevel@tonic-gate 	{ "shmctl64",	SYS_shmsys	},
9120Sstevel@tonic-gate 	{ "shmdt",	SYS_shmsys	},
9130Sstevel@tonic-gate 	{ "shmget",	SYS_shmsys	},
9140Sstevel@tonic-gate 	{ "shmids",	SYS_shmsys	},
9150Sstevel@tonic-gate 	{ "shmop",	SYS_shmsys	},
9160Sstevel@tonic-gate 	{ "semctl",	SYS_semsys	},
9170Sstevel@tonic-gate 	{ "semctl64",	SYS_semsys	},
9180Sstevel@tonic-gate 	{ "semget",	SYS_semsys	},
9190Sstevel@tonic-gate 	{ "semids",	SYS_semsys	},
9200Sstevel@tonic-gate 	{ "semop",	SYS_semsys	},
9210Sstevel@tonic-gate 	{ "semtimedop",	SYS_semsys	},
9220Sstevel@tonic-gate 	{ "uname",	SYS_utssys	},
9230Sstevel@tonic-gate 	{ "ustat",	SYS_utssys	},
9240Sstevel@tonic-gate 	{ "fusers",	SYS_utssys	},
9250Sstevel@tonic-gate 	{ "exec",	SYS_execve	},
9260Sstevel@tonic-gate 	{ "execl",	SYS_execve	},
9270Sstevel@tonic-gate 	{ "execv",	SYS_execve	},
9280Sstevel@tonic-gate 	{ "execle",	SYS_execve	},
9290Sstevel@tonic-gate 	{ "execlp",	SYS_execve	},
9300Sstevel@tonic-gate 	{ "execvp",	SYS_execve	},
9310Sstevel@tonic-gate 	{ "sigfillset",	SYS_sigpending	},
9320Sstevel@tonic-gate 	{ "getcontext",	SYS_context	},
9330Sstevel@tonic-gate 	{ "setcontext",	SYS_context	},
9340Sstevel@tonic-gate 	{ "getustack",	SYS_context	},
9350Sstevel@tonic-gate 	{ "setustack",	SYS_context	},
9360Sstevel@tonic-gate 	{ "hrtcntl",	SYS_hrtsys	},
9370Sstevel@tonic-gate 	{ "hrtalarm",	SYS_hrtsys	},
9380Sstevel@tonic-gate 	{ "hrtsleep",	SYS_hrtsys	},
9390Sstevel@tonic-gate 	{ "hrtcancel",	SYS_hrtsys	},
9400Sstevel@tonic-gate 	{ "aioread",	SYS_kaio	},
9410Sstevel@tonic-gate 	{ "aiowrite",	SYS_kaio	},
9420Sstevel@tonic-gate 	{ "aiowait",	SYS_kaio	},
9430Sstevel@tonic-gate 	{ "aiocancel",	SYS_kaio	},
9440Sstevel@tonic-gate 	{ "aionotify",	SYS_kaio	},
9450Sstevel@tonic-gate 	{ "audit",	SYS_auditsys	},
9460Sstevel@tonic-gate 	{ "door_create",	SYS_door	},
9470Sstevel@tonic-gate 	{ "door_revoke",	SYS_door	},
9480Sstevel@tonic-gate 	{ "door_info",		SYS_door	},
9490Sstevel@tonic-gate 	{ "door_call",		SYS_door	},
9500Sstevel@tonic-gate 	{ "door_return",	SYS_door	},
9510Sstevel@tonic-gate 	{ "door_bind",		SYS_door	},
9520Sstevel@tonic-gate 	{ "door_unbind",	SYS_door	},
9530Sstevel@tonic-gate 	{ "door_unref",		SYS_door	},
9540Sstevel@tonic-gate 	{ "door_ucred",		SYS_door	},
9550Sstevel@tonic-gate 	{ "door_getparam",	SYS_door	},
9560Sstevel@tonic-gate 	{ "door_setparam",	SYS_door	},
9570Sstevel@tonic-gate 	{ "pset_create",	SYS_pset	},
9580Sstevel@tonic-gate 	{ "pset_destroy",	SYS_pset	},
9590Sstevel@tonic-gate 	{ "pset_assign",	SYS_pset	},
9600Sstevel@tonic-gate 	{ "pset_info",		SYS_pset	},
9610Sstevel@tonic-gate 	{ "pset_bind",		SYS_pset	},
9620Sstevel@tonic-gate 	{ "pset_getloadavg",	SYS_pset	},
9630Sstevel@tonic-gate 	{ "pset_list",		SYS_pset	},
9640Sstevel@tonic-gate 	{ "pset_setattr",	SYS_pset	},
9650Sstevel@tonic-gate 	{ "pset_getattr",	SYS_pset	},
9660Sstevel@tonic-gate 	{ "pset_assign_forced",	SYS_pset	},
9670Sstevel@tonic-gate 	{ "settaskid",		SYS_tasksys	},
9680Sstevel@tonic-gate 	{ "gettaskid",		SYS_tasksys	},
9690Sstevel@tonic-gate 	{ "getprojid",		SYS_tasksys	},
9700Sstevel@tonic-gate 	{ "setppriv",		SYS_privsys	},
9710Sstevel@tonic-gate 	{ "getppriv",		SYS_privsys	},
9720Sstevel@tonic-gate 	{ "getprivimplinfo",	SYS_privsys	},
9730Sstevel@tonic-gate 	{ "setpflags",		SYS_privsys	},
9740Sstevel@tonic-gate 	{ "getpflags",		SYS_privsys	},
9750Sstevel@tonic-gate 	{ "getacct",		SYS_exacctsys	},
9760Sstevel@tonic-gate 	{ "putacct",		SYS_exacctsys	},
9770Sstevel@tonic-gate 	{ "wracct",		SYS_exacctsys	},
9780Sstevel@tonic-gate 	{ "lwp_cond_timedwait",	SYS_lwp_cond_wait },
97911798SRoger.Faulkner@Sun.COM 	{ "lwp_sema_wait",	SYS_lwp_sema_timedwait },
9800Sstevel@tonic-gate 	{ "lwp_park",		SYS_lwp_park	},
9810Sstevel@tonic-gate 	{ "lwp_unpark",		SYS_lwp_park	},
9820Sstevel@tonic-gate 	{ "lwp_unpark_all",	SYS_lwp_park	},
9830Sstevel@tonic-gate 	{ "lwp_rwlock_rdlock",	SYS_lwp_rwlock_sys },
9840Sstevel@tonic-gate 	{ "lwp_rwlock_wrlock",	SYS_lwp_rwlock_sys },
9850Sstevel@tonic-gate 	{ "lwp_rwlock_tryrdlock", SYS_lwp_rwlock_sys },
9860Sstevel@tonic-gate 	{ "lwp_rwlock_trywrlock", SYS_lwp_rwlock_sys },
9870Sstevel@tonic-gate 	{ "lwp_rwlock_unlock",	SYS_lwp_rwlock_sys },
98811798SRoger.Faulkner@Sun.COM 	{ "lwp_mutex_lock",	SYS_lwp_mutex_timedlock },
9890Sstevel@tonic-gate 	{ "sendfilev64",	SYS_sendfilev	},
99011798SRoger.Faulkner@Sun.COM 	{ "creat",		SYS_open	},
99111798SRoger.Faulkner@Sun.COM 	{ "creat64",		SYS_open64	},
99211798SRoger.Faulkner@Sun.COM 	{ "openattrdirat",	SYS_openat	},
9930Sstevel@tonic-gate 	{ "lgrpsys",		SYS_lgrpsys	},
9940Sstevel@tonic-gate 	{ "getrusage",		SYS_rusagesys	},
9950Sstevel@tonic-gate 	{ "getrusage_chld",	SYS_rusagesys	},
9960Sstevel@tonic-gate 	{ "getrusage_lwp",	SYS_rusagesys	},
9973247Sgjelinek 	{ "getvmusage",		SYS_rusagesys	},
9980Sstevel@tonic-gate 	{ "getpeerucred",	SYS_ucredsys	},
9990Sstevel@tonic-gate 	{ "ucred_get",		SYS_ucredsys	},
10000Sstevel@tonic-gate 	{ "port_create",	SYS_port	},
10010Sstevel@tonic-gate 	{ "port_associate",	SYS_port	},
10020Sstevel@tonic-gate 	{ "port_dissociate",	SYS_port	},
10030Sstevel@tonic-gate 	{ "port_send",		SYS_port	},
10040Sstevel@tonic-gate 	{ "port_sendn",		SYS_port	},
10050Sstevel@tonic-gate 	{ "port_get",		SYS_port	},
10060Sstevel@tonic-gate 	{ "port_getn",		SYS_port	},
10070Sstevel@tonic-gate 	{ "port_alert",		SYS_port	},
10080Sstevel@tonic-gate 	{ "port_dispatch",	SYS_port	},
10090Sstevel@tonic-gate 	{ "zone_create",	SYS_zone	},
10100Sstevel@tonic-gate 	{ "zone_destroy",	SYS_zone	},
10110Sstevel@tonic-gate 	{ "zone_getattr",	SYS_zone	},
10123247Sgjelinek 	{ "zone_setattr",	SYS_zone	},
10130Sstevel@tonic-gate 	{ "zone_enter",		SYS_zone	},
10140Sstevel@tonic-gate 	{ "getzoneid",		SYS_zone	},
10150Sstevel@tonic-gate 	{ "zone_list",		SYS_zone	},
10160Sstevel@tonic-gate 	{ "zone_shutdown",	SYS_zone	},
10173448Sdh155122 	{ "zone_add_datalink",	SYS_zone	},
10183448Sdh155122 	{ "zone_remove_datalink", SYS_zone	},
10193448Sdh155122 	{ "zone_check_datalink", SYS_zone	},
10203448Sdh155122 	{ "zone_list_datalink",	SYS_zone	},
10211676Sjpk 	{ "is_system_labeled",	SYS_labelsys	},
10221676Sjpk 	{ "tnrh",		SYS_labelsys	},
10231676Sjpk 	{ "tnrhtp",		SYS_labelsys	},
10241676Sjpk 	{ "tnmlp",		SYS_labelsys	},
10251676Sjpk 	{ "getlabel",		SYS_labelsys	},
10261676Sjpk 	{ "fgetlabel",		SYS_labelsys	},
10272447Snf202958 	{ "getrctl",		SYS_rctlsys	},
10282447Snf202958 	{ "setrctl",		SYS_rctlsys	},
10292447Snf202958 	{ "rctlsys_lst",	SYS_rctlsys	},
10302447Snf202958 	{ "rctlsys_ctl",	SYS_rctlsys	},
10314321Scasper 	{ "allocids",		SYS_sidsys	},
103210440SRoger.Faulkner@Sun.COM 	{ "futimens",		SYS_utimesys	},
103310440SRoger.Faulkner@Sun.COM 	{ "utimensat",		SYS_utimesys	},
103411798SRoger.Faulkner@Sun.COM 	{ "poll",		SYS_pollsys	},
103511798SRoger.Faulkner@Sun.COM 	{ "umount",		SYS_umount2	},
103611798SRoger.Faulkner@Sun.COM 	{ "wait",		SYS_waitid	},
10370Sstevel@tonic-gate 	{  NULL,	0	}	/* end-of-list */
10380Sstevel@tonic-gate };
10390Sstevel@tonic-gate 
10400Sstevel@tonic-gate /*
10410Sstevel@tonic-gate  * Return structure to interpret system call with sub-codes.
10420Sstevel@tonic-gate  */
10430Sstevel@tonic-gate const struct systable *
10440Sstevel@tonic-gate subsys(int syscall, int subcode)
10450Sstevel@tonic-gate {
10460Sstevel@tonic-gate 	const struct systable *stp = NULL;
10470Sstevel@tonic-gate 
10480Sstevel@tonic-gate 	if (subcode != -1) {
10490Sstevel@tonic-gate 		switch (syscall) {
105011798SRoger.Faulkner@Sun.COM 		case SYS_faccessat:
105111798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NACCESSCODE)
105211798SRoger.Faulkner@Sun.COM 				stp = &faccessattable[subcode];
105311798SRoger.Faulkner@Sun.COM 			break;
105411798SRoger.Faulkner@Sun.COM 		case SYS_fchownat:
105511798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NCHOWNCODE)
105611798SRoger.Faulkner@Sun.COM 				stp = &fchownattable[subcode];
105711798SRoger.Faulkner@Sun.COM 			break;
105811798SRoger.Faulkner@Sun.COM 		case SYS_renameat:
105911798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NRENAMECODE)
106011798SRoger.Faulkner@Sun.COM 				stp = &renameattable[subcode];
106111798SRoger.Faulkner@Sun.COM 			break;
106211798SRoger.Faulkner@Sun.COM 		case SYS_unlinkat:
106311798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NUNLINKCODE)
106411798SRoger.Faulkner@Sun.COM 				stp = &unlinkattable[subcode];
106511798SRoger.Faulkner@Sun.COM 			break;
106611798SRoger.Faulkner@Sun.COM 		case SYS_fstatat:
106711798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NSTATCODE)
106811798SRoger.Faulkner@Sun.COM 				stp = &fstatattable[subcode];
106911798SRoger.Faulkner@Sun.COM 			break;
107011798SRoger.Faulkner@Sun.COM 		case SYS_fstatat64:
107111798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NSTAT64CODE)
107211798SRoger.Faulkner@Sun.COM 				stp = &fstatat64table[subcode];
107311798SRoger.Faulkner@Sun.COM 			break;
107411798SRoger.Faulkner@Sun.COM 		case SYS_openat:
107511798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NOPENATCODE)
107611798SRoger.Faulkner@Sun.COM 				stp = &openattable[subcode];
107711798SRoger.Faulkner@Sun.COM 			break;
107811798SRoger.Faulkner@Sun.COM 		case SYS_openat64:
107911798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NOPENAT64CODE)
108011798SRoger.Faulkner@Sun.COM 				stp = &openat64table[subcode];
108111798SRoger.Faulkner@Sun.COM 			break;
10820Sstevel@tonic-gate 		case SYS_open:
10830Sstevel@tonic-gate 			if ((unsigned)subcode < NOPENCODE)
10840Sstevel@tonic-gate 				stp = &opentable[subcode];
10850Sstevel@tonic-gate 			break;
10860Sstevel@tonic-gate 		case SYS_open64:
10870Sstevel@tonic-gate 			if ((unsigned)subcode < NOPEN64CODE)
10880Sstevel@tonic-gate 				stp = &open64table[subcode];
10890Sstevel@tonic-gate 			break;
10900Sstevel@tonic-gate 		case SYS_msgsys:	/* msgsys() */
10910Sstevel@tonic-gate 			if ((unsigned)subcode < NMSGCODE)
10920Sstevel@tonic-gate 				stp = &msgtable[subcode];
10930Sstevel@tonic-gate 			break;
10940Sstevel@tonic-gate 		case SYS_semsys:	/* semsys() */
10950Sstevel@tonic-gate 			if ((unsigned)subcode < NSEMCODE)
10960Sstevel@tonic-gate 				stp = &semtable[subcode];
10970Sstevel@tonic-gate 			break;
10980Sstevel@tonic-gate 		case SYS_shmsys:	/* shmsys() */
10990Sstevel@tonic-gate 			if ((unsigned)subcode < NSHMCODE)
11000Sstevel@tonic-gate 				stp = &shmtable[subcode];
11010Sstevel@tonic-gate 			break;
11020Sstevel@tonic-gate 		case SYS_pgrpsys:	/* pgrpsys() */
11030Sstevel@tonic-gate 			if ((unsigned)subcode < NPIDCODE)
11040Sstevel@tonic-gate 				stp = &pidtable[subcode];
11050Sstevel@tonic-gate 			break;
11060Sstevel@tonic-gate 		case SYS_utssys:	/* utssys() */
11070Sstevel@tonic-gate 			if ((unsigned)subcode < NUTSCODE)
11080Sstevel@tonic-gate 				stp = &utstable[subcode];
11090Sstevel@tonic-gate 			break;
11100Sstevel@tonic-gate 		case SYS_sysfs:		/* sysfs() */
11110Sstevel@tonic-gate 			if ((unsigned)subcode < NSFSCODE)
11120Sstevel@tonic-gate 				stp = &sfstable[subcode];
11130Sstevel@tonic-gate 			break;
11140Sstevel@tonic-gate 		case SYS_sigpending:	/* sigpending()/sigfillset() */
11150Sstevel@tonic-gate 			if ((unsigned)subcode < NSGPCODE)
11160Sstevel@tonic-gate 				stp = &sgptable[subcode];
11170Sstevel@tonic-gate 			break;
11180Sstevel@tonic-gate 		case SYS_context:	/* [get|set]context() */
11190Sstevel@tonic-gate 			if ((unsigned)subcode < NCTXCODE)
11200Sstevel@tonic-gate 				stp = &ctxtable[subcode];
11210Sstevel@tonic-gate 			break;
11220Sstevel@tonic-gate 		case SYS_hrtsys:	/* hrtsys() */
11230Sstevel@tonic-gate 			if ((unsigned)subcode < NHRTCODE)
11240Sstevel@tonic-gate 				stp = &hrttable[subcode];
11250Sstevel@tonic-gate 			break;
11260Sstevel@tonic-gate 		case SYS_corectl:	/* corectl() */
11270Sstevel@tonic-gate 			if ((unsigned)subcode < NCORCODE)
11280Sstevel@tonic-gate 				stp = &cortable[subcode];
11290Sstevel@tonic-gate 			break;
11300Sstevel@tonic-gate 		case SYS_kaio:		/* kaio() */
11310Sstevel@tonic-gate 			if ((unsigned)subcode < NAIOCODE)
11320Sstevel@tonic-gate 				stp = &aiotable[subcode];
11330Sstevel@tonic-gate 			break;
11340Sstevel@tonic-gate 		case SYS_door:		/* doors */
11350Sstevel@tonic-gate 			if ((unsigned)subcode < NDOORCODE)
11360Sstevel@tonic-gate 				stp = &doortable[subcode];
11370Sstevel@tonic-gate 			break;
11380Sstevel@tonic-gate 		case SYS_pset:		/* pset() */
11390Sstevel@tonic-gate 			if ((unsigned)subcode < NPSETCODE)
11400Sstevel@tonic-gate 				stp = &psettable[subcode];
11410Sstevel@tonic-gate 			break;
11420Sstevel@tonic-gate 		case SYS_lwp_create:	/* lwp_create() */
11430Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPCREATECODE)
11440Sstevel@tonic-gate 				stp = &lwpcreatetable[subcode];
11450Sstevel@tonic-gate 			break;
11460Sstevel@tonic-gate 		case SYS_tasksys:	/* tasks */
11470Sstevel@tonic-gate 			if ((unsigned)subcode < NTASKSYSCODE)
11480Sstevel@tonic-gate 				stp = &tasksystable[subcode];
11490Sstevel@tonic-gate 			break;
11500Sstevel@tonic-gate 		case SYS_exacctsys:	/* exacct */
11510Sstevel@tonic-gate 			if ((unsigned)subcode < NEXACCTSYSCODE)
11520Sstevel@tonic-gate 				stp = &exacctsystable[subcode];
11530Sstevel@tonic-gate 			break;
11540Sstevel@tonic-gate 		case SYS_privsys:	/* privileges */
11550Sstevel@tonic-gate 			if ((unsigned)subcode < NPRIVSYSCODE)
11560Sstevel@tonic-gate 				stp = &privsystable[subcode];
11570Sstevel@tonic-gate 			break;
11580Sstevel@tonic-gate 		case SYS_lwp_park:	/* lwp_park */
11590Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPPARKCODE)
11600Sstevel@tonic-gate 				stp = &lwpparktable[subcode];
11610Sstevel@tonic-gate 			break;
11620Sstevel@tonic-gate 		case SYS_lwp_rwlock_sys:
11630Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPRWLOCKCODE)
11640Sstevel@tonic-gate 				stp = &lwprwlocktable[subcode];
11650Sstevel@tonic-gate 			break;
11660Sstevel@tonic-gate 		case SYS_sendfilev:	/* sendfilev */
11670Sstevel@tonic-gate 			if ((unsigned)subcode < NSENDFILESYSCODE)
11680Sstevel@tonic-gate 				stp = &sendfilevsystable[subcode];
11690Sstevel@tonic-gate 			break;
11700Sstevel@tonic-gate 		case SYS_lgrpsys:	/* lgrpsys */
11710Sstevel@tonic-gate 			if ((unsigned)subcode < NLGRPSYSCODE)
11720Sstevel@tonic-gate 				stp = &lgrpsystable[subcode];
11730Sstevel@tonic-gate 			break;
11740Sstevel@tonic-gate 		case SYS_rusagesys:	/* rusagesys */
11750Sstevel@tonic-gate 			if ((unsigned)subcode < NRUSAGESYSCODE)
11760Sstevel@tonic-gate 				stp = &rusagesystable[subcode];
11770Sstevel@tonic-gate 			break;
11780Sstevel@tonic-gate 		case SYS_fcntl:		/* fcntl */
11790Sstevel@tonic-gate 			if ((unsigned)subcode < NFCNTLCODE)
11800Sstevel@tonic-gate 				stp = &fcntltable[subcode];
11810Sstevel@tonic-gate 			break;
11820Sstevel@tonic-gate 		case SYS_ucredsys:
11830Sstevel@tonic-gate 			if ((unsigned)subcode < NUCREDSYSCODE)
11840Sstevel@tonic-gate 				stp = &ucredsystable[subcode];
11850Sstevel@tonic-gate 			break;
11860Sstevel@tonic-gate 		case SYS_port:	/* portfs */
11870Sstevel@tonic-gate 			if ((unsigned)subcode < NPORTCODE)
11880Sstevel@tonic-gate 				stp = &portfstable[subcode];
11890Sstevel@tonic-gate 			break;
11900Sstevel@tonic-gate 		case SYS_zone:		/* zone family */
11910Sstevel@tonic-gate 			if ((unsigned)subcode < NZONECODE)
11920Sstevel@tonic-gate 				stp = &zonetable[subcode];
11930Sstevel@tonic-gate 			break;
11941676Sjpk 		case SYS_labelsys:	/* label family */
11951676Sjpk 			if ((unsigned)subcode < NLABELCODE)
11961676Sjpk 				stp = &labeltable[subcode];
11971676Sjpk 			break;
11982447Snf202958 		case SYS_rctlsys:	/* rctl family */
11992447Snf202958 			if ((unsigned)subcode < NRCTLCODE)
12002447Snf202958 				stp = &rctltable[subcode];
12012447Snf202958 			break;
12023235Sraf 		case SYS_forksys:	/* fork family */
12033235Sraf 			if ((unsigned)subcode < NFORKCODE)
12043235Sraf 				stp = &forktable[subcode];
12053235Sraf 			break;
12064321Scasper 		case SYS_sidsys:	/* SID family */
12074321Scasper 			if ((unsigned)subcode < NSIDSYSCODE)
12084321Scasper 				stp = &sidsystable[subcode];
12094321Scasper 			break;
121010440SRoger.Faulkner@Sun.COM 		case SYS_utimesys:	/* utime family */
121110440SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NUTIMESYSCODE)
121210440SRoger.Faulkner@Sun.COM 				stp = &utimesystable[subcode];
121310440SRoger.Faulkner@Sun.COM 			break;
1214*12643SAnders.Persson@Sun.COM 		case SYS_sockconfig:	/* sockconfig family */
1215*12643SAnders.Persson@Sun.COM 			if ((unsigned)subcode < NSOCKCONFIGCODE)
1216*12643SAnders.Persson@Sun.COM 				stp = &sockconfigtable[subcode];
1217*12643SAnders.Persson@Sun.COM 			break;
12180Sstevel@tonic-gate 		}
12190Sstevel@tonic-gate 	}
12200Sstevel@tonic-gate 
12210Sstevel@tonic-gate 	if (stp == NULL)
12220Sstevel@tonic-gate 		stp = &systable[((unsigned)syscall < SYSEND)? syscall : 0];
12230Sstevel@tonic-gate 
12240Sstevel@tonic-gate 	return (stp);
12250Sstevel@tonic-gate }
12260Sstevel@tonic-gate 
12270Sstevel@tonic-gate /*
12280Sstevel@tonic-gate  * Return the name of the system call.
12290Sstevel@tonic-gate  */
12300Sstevel@tonic-gate const char *
12310Sstevel@tonic-gate sysname(private_t *pri, int syscall, int subcode)
12320Sstevel@tonic-gate {
12330Sstevel@tonic-gate 	const struct systable *stp = subsys(syscall, subcode);
12340Sstevel@tonic-gate 	const char *name = stp->name;	/* may be NULL */
12350Sstevel@tonic-gate 
12360Sstevel@tonic-gate 	if (name == NULL) {		/* manufacture a name */
12370Sstevel@tonic-gate 		(void) sprintf(pri->sys_name, "sys#%d", syscall);
12380Sstevel@tonic-gate 		name = pri->sys_name;
12390Sstevel@tonic-gate 	}
12400Sstevel@tonic-gate 
12410Sstevel@tonic-gate 	return (name);
12420Sstevel@tonic-gate }
12430Sstevel@tonic-gate 
12440Sstevel@tonic-gate /*
12450Sstevel@tonic-gate  * Return the name of the signal.
12460Sstevel@tonic-gate  * Return NULL if unknown signal.
12470Sstevel@tonic-gate  */
12480Sstevel@tonic-gate const char *
12490Sstevel@tonic-gate rawsigname(private_t *pri, int sig)
12500Sstevel@tonic-gate {
12510Sstevel@tonic-gate 	/*
12520Sstevel@tonic-gate 	 * The C library function sig2str() omits the leading "SIG".
12530Sstevel@tonic-gate 	 */
12540Sstevel@tonic-gate 	(void) strcpy(pri->raw_sig_name, "SIG");
12550Sstevel@tonic-gate 
12560Sstevel@tonic-gate 	if (sig > 0 && sig2str(sig, pri->raw_sig_name+3) == 0)
12570Sstevel@tonic-gate 		return (pri->raw_sig_name);
12580Sstevel@tonic-gate 	return (NULL);
12590Sstevel@tonic-gate }
12600Sstevel@tonic-gate 
12610Sstevel@tonic-gate /*
12620Sstevel@tonic-gate  * Return the name of the signal.
12630Sstevel@tonic-gate  * Manufacture a name for unknown signal.
12640Sstevel@tonic-gate  */
12650Sstevel@tonic-gate const char *
12660Sstevel@tonic-gate signame(private_t *pri, int sig)
12670Sstevel@tonic-gate {
12680Sstevel@tonic-gate 	const char *name = rawsigname(pri, sig);
12690Sstevel@tonic-gate 
12700Sstevel@tonic-gate 	if (name == NULL) {			/* manufacture a name */
12710Sstevel@tonic-gate 		(void) sprintf(pri->sig_name, "SIG#%d", sig);
12720Sstevel@tonic-gate 		name = pri->sig_name;
12730Sstevel@tonic-gate 	}
12740Sstevel@tonic-gate 
12750Sstevel@tonic-gate 	return (name);
12760Sstevel@tonic-gate }
12770Sstevel@tonic-gate 
12780Sstevel@tonic-gate /*
12790Sstevel@tonic-gate  * Determine the subcode for this syscall, if any.
12800Sstevel@tonic-gate  */
12810Sstevel@tonic-gate int
12820Sstevel@tonic-gate getsubcode(private_t *pri)
12830Sstevel@tonic-gate {
12840Sstevel@tonic-gate 	const lwpstatus_t *Lsp = pri->lwpstat;
12850Sstevel@tonic-gate 	int syscall = Lsp->pr_syscall;
12860Sstevel@tonic-gate 	int nsysarg = Lsp->pr_nsysarg;
12870Sstevel@tonic-gate 	int subcode = -1;
12880Sstevel@tonic-gate 	int arg0;
12890Sstevel@tonic-gate 
129011798SRoger.Faulkner@Sun.COM 	if (syscall > 0 && nsysarg > 0 && !prismember(&rawout, syscall)) {
12910Sstevel@tonic-gate 		arg0 = Lsp->pr_sysarg[0];
12920Sstevel@tonic-gate 		switch (syscall) {
12930Sstevel@tonic-gate 		case SYS_utssys:	/* utssys() */
12940Sstevel@tonic-gate 			if (nsysarg > 2)
12950Sstevel@tonic-gate 				subcode = Lsp->pr_sysarg[2];
12960Sstevel@tonic-gate 			break;
129711798SRoger.Faulkner@Sun.COM 		case SYS_faccessat:
129811798SRoger.Faulkner@Sun.COM 			if (nsysarg > 3)
129911798SRoger.Faulkner@Sun.COM 				subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD &&
130011798SRoger.Faulkner@Sun.COM 				    Lsp->pr_sysarg[3] == 0)? 1 : 0;
130111798SRoger.Faulkner@Sun.COM 			break;
130211798SRoger.Faulkner@Sun.COM 		case SYS_fchownat:
130311798SRoger.Faulkner@Sun.COM 			if (nsysarg > 1 && Lsp->pr_sysarg[1] == NULL) {
130411798SRoger.Faulkner@Sun.COM 				subcode = 3;
130511798SRoger.Faulkner@Sun.COM 				break;
130611798SRoger.Faulkner@Sun.COM 			}
130711798SRoger.Faulkner@Sun.COM 			if (nsysarg > 0 && (int)Lsp->pr_sysarg[0] != AT_FDCWD) {
130811798SRoger.Faulkner@Sun.COM 				subcode = 0;
130911798SRoger.Faulkner@Sun.COM 				break;
131011798SRoger.Faulkner@Sun.COM 			}
131111798SRoger.Faulkner@Sun.COM 			if (nsysarg > 4)
131211798SRoger.Faulkner@Sun.COM 				subcode = (Lsp->pr_sysarg[4] == 0)? 1 :
131311798SRoger.Faulkner@Sun.COM 				    (Lsp->pr_sysarg[4] == AT_SYMLINK_NOFOLLOW)?
131411798SRoger.Faulkner@Sun.COM 				    2 : 0;
131511798SRoger.Faulkner@Sun.COM 			break;
131611798SRoger.Faulkner@Sun.COM 		case SYS_renameat:
131711798SRoger.Faulkner@Sun.COM 			if (nsysarg > 2)
131811798SRoger.Faulkner@Sun.COM 				subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD &&
131911798SRoger.Faulkner@Sun.COM 				    (int)Lsp->pr_sysarg[2] == AT_FDCWD)? 1 : 0;
132011798SRoger.Faulkner@Sun.COM 			break;
132111798SRoger.Faulkner@Sun.COM 		case SYS_unlinkat:
132211798SRoger.Faulkner@Sun.COM 			if (nsysarg > 2)
132311798SRoger.Faulkner@Sun.COM 				subcode =
132411798SRoger.Faulkner@Sun.COM 				    ((int)Lsp->pr_sysarg[0] != AT_FDCWD)? 0 :
132511798SRoger.Faulkner@Sun.COM 				    (Lsp->pr_sysarg[2] == AT_REMOVEDIR)? 2 :
132611798SRoger.Faulkner@Sun.COM 				    (Lsp->pr_sysarg[2] == 0)? 1 : 0;
132711798SRoger.Faulkner@Sun.COM 			break;
132811798SRoger.Faulkner@Sun.COM 		case SYS_fstatat:
132911798SRoger.Faulkner@Sun.COM 		case SYS_fstatat64:
133011798SRoger.Faulkner@Sun.COM 			if (nsysarg > 1 && Lsp->pr_sysarg[1] == NULL) {
133111798SRoger.Faulkner@Sun.COM 				subcode = 3;
133211798SRoger.Faulkner@Sun.COM 				break;
133311798SRoger.Faulkner@Sun.COM 			}
133411798SRoger.Faulkner@Sun.COM 			if (nsysarg > 0 && (int)Lsp->pr_sysarg[0] != AT_FDCWD) {
133511798SRoger.Faulkner@Sun.COM 				subcode = 0;
133611798SRoger.Faulkner@Sun.COM 				break;
133711798SRoger.Faulkner@Sun.COM 			}
133811798SRoger.Faulkner@Sun.COM 			if (nsysarg > 3)
133911798SRoger.Faulkner@Sun.COM 				subcode = (Lsp->pr_sysarg[3] == 0)? 1 :
134011798SRoger.Faulkner@Sun.COM 				    (Lsp->pr_sysarg[3] == AT_SYMLINK_NOFOLLOW)?
134111798SRoger.Faulkner@Sun.COM 				    2 : 0;
134211798SRoger.Faulkner@Sun.COM 			break;
134311798SRoger.Faulkner@Sun.COM 		case SYS_openat:	/* openat() w/ and w/o AT_FDCWD */
134411798SRoger.Faulkner@Sun.COM 		case SYS_openat64:	/* and with and w/o O_CREAT */
134511798SRoger.Faulkner@Sun.COM 			if (nsysarg > 2)
134611798SRoger.Faulkner@Sun.COM 				subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD)?
134711798SRoger.Faulkner@Sun.COM 				    ((Lsp->pr_sysarg[2] & O_CREAT)? 3 : 2) :
134811798SRoger.Faulkner@Sun.COM 				    ((Lsp->pr_sysarg[2] & O_CREAT)? 1 : 0);
134911798SRoger.Faulkner@Sun.COM 			break;
13500Sstevel@tonic-gate 		case SYS_open:		/* open() w/ and w/o O_CREAT */
13510Sstevel@tonic-gate 		case SYS_open64:
13520Sstevel@tonic-gate 			if (nsysarg > 1)
13530Sstevel@tonic-gate 				subcode = (Lsp->pr_sysarg[1] & O_CREAT)? 1 : 0;
13540Sstevel@tonic-gate 			break;
13550Sstevel@tonic-gate 		case SYS_kaio:		/* kaio() */
13560Sstevel@tonic-gate 			subcode = arg0 & ~AIO_POLL_BIT;
13570Sstevel@tonic-gate 			break;
13580Sstevel@tonic-gate 		case SYS_door:		/* doors */
13590Sstevel@tonic-gate 			if (nsysarg > 5)
13600Sstevel@tonic-gate 				subcode = Lsp->pr_sysarg[5];
13610Sstevel@tonic-gate 			break;
13620Sstevel@tonic-gate 		case SYS_lwp_create:	/* lwp_create() */
13630Sstevel@tonic-gate 			subcode =	/* 0 for parent, 1 for child */
13642267Sdp 			    (Lsp->pr_why == PR_SYSEXIT && Lsp->pr_errno == 0 &&
13652267Sdp 			    Lsp->pr_rval1 == 0);
13660Sstevel@tonic-gate 			break;
13673235Sraf 		case SYS_forksys:	/* forksys */
13683235Sraf 			subcode = arg0;
13693235Sraf 			if (Lsp->pr_why == PR_SYSEXIT && Lsp->pr_errno == 0 &&
13703235Sraf 			    pri->Rval2 != 0)	/* this is the child */
13713235Sraf 				subcode += 3;
13723235Sraf 			break;
13730Sstevel@tonic-gate 		case SYS_msgsys:	/* msgsys() */
13740Sstevel@tonic-gate 		case SYS_semsys:	/* semsys() */
13750Sstevel@tonic-gate 		case SYS_shmsys:	/* shmsys() */
13760Sstevel@tonic-gate 		case SYS_pgrpsys:	/* pgrpsys() */
13770Sstevel@tonic-gate 		case SYS_sysfs:		/* sysfs() */
13780Sstevel@tonic-gate 		case SYS_sigpending:	/* sigpending()/sigfillset() */
13790Sstevel@tonic-gate 		case SYS_context:	/* [get|set]context() */
13800Sstevel@tonic-gate 		case SYS_hrtsys:	/* hrtsys() */
13810Sstevel@tonic-gate 		case SYS_corectl:	/* corectl() */
13820Sstevel@tonic-gate 		case SYS_pset:		/* pset() */
13830Sstevel@tonic-gate 		case SYS_tasksys:	/* tasks */
13840Sstevel@tonic-gate 		case SYS_privsys:	/* privileges */
13850Sstevel@tonic-gate 		case SYS_exacctsys:	/* exacct */
13860Sstevel@tonic-gate 		case SYS_lwp_park:	/* lwp_park */
13870Sstevel@tonic-gate 		case SYS_lwp_rwlock_sys: /* lwp_rwlock_*() */
13880Sstevel@tonic-gate 		case SYS_sendfilev:	/* sendfilev */
13890Sstevel@tonic-gate 		case SYS_lgrpsys:	/* lgrpsys */
13900Sstevel@tonic-gate 		case SYS_rusagesys:	/* rusagesys */
13910Sstevel@tonic-gate 		case SYS_ucredsys:	/* ucredsys */
13920Sstevel@tonic-gate 		case SYS_zone:		/* zone */
13931676Sjpk 		case SYS_labelsys:	/* labelsys */
13942447Snf202958 		case SYS_rctlsys:	/* rctlsys */
13954321Scasper 		case SYS_sidsys:	/* sidsys */
139610440SRoger.Faulkner@Sun.COM 		case SYS_utimesys:	/* utimesys */
1397*12643SAnders.Persson@Sun.COM 		case SYS_sockconfig:	/* sockconfig */
13980Sstevel@tonic-gate 			subcode = arg0;
13990Sstevel@tonic-gate 			break;
14000Sstevel@tonic-gate 		case SYS_fcntl:		/* fcntl() */
14010Sstevel@tonic-gate 			if (nsysarg > 2) {
14020Sstevel@tonic-gate 				switch (Lsp->pr_sysarg[1]) {
14030Sstevel@tonic-gate 				default:	subcode = 0; break;
14040Sstevel@tonic-gate 				case F_GETFL:
14050Sstevel@tonic-gate 				case F_GETOWN:
14060Sstevel@tonic-gate 				case F_GETXFL:	subcode = 1; break;
14070Sstevel@tonic-gate 				case F_SETFL:	subcode = 2; break;
14080Sstevel@tonic-gate 				}
14090Sstevel@tonic-gate 			}
14100Sstevel@tonic-gate 			break;
14110Sstevel@tonic-gate 		case SYS_port:		/* portfs */
14120Sstevel@tonic-gate 			subcode = arg0 & PORT_CODE_MASK;
14130Sstevel@tonic-gate 			break;
14140Sstevel@tonic-gate 		}
14150Sstevel@tonic-gate 	}
14160Sstevel@tonic-gate 
14170Sstevel@tonic-gate 	return (subcode);
14180Sstevel@tonic-gate }
14190Sstevel@tonic-gate 
14200Sstevel@tonic-gate /*
14210Sstevel@tonic-gate  * Return the maximum number of system calls, counting
14220Sstevel@tonic-gate  * all system calls with subcodes as separate calls.
14230Sstevel@tonic-gate  */
14240Sstevel@tonic-gate int
14250Sstevel@tonic-gate maxsyscalls()
14260Sstevel@tonic-gate {
14270Sstevel@tonic-gate 	return (PRMAXSYS + 1
142811798SRoger.Faulkner@Sun.COM 	    + NACCESSCODE - 1
142911798SRoger.Faulkner@Sun.COM 	    + NCHOWNCODE - 1
143011798SRoger.Faulkner@Sun.COM 	    + NRENAMECODE - 1
143111798SRoger.Faulkner@Sun.COM 	    + NUNLINKCODE - 1
143211798SRoger.Faulkner@Sun.COM 	    + NSTATCODE - 1
143311798SRoger.Faulkner@Sun.COM 	    + NSTAT64CODE - 1
143411798SRoger.Faulkner@Sun.COM 	    + NOPENATCODE - 1
143511798SRoger.Faulkner@Sun.COM 	    + NOPENAT64CODE - 1
14362267Sdp 	    + NOPENCODE - 1
14372267Sdp 	    + NOPEN64CODE - 1
14382267Sdp 	    + NMSGCODE - 1
14392267Sdp 	    + NSEMCODE - 1
14402267Sdp 	    + NSHMCODE - 1
14412267Sdp 	    + NPIDCODE - 1
14422267Sdp 	    + NSFSCODE - 1
14432267Sdp 	    + NUTSCODE - 1
14442267Sdp 	    + NSGPCODE - 1
14452267Sdp 	    + NCTXCODE - 1
14462267Sdp 	    + NHRTCODE - 1
14472267Sdp 	    + NCORCODE - 1
14482267Sdp 	    + NAIOCODE - 1
14492267Sdp 	    + NDOORCODE - 1
14502267Sdp 	    + NPSETCODE - 1
14512267Sdp 	    + NLWPCREATECODE - 1
14522267Sdp 	    + NTASKSYSCODE - 1
14532267Sdp 	    + NEXACCTSYSCODE - 1
14542267Sdp 	    + NLWPPARKCODE - 1
14552267Sdp 	    + NLWPRWLOCKCODE - 1
14562267Sdp 	    + NSENDFILESYSCODE - 1
14572267Sdp 	    + NLGRPSYSCODE - 1
14582267Sdp 	    + NRUSAGESYSCODE - 1
14592267Sdp 	    + NFCNTLCODE - 1
14602267Sdp 	    + NPRIVSYSCODE - 1
14612267Sdp 	    + NUCREDSYSCODE - 1
14622267Sdp 	    + NPORTCODE - 1
14632267Sdp 	    + NZONECODE - 1
14642447Snf202958 	    + NLABELCODE - 1
14653235Sraf 	    + NRCTLCODE - 1
14664321Scasper 	    + NFORKCODE - 1
146710440SRoger.Faulkner@Sun.COM 	    + NSIDSYSCODE - 1
1468*12643SAnders.Persson@Sun.COM 	    + NUTIMESYSCODE - 1
1469*12643SAnders.Persson@Sun.COM 	    + NSOCKCONFIGCODE - 1);
14700Sstevel@tonic-gate }
14710Sstevel@tonic-gate 
14720Sstevel@tonic-gate /*
14730Sstevel@tonic-gate  * Return the number of subcodes for the specified system call number.
14740Sstevel@tonic-gate  */
14750Sstevel@tonic-gate int
14760Sstevel@tonic-gate nsubcodes(int syscall)
14770Sstevel@tonic-gate {
14780Sstevel@tonic-gate 	switch (syscall) {
147911798SRoger.Faulkner@Sun.COM 	case SYS_faccessat:
148011798SRoger.Faulkner@Sun.COM 		return (NACCESSCODE);
148111798SRoger.Faulkner@Sun.COM 	case SYS_fchownat:
148211798SRoger.Faulkner@Sun.COM 		return (NCHOWNCODE);
148311798SRoger.Faulkner@Sun.COM 	case SYS_renameat:
148411798SRoger.Faulkner@Sun.COM 		return (NRENAMECODE);
148511798SRoger.Faulkner@Sun.COM 	case SYS_unlinkat:
148611798SRoger.Faulkner@Sun.COM 		return (NUNLINKCODE);
148711798SRoger.Faulkner@Sun.COM 	case SYS_fstatat:
148811798SRoger.Faulkner@Sun.COM 		return (NSTATCODE);
148911798SRoger.Faulkner@Sun.COM 	case SYS_fstatat64:
149011798SRoger.Faulkner@Sun.COM 		return (NSTAT64CODE);
149111798SRoger.Faulkner@Sun.COM 	case SYS_openat:
149211798SRoger.Faulkner@Sun.COM 		return (NOPENATCODE);
149311798SRoger.Faulkner@Sun.COM 	case SYS_openat64:
149411798SRoger.Faulkner@Sun.COM 		return (NOPENAT64CODE);
14950Sstevel@tonic-gate 	case SYS_open:
14960Sstevel@tonic-gate 		return (NOPENCODE);
14970Sstevel@tonic-gate 	case SYS_open64:
14980Sstevel@tonic-gate 		return (NOPEN64CODE);
149911798SRoger.Faulkner@Sun.COM 	case SYS_msgsys:
15000Sstevel@tonic-gate 		return (NMSGCODE);
150111798SRoger.Faulkner@Sun.COM 	case SYS_semsys:
15020Sstevel@tonic-gate 		return (NSEMCODE);
150311798SRoger.Faulkner@Sun.COM 	case SYS_shmsys:
15040Sstevel@tonic-gate 		return (NSHMCODE);
150511798SRoger.Faulkner@Sun.COM 	case SYS_pgrpsys:
15060Sstevel@tonic-gate 		return (NPIDCODE);
150711798SRoger.Faulkner@Sun.COM 	case SYS_utssys:
15080Sstevel@tonic-gate 		return (NUTSCODE);
150911798SRoger.Faulkner@Sun.COM 	case SYS_sysfs:
15100Sstevel@tonic-gate 		return (NSFSCODE);
151111798SRoger.Faulkner@Sun.COM 	case SYS_sigpending:
15120Sstevel@tonic-gate 		return (NSGPCODE);
151311798SRoger.Faulkner@Sun.COM 	case SYS_context:
15140Sstevel@tonic-gate 		return (NCTXCODE);
151511798SRoger.Faulkner@Sun.COM 	case SYS_hrtsys:
15160Sstevel@tonic-gate 		return (NHRTCODE);
151711798SRoger.Faulkner@Sun.COM 	case SYS_corectl:
15180Sstevel@tonic-gate 		return (NCORCODE);
151911798SRoger.Faulkner@Sun.COM 	case SYS_kaio:
15200Sstevel@tonic-gate 		return (NAIOCODE);
152111798SRoger.Faulkner@Sun.COM 	case SYS_door:
15220Sstevel@tonic-gate 		return (NDOORCODE);
152311798SRoger.Faulkner@Sun.COM 	case SYS_pset:
15240Sstevel@tonic-gate 		return (NPSETCODE);
152511798SRoger.Faulkner@Sun.COM 	case SYS_lwp_create:
15260Sstevel@tonic-gate 		return (NLWPCREATECODE);
152711798SRoger.Faulkner@Sun.COM 	case SYS_tasksys:
15280Sstevel@tonic-gate 		return (NTASKSYSCODE);
152911798SRoger.Faulkner@Sun.COM 	case SYS_exacctsys:
15300Sstevel@tonic-gate 		return (NEXACCTSYSCODE);
153111798SRoger.Faulkner@Sun.COM 	case SYS_privsys:
15320Sstevel@tonic-gate 		return (NPRIVSYSCODE);
153311798SRoger.Faulkner@Sun.COM 	case SYS_lwp_park:
15340Sstevel@tonic-gate 		return (NLWPPARKCODE);
15350Sstevel@tonic-gate 	case SYS_lwp_rwlock_sys:
15360Sstevel@tonic-gate 		return (NLWPRWLOCKCODE);
153711798SRoger.Faulkner@Sun.COM 	case SYS_sendfilev:
15380Sstevel@tonic-gate 		return (NSENDFILESYSCODE);
153911798SRoger.Faulkner@Sun.COM 	case SYS_lgrpsys:
15400Sstevel@tonic-gate 		return (NLGRPSYSCODE);
15410Sstevel@tonic-gate 	case SYS_rusagesys:
15420Sstevel@tonic-gate 		return (NRUSAGESYSCODE);
15430Sstevel@tonic-gate 	case SYS_fcntl:
15440Sstevel@tonic-gate 		return (NFCNTLCODE);
15450Sstevel@tonic-gate 	case SYS_ucredsys:
15460Sstevel@tonic-gate 		return (NUCREDSYSCODE);
15470Sstevel@tonic-gate 	case SYS_port:
15480Sstevel@tonic-gate 		return (NPORTCODE);
154911798SRoger.Faulkner@Sun.COM 	case SYS_zone:
15500Sstevel@tonic-gate 		return (NZONECODE);
15511676Sjpk 	case SYS_labelsys:
15521676Sjpk 		return (NLABELCODE);
15532447Snf202958 	case SYS_rctlsys:
15542447Snf202958 		return (NRCTLCODE);
15553235Sraf 	case SYS_forksys:
15563235Sraf 		return (NFORKCODE);
15574321Scasper 	case SYS_sidsys:
15584321Scasper 		return (NSIDSYSCODE);
155910440SRoger.Faulkner@Sun.COM 	case SYS_utimesys:
156010440SRoger.Faulkner@Sun.COM 		return (NUTIMESYSCODE);
1561*12643SAnders.Persson@Sun.COM 	case SYS_sockconfig:
1562*12643SAnders.Persson@Sun.COM 		return (NSOCKCONFIGCODE);
15630Sstevel@tonic-gate 	default:
15640Sstevel@tonic-gate 		return (1);
15650Sstevel@tonic-gate 	}
15660Sstevel@tonic-gate }
15670Sstevel@tonic-gate 
15680Sstevel@tonic-gate 
15690Sstevel@tonic-gate 
15700Sstevel@tonic-gate /* Socket address families (and protocol families) */
15710Sstevel@tonic-gate const char * const afcodes[] = {
15720Sstevel@tonic-gate 	"UNSPEC",	/* 0 */
15730Sstevel@tonic-gate 	"UNIX",		/* 1 */
15740Sstevel@tonic-gate 	"INET",		/* 2 */
15750Sstevel@tonic-gate 	"IMPLINK",	/* 3 */
15760Sstevel@tonic-gate 	"PUP",		/* 4 */
15770Sstevel@tonic-gate 	"CHAOS",	/* 5 */
15780Sstevel@tonic-gate 	"NS",		/* 6 */
15790Sstevel@tonic-gate 	"NBS",		/* 7 */
15800Sstevel@tonic-gate 	"ECMA",		/* 8 */
15810Sstevel@tonic-gate 	"DATAKIT",	/* 9 */
15820Sstevel@tonic-gate 	"CCITT",	/* 10 */
15830Sstevel@tonic-gate 	"SNA",		/* 11 */
15840Sstevel@tonic-gate 	"DECnet",	/* 12 */
15850Sstevel@tonic-gate 	"DLI",		/* 13 */
15860Sstevel@tonic-gate 	"LAT",		/* 14 */
15870Sstevel@tonic-gate 	"HYLINK",	/* 15 */
15880Sstevel@tonic-gate 	"APPLETALK",	/* 16 */
15890Sstevel@tonic-gate 	"NIT",		/* 17 */
15900Sstevel@tonic-gate 	"802",		/* 18 */
15910Sstevel@tonic-gate 	"OSI",		/* 19 */
15920Sstevel@tonic-gate 	"X25",		/* 20 */
15930Sstevel@tonic-gate 	"OSINET",	/* 21 */
15940Sstevel@tonic-gate 	"GOSIP",	/* 22 */
15950Sstevel@tonic-gate 	"IPX",		/* 23 */
15960Sstevel@tonic-gate 	"ROUTE",	/* 24 */
15970Sstevel@tonic-gate 	"LINK",		/* 25 */
15980Sstevel@tonic-gate 	"INET6",	/* 26 */
15990Sstevel@tonic-gate 	"KEY",		/* 27 */
16000Sstevel@tonic-gate 	"NCA",		/* 28 */
16013302Sagiri 	"POLICY",	/* 29 */
160210491SRishi.Srivatsavai@Sun.COM 	"RDS",		/* 30 */
160310639SDarren.Reed@Sun.COM 	"TRILL",	/* 31 */
160410639SDarren.Reed@Sun.COM 	"PACKET"	/* 32 */
16050Sstevel@tonic-gate };
160610639SDarren.Reed@Sun.COM #if MAX_AFCODES != 33
16070Sstevel@tonic-gate #error Need to update address-family table
16080Sstevel@tonic-gate #endif
16090Sstevel@tonic-gate 
16100Sstevel@tonic-gate 
16110Sstevel@tonic-gate const char * const socktype_codes[] = {		/* cf socket.h */
16120Sstevel@tonic-gate 	NULL,
16130Sstevel@tonic-gate 	"SOCK_DGRAM",		/* 1 */
16140Sstevel@tonic-gate 	"SOCK_STREAM",		/* 2 */
16150Sstevel@tonic-gate 	NULL,
16160Sstevel@tonic-gate 	"SOCK_RAW",		/* 4 */
16170Sstevel@tonic-gate 	"SOCK_RDM",		/* 5 */
16180Sstevel@tonic-gate 	"SOCK_SEQPACKET"	/* 6 */
16190Sstevel@tonic-gate };
16200Sstevel@tonic-gate #if MAX_SOCKTYPES != 7
16210Sstevel@tonic-gate #error Need to update socket-type table
16220Sstevel@tonic-gate #endif
1623