xref: /onnv-gate/usr/src/cmd/truss/systable.c (revision 11913)
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 /*
2311798SRoger.Faulkner@Sun.COM  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
280Sstevel@tonic-gate /*	  All Rights Reserved  	*/
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #include <stdio.h>
310Sstevel@tonic-gate #include <stdlib.h>
320Sstevel@tonic-gate #include <fcntl.h>
330Sstevel@tonic-gate #include <unistd.h>
340Sstevel@tonic-gate #include <string.h>
350Sstevel@tonic-gate #include <signal.h>
360Sstevel@tonic-gate #include <sys/types.h>
370Sstevel@tonic-gate #include <libproc.h>
380Sstevel@tonic-gate #include <sys/aio.h>
390Sstevel@tonic-gate #include <sys/port_impl.h>
400Sstevel@tonic-gate #include "ramdata.h"
410Sstevel@tonic-gate #include "systable.h"
420Sstevel@tonic-gate #include "print.h"
430Sstevel@tonic-gate #include "proto.h"
440Sstevel@tonic-gate 
450Sstevel@tonic-gate /*
460Sstevel@tonic-gate  * Tables of information about system calls - read-only data.
470Sstevel@tonic-gate  */
480Sstevel@tonic-gate 
490Sstevel@tonic-gate const	char *const	errcode[] = {	/* error code names */
500Sstevel@tonic-gate 	NULL,		/*  0 */
510Sstevel@tonic-gate 	"EPERM",	/*  1 */
520Sstevel@tonic-gate 	"ENOENT",	/*  2 */
530Sstevel@tonic-gate 	"ESRCH",	/*  3 */
540Sstevel@tonic-gate 	"EINTR",	/*  4 */
550Sstevel@tonic-gate 	"EIO",		/*  5 */
560Sstevel@tonic-gate 	"ENXIO",	/*  6 */
570Sstevel@tonic-gate 	"E2BIG",	/*  7 */
580Sstevel@tonic-gate 	"ENOEXEC",	/*  8 */
590Sstevel@tonic-gate 	"EBADF",	/*  9 */
600Sstevel@tonic-gate 	"ECHILD",	/* 10 */
610Sstevel@tonic-gate 	"EAGAIN",	/* 11 */
620Sstevel@tonic-gate 	"ENOMEM",	/* 12 */
630Sstevel@tonic-gate 	"EACCES",	/* 13 */
640Sstevel@tonic-gate 	"EFAULT",	/* 14 */
650Sstevel@tonic-gate 	"ENOTBLK",	/* 15 */
660Sstevel@tonic-gate 	"EBUSY",	/* 16 */
670Sstevel@tonic-gate 	"EEXIST",	/* 17 */
680Sstevel@tonic-gate 	"EXDEV",	/* 18 */
690Sstevel@tonic-gate 	"ENODEV",	/* 19 */
700Sstevel@tonic-gate 	"ENOTDIR",	/* 20 */
710Sstevel@tonic-gate 	"EISDIR",	/* 21 */
720Sstevel@tonic-gate 	"EINVAL",	/* 22 */
730Sstevel@tonic-gate 	"ENFILE",	/* 23 */
740Sstevel@tonic-gate 	"EMFILE",	/* 24 */
750Sstevel@tonic-gate 	"ENOTTY",	/* 25 */
760Sstevel@tonic-gate 	"ETXTBSY",	/* 26 */
770Sstevel@tonic-gate 	"EFBIG",	/* 27 */
780Sstevel@tonic-gate 	"ENOSPC",	/* 28 */
790Sstevel@tonic-gate 	"ESPIPE",	/* 29 */
800Sstevel@tonic-gate 	"EROFS",	/* 30 */
810Sstevel@tonic-gate 	"EMLINK",	/* 31 */
820Sstevel@tonic-gate 	"EPIPE",	/* 32 */
830Sstevel@tonic-gate 	"EDOM",		/* 33 */
840Sstevel@tonic-gate 	"ERANGE",	/* 34 */
850Sstevel@tonic-gate 	"ENOMSG",	/* 35 */
860Sstevel@tonic-gate 	"EIDRM",	/* 36 */
870Sstevel@tonic-gate 	"ECHRNG",	/* 37 */
880Sstevel@tonic-gate 	"EL2NSYNC",	/* 38 */
890Sstevel@tonic-gate 	"EL3HLT",	/* 39 */
900Sstevel@tonic-gate 	"EL3RST",	/* 40 */
910Sstevel@tonic-gate 	"ELNRNG",	/* 41 */
920Sstevel@tonic-gate 	"EUNATCH",	/* 42 */
930Sstevel@tonic-gate 	"ENOCSI",	/* 43 */
940Sstevel@tonic-gate 	"EL2HLT",	/* 44 */
950Sstevel@tonic-gate 	"EDEADLK",	/* 45 */
960Sstevel@tonic-gate 	"ENOLCK",	/* 46 */
970Sstevel@tonic-gate 	"ECANCELED",	/* 47 */
980Sstevel@tonic-gate 	"ENOTSUP",	/* 48 */
990Sstevel@tonic-gate 	"EDQUOT",	/* 49 */
1000Sstevel@tonic-gate 	"EBADE",	/* 50 */
1010Sstevel@tonic-gate 	"EBADR",	/* 51 */
1020Sstevel@tonic-gate 	"EXFULL",	/* 52 */
1030Sstevel@tonic-gate 	"ENOANO",	/* 53 */
1040Sstevel@tonic-gate 	"EBADRQC",	/* 54 */
1050Sstevel@tonic-gate 	"EBADSLT",	/* 55 */
1060Sstevel@tonic-gate 	"EDEADLOCK",	/* 56 */
1070Sstevel@tonic-gate 	"EBFONT",	/* 57 */
1080Sstevel@tonic-gate 	"EOWNERDEAD",	/* 58 */
1090Sstevel@tonic-gate 	"ENOTRECOVERABLE",	/* 59 */
1100Sstevel@tonic-gate 	"ENOSTR",	/* 60 */
1110Sstevel@tonic-gate 	"ENODATA",	/* 61 */
1120Sstevel@tonic-gate 	"ETIME",	/* 62 */
1130Sstevel@tonic-gate 	"ENOSR",	/* 63 */
1140Sstevel@tonic-gate 	"ENONET",	/* 64 */
1150Sstevel@tonic-gate 	"ENOPKG",	/* 65 */
1160Sstevel@tonic-gate 	"EREMOTE",	/* 66 */
1170Sstevel@tonic-gate 	"ENOLINK",	/* 67 */
1180Sstevel@tonic-gate 	"EADV",		/* 68 */
1190Sstevel@tonic-gate 	"ESRMNT",	/* 69 */
1200Sstevel@tonic-gate 	"ECOMM",	/* 70 */
1210Sstevel@tonic-gate 	"EPROTO",	/* 71 */
1220Sstevel@tonic-gate 	"ELOCKUNMAPPED",	/* 72 */
1230Sstevel@tonic-gate 	"ENOTACTIVE",	/* 73 */
1240Sstevel@tonic-gate 	"EMULTIHOP",	/* 74 */
1250Sstevel@tonic-gate 	NULL,		/* 75 */
1260Sstevel@tonic-gate 	NULL,		/* 76 */
1270Sstevel@tonic-gate 	"EBADMSG",	/* 77 */
1280Sstevel@tonic-gate 	"ENAMETOOLONG",	/* 78 */
1290Sstevel@tonic-gate 	"EOVERFLOW",	/* 79 */
1300Sstevel@tonic-gate 	"ENOTUNIQ",	/* 80 */
1310Sstevel@tonic-gate 	"EBADFD",	/* 81 */
1320Sstevel@tonic-gate 	"EREMCHG",	/* 82 */
1330Sstevel@tonic-gate 	"ELIBACC",	/* 83 */
1340Sstevel@tonic-gate 	"ELIBBAD",	/* 84 */
1350Sstevel@tonic-gate 	"ELIBSCN",	/* 85 */
1360Sstevel@tonic-gate 	"ELIBMAX",	/* 86 */
1370Sstevel@tonic-gate 	"ELIBEXEC",	/* 87 */
1380Sstevel@tonic-gate 	"EILSEQ",	/* 88 */
1390Sstevel@tonic-gate 	"ENOSYS",	/* 89 */
1400Sstevel@tonic-gate 	"ELOOP",	/* 90 */
1410Sstevel@tonic-gate 	"ERESTART",	/* 91 */
1420Sstevel@tonic-gate 	"ESTRPIPE",	/* 92 */
1430Sstevel@tonic-gate 	"ENOTEMPTY",	/* 93 */
1440Sstevel@tonic-gate 	"EUSERS",	/* 94 */
1450Sstevel@tonic-gate 	"ENOTSOCK",	/* 95 */
1460Sstevel@tonic-gate 	"EDESTADDRREQ",	/* 96 */
1470Sstevel@tonic-gate 	"EMSGSIZE",	/* 97 */
1480Sstevel@tonic-gate 	"EPROTOTYPE",	/* 98 */
1490Sstevel@tonic-gate 	"ENOPROTOOPT",	/* 99 */
1500Sstevel@tonic-gate 	NULL,		/* 100 */
1510Sstevel@tonic-gate 	NULL,		/* 101 */
1520Sstevel@tonic-gate 	NULL,		/* 102 */
1530Sstevel@tonic-gate 	NULL,		/* 103 */
1540Sstevel@tonic-gate 	NULL,		/* 104 */
1550Sstevel@tonic-gate 	NULL,		/* 105 */
1560Sstevel@tonic-gate 	NULL,		/* 106 */
1570Sstevel@tonic-gate 	NULL,		/* 107 */
1580Sstevel@tonic-gate 	NULL,		/* 108 */
1590Sstevel@tonic-gate 	NULL,		/* 109 */
1600Sstevel@tonic-gate 	NULL,		/* 110 */
1610Sstevel@tonic-gate 	NULL,		/* 111 */
1620Sstevel@tonic-gate 	NULL,		/* 112 */
1630Sstevel@tonic-gate 	NULL,		/* 113 */
1640Sstevel@tonic-gate 	NULL,		/* 114 */
1650Sstevel@tonic-gate 	NULL,		/* 115 */
1660Sstevel@tonic-gate 	NULL,		/* 116 */
1670Sstevel@tonic-gate 	NULL,		/* 117 */
1680Sstevel@tonic-gate 	NULL,		/* 118 */
1690Sstevel@tonic-gate 	NULL,		/* 119 */
1700Sstevel@tonic-gate 	"EPROTONOSUPPORT",	/* 120 */
1710Sstevel@tonic-gate 	"ESOCKTNOSUPPORT",	/* 121 */
1720Sstevel@tonic-gate 	"EOPNOTSUPP",	/* 122 */
1730Sstevel@tonic-gate 	"EPFNOSUPPORT",	/* 123 */
1740Sstevel@tonic-gate 	"EAFNOSUPPORT",	/* 124 */
1750Sstevel@tonic-gate 	"EADDRINUSE",	/* 125 */
1760Sstevel@tonic-gate 	"EADDRNOTAVAIL", /* 126 */
1770Sstevel@tonic-gate 	"ENETDOWN",	/* 127 */
1780Sstevel@tonic-gate 	"ENETUNREACH",	/* 128 */
1790Sstevel@tonic-gate 	"ENETRESET",	/* 129 */
1800Sstevel@tonic-gate 	"ECONNABORTED",	/* 130 */
1810Sstevel@tonic-gate 	"ECONNRESET",	/* 131 */
1820Sstevel@tonic-gate 	"ENOBUFS",	/* 132 */
1830Sstevel@tonic-gate 	"EISCONN",	/* 133 */
1840Sstevel@tonic-gate 	"ENOTCONN",	/* 134 */
1850Sstevel@tonic-gate 	NULL,		/* 135 */
1860Sstevel@tonic-gate 	NULL,		/* 136 */
1870Sstevel@tonic-gate 	NULL,		/* 137 */
1880Sstevel@tonic-gate 	NULL,		/* 138 */
1890Sstevel@tonic-gate 	NULL,		/* 139 */
1900Sstevel@tonic-gate 	NULL,		/* 140 */
1910Sstevel@tonic-gate 	NULL,		/* 141 */
1920Sstevel@tonic-gate 	NULL,		/* 142 */
1930Sstevel@tonic-gate 	"ESHUTDOWN",	/* 143 */
1940Sstevel@tonic-gate 	"ETOOMANYREFS",	/* 144 */
1950Sstevel@tonic-gate 	"ETIMEDOUT",	/* 145 */
1960Sstevel@tonic-gate 	"ECONNREFUSED",	/* 146 */
1970Sstevel@tonic-gate 	"EHOSTDOWN",	/* 147 */
1980Sstevel@tonic-gate 	"EHOSTUNREACH",	/* 148 */
1990Sstevel@tonic-gate 	"EALREADY",	/* 149 */
2000Sstevel@tonic-gate 	"EINPROGRESS",	/* 150 */
2010Sstevel@tonic-gate 	"ESTALE"	/* 151 */
2020Sstevel@tonic-gate };
2030Sstevel@tonic-gate 
2040Sstevel@tonic-gate #define	NERRCODE	(sizeof (errcode) / sizeof (char *))
2050Sstevel@tonic-gate 
2060Sstevel@tonic-gate 
2070Sstevel@tonic-gate const char *
2080Sstevel@tonic-gate errname(int err)	/* return the error code name (NULL if none) */
2090Sstevel@tonic-gate {
2100Sstevel@tonic-gate 	const char *ename = NULL;
2110Sstevel@tonic-gate 
2120Sstevel@tonic-gate 	if (err >= 0 && err < NERRCODE)
2130Sstevel@tonic-gate 		ename = errcode[err];
2140Sstevel@tonic-gate 
2150Sstevel@tonic-gate 	return (ename);
2160Sstevel@tonic-gate }
2170Sstevel@tonic-gate 
2180Sstevel@tonic-gate 
2190Sstevel@tonic-gate const struct systable systable[] = {
2200Sstevel@tonic-gate { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2210Sstevel@tonic-gate {"_exit",	1, DEC, NOV, DEC},				/*   1 */
22211798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2230Sstevel@tonic-gate {"read",	3, DEC, NOV, DEC, IOB, UNS},			/*   3 */
2240Sstevel@tonic-gate {"write",	3, DEC, NOV, DEC, IOB, UNS},			/*   4 */
2250Sstevel@tonic-gate {"open",	3, DEC, NOV, STG, OPN, OCT},			/*   5 */
2260Sstevel@tonic-gate {"close",	1, DEC, NOV, DEC},				/*   6 */
22711798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
22811798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2290Sstevel@tonic-gate {"link",	2, DEC, NOV, STG, STG},				/*   9 */
2300Sstevel@tonic-gate {"unlink",	1, DEC, NOV, STG},				/*  10 */
23111798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2320Sstevel@tonic-gate {"chdir",	1, DEC, NOV, STG},				/*  12 */
2330Sstevel@tonic-gate {"time",	0, DEC, NOV},					/*  13 */
2340Sstevel@tonic-gate {"mknod",	3, DEC, NOV, STG, OCT, HEX},			/*  14 */
2350Sstevel@tonic-gate {"chmod",	2, DEC, NOV, STG, OCT},				/*  15 */
2360Sstevel@tonic-gate {"chown",	3, DEC, NOV, STG, DEC, DEC},			/*  16 */
2370Sstevel@tonic-gate {"brk",		1, DEC, NOV, HEX},				/*  17 */
2380Sstevel@tonic-gate {"stat",	2, DEC, NOV, STG, HEX},				/*  18 */
2390Sstevel@tonic-gate {"lseek",	3, DEC, NOV, DEC, DEX, WHN},			/*  19 */
2400Sstevel@tonic-gate {"getpid",	0, DEC, DEC},					/*  20 */
24111798SRoger.Faulkner@Sun.COM {"mount",	8, DEC, NOV, STG, STG, MTF, MFT, HEX, DEC, HEX, DEC}, /* 21 */
24211798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2434321Scasper {"setuid",	1, DEC, NOV, UNS},				/*  23 */
2444321Scasper {"getuid",	0, UNS, UNS},					/*  24 */
2450Sstevel@tonic-gate {"stime",	1, DEC, NOV, DEC},				/*  25 */
2460Sstevel@tonic-gate {"pcsample",	2, DEC, NOV, HEX, DEC},				/*  26 */
2470Sstevel@tonic-gate {"alarm",	1, DEC, NOV, UNS},				/*  27 */
2480Sstevel@tonic-gate {"fstat",	2, DEC, NOV, DEC, HEX},				/*  28 */
2490Sstevel@tonic-gate {"pause",	0, DEC, NOV},					/*  29 */
25011798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2510Sstevel@tonic-gate {"stty",	2, DEC, NOV, DEC, DEC},				/*  31 */
2520Sstevel@tonic-gate {"gtty",	2, DEC, NOV, DEC, DEC},				/*  32 */
2530Sstevel@tonic-gate {"access",	2, DEC, NOV, STG, ACC},				/*  33 */
2540Sstevel@tonic-gate {"nice",	1, DEC, NOV, DEC},				/*  34 */
2550Sstevel@tonic-gate {"statfs",	4, DEC, NOV, STG, HEX, DEC, DEC},		/*  35 */
2560Sstevel@tonic-gate {"sync",	0, DEC, NOV},					/*  36 */
2570Sstevel@tonic-gate {"kill",	2, DEC, NOV, DEC, SIG},				/*  37 */
2580Sstevel@tonic-gate {"fstatfs",	4, DEC, NOV, DEC, HEX, DEC, DEC},		/*  38 */
2590Sstevel@tonic-gate {"pgrpsys",	3, DEC, NOV, DEC, DEC, DEC},			/*  39 */
2602712Snn35248 {"uucopystr",	3, DEC, NOV, STG, RST, UNS},			/*  40 */
26111798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2620Sstevel@tonic-gate {"pipe",	0, DEC, DEC},					/*  42 */
2630Sstevel@tonic-gate {"times",	1, DEC, NOV, HEX},				/*  43 */
2640Sstevel@tonic-gate {"profil",	4, DEC, NOV, HEX, UNS, HEX, OCT},		/*  44 */
26511798SRoger.Faulkner@Sun.COM {"faccessat",	4, DEC, NOV, ATC, STG, ACC, DEC},		/*  45 */
2664321Scasper {"setgid",	1, DEC, NOV, UNS},				/*  46 */
2674321Scasper {"getgid",	0, UNS, UNS},					/*  47 */
26810927SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2690Sstevel@tonic-gate {"msgsys",	6, DEC, NOV, DEC, DEC, DEC, DEC, DEC, DEC},	/*  49 */
2700Sstevel@tonic-gate {"sysi86",	4, HEX, NOV, S86, HEX, HEX, HEX, DEC, DEC},	/*  50 */
2710Sstevel@tonic-gate {"acct",	1, DEC, NOV, STG},				/*  51 */
2720Sstevel@tonic-gate {"shmsys",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/*  52 */
2730Sstevel@tonic-gate {"semsys",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/*  53 */
2740Sstevel@tonic-gate {"ioctl",	3, DEC, NOV, DEC, IOC, IOA},			/*  54 */
2750Sstevel@tonic-gate {"uadmin",	3, DEC, NOV, DEC, DEC, DEC},			/*  55 */
27611798SRoger.Faulkner@Sun.COM {"fchownat",	5, DEC, NOV, ATC, STG, DEC, DEC, UTF},		/*  56 */
2770Sstevel@tonic-gate {"utssys",	4, DEC, NOV, HEX, DEC, UTS, HEX},		/*  57 */
2780Sstevel@tonic-gate {"fdsync",	2, DEC, NOV, DEC, FFG},				/*  58 */
2790Sstevel@tonic-gate {"execve",	3, DEC, NOV, STG, HEX, HEX},			/*  59 */
2800Sstevel@tonic-gate {"umask",	1, OCT, NOV, OCT},				/*  60 */
2810Sstevel@tonic-gate {"chroot",	1, DEC, NOV, STG},				/*  61 */
2820Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, HEX},			/*  62 */
2830Sstevel@tonic-gate {"ulimit",	2, DEX, NOV, ULM, DEC},				/*  63 */
28411798SRoger.Faulkner@Sun.COM {"renameat",	4, DEC, NOV, ATC, STG, ATC, STG},		/*  64 */
28511798SRoger.Faulkner@Sun.COM {"unlinkat",	3, DEC, NOV, ATC, STG, DEC},			/*  65 */
28611798SRoger.Faulkner@Sun.COM {"fstatat",	4, DEC, NOV, ATC, STG, HEX, UTF},		/*  66 */
28711798SRoger.Faulkner@Sun.COM {"fstatat64",	4, DEC, NOV, ATC, STG, HEX, UTF},		/*  67 */
28811798SRoger.Faulkner@Sun.COM {"openat",	4, DEC, NOV, ATC, STG, OPN, OCT},		/*  68 */
28911798SRoger.Faulkner@Sun.COM {"openat64",	4, DEC, NOV, ATC, STG, OPN, OCT},		/*  69 */
2900Sstevel@tonic-gate {"tasksys",	5, DEC, NOV, DEC, DEC, DEC, HEX, DEC},		/*  70 */
2910Sstevel@tonic-gate {"acctctl",	3, DEC, NOV, HEX, HEX, UNS},			/*  71 */
2920Sstevel@tonic-gate {"exacctsys",	6, DEC, NOV, DEC, IDT, DEC, HEX, DEC, HEX},	/*  72 */
2930Sstevel@tonic-gate {"getpagesizes", 2, DEC, NOV, HEX, DEC},			/*  73 */
2942447Snf202958 {"rctlsys",	6, DEC, NOV, RSC, STG, HEX, HEX, DEC, DEC},	/*  74 */
2954321Scasper {"sidsys",	4, UNS, UNS, DEC, DEC, DEC, DEC},		/*  75 */
29611798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
2970Sstevel@tonic-gate {"lwp_park",	3, DEC, NOV, DEC, HEX, DEC},			/*  77 */
2980Sstevel@tonic-gate {"sendfilev",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/*  78 */
2990Sstevel@tonic-gate {"rmdir",	1, DEC, NOV, STG},				/*  79 */
3000Sstevel@tonic-gate {"mkdir",	2, DEC, NOV, STG, OCT},				/*  80 */
3010Sstevel@tonic-gate {"getdents",	3, DEC, NOV, DEC, HEX, UNS},			/*  81 */
3020Sstevel@tonic-gate {"privsys",	5, HEX, NOV, DEC, DEC, DEC, HEX, DEC},		/*  82 */
3030Sstevel@tonic-gate {"ucredsys",	3, DEC, NOV, DEC, DEC, HEX},			/*  83 */
3040Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEX, DEX},			/*  84 */
3050Sstevel@tonic-gate {"getmsg",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/*  85 */
3060Sstevel@tonic-gate {"putmsg",	4, DEC, NOV, DEC, HEX, HEX, SMF},		/*  86 */
30711798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3080Sstevel@tonic-gate {"lstat",	2, DEC, NOV, STG, HEX},				/*  88 */
3090Sstevel@tonic-gate {"symlink",	2, DEC, NOV, STG, STG},				/*  89 */
3100Sstevel@tonic-gate {"readlink",	3, DEC, NOV, STG, RLK, UNS},			/*  90 */
3110Sstevel@tonic-gate {"setgroups",	2, DEC, NOV, DEC, HEX},				/*  91 */
3120Sstevel@tonic-gate {"getgroups",	2, DEC, NOV, DEC, HEX},				/*  92 */
3130Sstevel@tonic-gate {"fchmod",	2, DEC, NOV, DEC, OCT},				/*  93 */
3140Sstevel@tonic-gate {"fchown",	3, DEC, NOV, DEC, DEC, DEC},			/*  94 */
3150Sstevel@tonic-gate {"sigprocmask",	3, DEC, NOV, SPM, HEX, HEX},			/*  95 */
3160Sstevel@tonic-gate {"sigsuspend",	1, DEC, NOV, HEX},				/*  96 */
3170Sstevel@tonic-gate {"sigaltstack",	2, DEC, NOV, HEX, HEX},				/*  97 */
3180Sstevel@tonic-gate {"sigaction",	3, DEC, NOV, SIG, HEX, HEX},			/*  98 */
3190Sstevel@tonic-gate {"sigpendsys",	2, DEC, NOV, DEC, HEX},				/*  99 */
3200Sstevel@tonic-gate {"context",	2, DEC, NOV, DEC, HEX},				/* 100 */
32111798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
32211798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3230Sstevel@tonic-gate {"statvfs",	2, DEC, NOV, STG, HEX},				/* 103 */
3240Sstevel@tonic-gate {"fstatvfs",	2, DEC, NOV, DEC, HEX},				/* 104 */
3250Sstevel@tonic-gate {"getloadavg",	2, DEC, NOV, HEX, DEC},				/* 105 */
3260Sstevel@tonic-gate {"nfssys",	2, DEC, NOV, DEC, HEX},				/* 106 */
3270Sstevel@tonic-gate {"waitid",	4, DEC, NOV, IDT, DEC, HEX, WOP},		/* 107 */
3280Sstevel@tonic-gate {"sigsendsys",	2, DEC, NOV, HEX, SIG},				/* 108 */
3290Sstevel@tonic-gate {"hrtsys",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 109 */
33010440SRoger.Faulkner@Sun.COM {"utimesys",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 110 */
3314806Sraf {"sigresend",	3, DEC, NOV, SIG, HEX, HEX},			/* 111 */
3320Sstevel@tonic-gate {"priocntlsys",	5, DEC, NOV, DEC, HEX, DEC, PC4, PC5},		/* 112 */
3330Sstevel@tonic-gate {"pathconf",	2, DEC, NOV, STG, PTC},				/* 113 */
3340Sstevel@tonic-gate {"mincore",	3, DEC, NOV, HEX, UNS, HEX},			/* 114 */
3350Sstevel@tonic-gate {"mmap",	6, HEX, NOV, HEX, UNS, MPR, MTY, DEC, DEC},	/* 115 */
3360Sstevel@tonic-gate {"mprotect",	3, DEC, NOV, HEX, UNS, MPR},			/* 116 */
3370Sstevel@tonic-gate {"munmap",	2, DEC, NOV, HEX, UNS},				/* 117 */
3380Sstevel@tonic-gate {"fpathconf",	2, DEC, NOV, DEC, PTC},				/* 118 */
3390Sstevel@tonic-gate {"vfork",	0, DEC, NOV},					/* 119 */
3400Sstevel@tonic-gate {"fchdir",	1, DEC, NOV, DEC},				/* 120 */
3410Sstevel@tonic-gate {"readv",	3, DEC, NOV, DEC, HEX, DEC},			/* 121 */
3420Sstevel@tonic-gate {"writev",	3, DEC, NOV, DEC, HEX, DEC},			/* 122 */
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},
34611798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
34710198SAli.Bahrami@Sun.COM {"mmapobj",	5, DEC, NOV, DEC, MOB, HEX, HEX, HEX},		/* 127 */
3480Sstevel@tonic-gate {"setrlimit",	2, DEC, NOV, RLM, HEX},				/* 128 */
3490Sstevel@tonic-gate {"getrlimit",	2, DEC, NOV, RLM, HEX},				/* 129 */
3500Sstevel@tonic-gate {"lchown",	3, DEC, NOV, STG, DEC, DEC},			/* 130 */
3510Sstevel@tonic-gate {"memcntl",	6, DEC, NOV, HEX, UNS, MCF, MC4, MC5, DEC},	/* 131 */
3520Sstevel@tonic-gate {"getpmsg",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 132 */
3530Sstevel@tonic-gate {"putpmsg",	5, DEC, NOV, DEC, HEX, HEX, DEC, HHX},		/* 133 */
3540Sstevel@tonic-gate {"rename",	2, DEC, NOV, STG, STG},				/* 134 */
3550Sstevel@tonic-gate {"uname",	1, DEC, NOV, HEX},				/* 135 */
3564321Scasper {"setegid",	1, DEC, NOV, UNS},				/* 136 */
3570Sstevel@tonic-gate {"sysconfig",	1, DEC, NOV, CNF},				/* 137 */
3580Sstevel@tonic-gate {"adjtime",	2, DEC, NOV, HEX, HEX},				/* 138 */
3590Sstevel@tonic-gate {"sysinfo",	3, DEC, NOV, INF, RST, DEC},			/* 139 */
3603957Sth199096 {"sharefs",	3, DEC, NOV, DEC, HEX, DEC},			/* 140 */
3614321Scasper {"seteuid",	1, DEC, NOV, UNS},				/* 141 */
3623235Sraf {"forksys",	2, DEC, NOV, DEC, HHX},				/* 142 */
36311798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3640Sstevel@tonic-gate {"sigtimedwait", 3, DEC, NOV, HEX, HEX, HEX},			/* 144 */
3650Sstevel@tonic-gate {"lwp_info",	1, DEC, NOV, HEX},				/* 145 */
3660Sstevel@tonic-gate {"yield",	0, DEC, NOV},					/* 146 */
36711798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3680Sstevel@tonic-gate {"lwp_sema_post", 1, DEC, NOV, HEX},				/* 148 */
3690Sstevel@tonic-gate {"lwp_sema_trywait", 1, DEC, NOV, HEX},				/* 149 */
3700Sstevel@tonic-gate {"lwp_detach",	1, DEC, NOV, DEC},				/* 150 */
3710Sstevel@tonic-gate {"corectl",	4, DEC, NOV, DEC, HEX, HEX, HEX},		/* 151 */
3720Sstevel@tonic-gate {"modctl",	5, DEC, NOV, MOD, HEX, HEX, HEX, HEX},		/* 152 */
3730Sstevel@tonic-gate {"fchroot",	1, DEC, NOV, DEC},				/* 153 */
37411798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3750Sstevel@tonic-gate {"vhangup",	0, DEC, NOV},					/* 155 */
3760Sstevel@tonic-gate {"gettimeofday", 1, DEC, NOV, HEX},				/* 156 */
3770Sstevel@tonic-gate {"getitimer",	2, DEC, NOV, ITM, HEX},				/* 157 */
3780Sstevel@tonic-gate {"setitimer",	3, DEC, NOV, ITM, HEX, HEX},			/* 158 */
3790Sstevel@tonic-gate {"lwp_create",	3, DEC, NOV, HEX, LWF, HEX},			/* 159 */
3800Sstevel@tonic-gate {"lwp_exit",	0, DEC, NOV},					/* 160 */
3810Sstevel@tonic-gate {"lwp_suspend",	1, DEC, NOV, DEC},				/* 161 */
3820Sstevel@tonic-gate {"lwp_continue", 1, DEC, NOV, DEC},				/* 162 */
3830Sstevel@tonic-gate {"lwp_kill",	2, DEC, NOV, DEC, SIG},				/* 163 */
3840Sstevel@tonic-gate {"lwp_self",	0, DEC, NOV},					/* 164 */
385*11913SRoger.Faulkner@Sun.COM {"lwp_sigmask",	5, HEX, HEX, SPM, HEX, HEX, HEX, HEX},		/* 165 */
3860Sstevel@tonic-gate {"lwp_private",	3, HEX, NOV, DEC, DEC, HEX},			/* 166 */
3870Sstevel@tonic-gate {"lwp_wait",	2, DEC, NOV, DEC, HEX},				/* 167 */
3884574Sraf {"lwp_mutex_wakeup", 2, DEC, NOV, HEX, DEC},			/* 168 */
38911798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
3900Sstevel@tonic-gate {"lwp_cond_wait", 4, DEC, NOV, HEX, HEX, HEX, DEC},		/* 170 */
3910Sstevel@tonic-gate {"lwp_cond_signal", 1, DEC, NOV, HEX},				/* 171 */
3920Sstevel@tonic-gate {"lwp_cond_broadcast", 1, DEC, NOV, HEX},			/* 172 */
3930Sstevel@tonic-gate {"pread",	4, DEC, NOV, DEC, IOB, UNS, DEX},		/* 173 */
3940Sstevel@tonic-gate {"pwrite",	4, DEC, NOV, DEC, IOB, UNS, DEX},		/* 174 */
3950Sstevel@tonic-gate {"llseek",	4, LLO, NOV, DEC, LLO, HID, WHN},		/* 175 */
3960Sstevel@tonic-gate {"inst_sync",	2, DEC, NOV, STG, DEC},				/* 176 */
3972712Snn35248 {"brand",	6, DEC, NOV, DEC, HEX, HEX, HEX, HEX, HEX},	/* 177 */
3980Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, HEX, HEX, HEX, HEX, HEX, HEX}, /* 178 */
3990Sstevel@tonic-gate {"cpc",		5, DEC, NOV, CPC, DEC, HEX, HEX, HEX},		/* 179 */
4000Sstevel@tonic-gate {"lgrpsys",	3, DEC, NOV, DEC, DEC, HEX},			/* 180 */
4013247Sgjelinek {"rusagesys",	5, DEC, NOV, DEC, HEX, DEC, HEX, HEX},		/* 181 */
4020Sstevel@tonic-gate {"portfs",	6, HEX, HEX, DEC, HEX, HEX, HEX, HEX, HEX},	/* 182 */
4030Sstevel@tonic-gate {"pollsys",	4, DEC, NOV, HEX, DEC, HEX, HEX},		/* 183 */
4041676Sjpk {"labelsys",	2, DEC, NOV, DEC, HEX},				/* 184 */
4050Sstevel@tonic-gate {"acl",		4, DEC, NOV, STG, ACL, DEC, HEX},		/* 185 */
4060Sstevel@tonic-gate {"auditsys",	4, DEC, NOV, AUD, HEX, HEX, HEX},		/* 186 */
4070Sstevel@tonic-gate {"processor_bind", 4, DEC, NOV, IDT, DEC, DEC, HEX},		/* 187 */
4080Sstevel@tonic-gate {"processor_info", 2, DEC, NOV, DEC, HEX},			/* 188 */
4090Sstevel@tonic-gate {"p_online",	2, DEC, NOV, DEC, DEC},				/* 189 */
4102248Sraf {"sigqueue",	5, DEC, NOV, DEC, SIG, HEX, SQC, DEC},		/* 190 */
4110Sstevel@tonic-gate {"clock_gettime", 2, DEC, NOV, DEC, HEX},			/* 191 */
4120Sstevel@tonic-gate {"clock_settime", 2, DEC, NOV, DEC, HEX},			/* 192 */
4130Sstevel@tonic-gate {"clock_getres", 2, DEC, NOV, DEC, HEX},			/* 193 */
4140Sstevel@tonic-gate {"timer_create", 3, DEC, NOV, DEC, HEX, HEX},			/* 194 */
4150Sstevel@tonic-gate {"timer_delete", 1, DEC, NOV, DEC},				/* 195 */
4160Sstevel@tonic-gate {"timer_settime", 4, DEC, NOV, DEC, DEC, HEX, HEX},		/* 196 */
4170Sstevel@tonic-gate {"timer_gettime", 2, DEC, NOV, DEC, HEX},			/* 197 */
4180Sstevel@tonic-gate {"timer_getoverrun", 1, DEC, NOV, DEC},				/* 198 */
4190Sstevel@tonic-gate {"nanosleep",	2, DEC, NOV, HEX, HEX},				/* 199 */
4200Sstevel@tonic-gate {"facl",	4, DEC, NOV, DEC, ACL, DEC, HEX},		/* 200 */
4210Sstevel@tonic-gate {"door",	6, DEC, NOV, DEC, HEX, HEX, HEX, HEX, DEC},	/* 201 */
4224321Scasper {"setreuid",	2, DEC, NOV, UN1, UN1},				/* 202 */
4234321Scasper {"setregid",	2, DEC, NOV, UN1, UN1},				/* 203 */
4240Sstevel@tonic-gate {"install_utrap", 3, DEC, NOV, DEC, HEX, HEX},			/* 204 */
4250Sstevel@tonic-gate {"signotify",	3, DEC, NOV, DEC, HEX, HEX},			/* 205 */
4260Sstevel@tonic-gate {"schedctl",	0, HEX, NOV},					/* 206 */
4270Sstevel@tonic-gate {"pset",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 207 */
4280Sstevel@tonic-gate {"sparc_utrap_install", 5, DEC, NOV, UTT, UTH, UTH, HEX, HEX},	/* 208 */
4290Sstevel@tonic-gate {"resolvepath",	3, DEC, NOV, STG, RLK, DEC},			/* 209 */
43010887SRoger.Faulkner@Sun.COM {"lwp_mutex_timedlock", 3, DEC, NOV, HEX, HEX, HEX},		/* 210 */
4310Sstevel@tonic-gate {"lwp_sema_timedwait", 3, DEC, NOV, HEX, HEX, DEC},		/* 211 */
4320Sstevel@tonic-gate {"lwp_rwlock_sys", 3, DEC, NOV, DEC, HEX, HEX},			/* 212 */
4330Sstevel@tonic-gate {"getdents64",	3, DEC, NOV, DEC, HEX, UNS},			/* 213 */
4340Sstevel@tonic-gate {"mmap64",	7, HEX, NOV, HEX, UNS, MPR, MTY, DEC, LLO, HID}, /* 214 */
4350Sstevel@tonic-gate {"stat64",	2, DEC, NOV, STG, HEX},				/* 215 */
4360Sstevel@tonic-gate {"lstat64",	2, DEC, NOV, STG, HEX},				/* 216 */
4370Sstevel@tonic-gate {"fstat64",	2, DEC, NOV, DEC, HEX},				/* 217 */
4380Sstevel@tonic-gate {"statvfs64",	2, DEC, NOV, STG, HEX},				/* 218 */
4390Sstevel@tonic-gate {"fstatvfs64",	2, DEC, NOV, DEC, HEX},				/* 219 */
4400Sstevel@tonic-gate {"setrlimit64",	2, DEC, NOV, RLM, HEX},				/* 220 */
4410Sstevel@tonic-gate {"getrlimit64",	2, DEC, NOV, RLM, HEX},				/* 221 */
4420Sstevel@tonic-gate {"pread64",	5, DEC, NOV, DEC, IOB, UNS, LLO, HID},		/* 222 */
4430Sstevel@tonic-gate {"pwrite64",	5, DEC, NOV, DEC, IOB, UNS, LLO, HID},		/* 223 */
44411798SRoger.Faulkner@Sun.COM { NULL,		8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
4450Sstevel@tonic-gate {"open64",	3, DEC, NOV, STG, OPN, OCT},			/* 225 */
4460Sstevel@tonic-gate {"rpcmod",	3, DEC, NOV, DEC, HEX},				/* 226 */
4470Sstevel@tonic-gate {"zone",	5, DEC, NOV, DEC, HEX, HEX, HEX, HEX},		/* 227 */
4480Sstevel@tonic-gate {"autofssys",	2, DEC, NOV, DEC, HEX},				/* 228 */
4490Sstevel@tonic-gate {"getcwd",	3, DEC, NOV, RST, DEC},				/* 229 */
4500Sstevel@tonic-gate {"so_socket",	5, DEC, NOV, PFM, SKT, SKP, STG, SKV},		/* 230 */
4510Sstevel@tonic-gate {"so_socketpair", 1, DEC, NOV, HEX},				/* 231 */
4520Sstevel@tonic-gate {"bind",	4, DEC, NOV, DEC, HEX, DEC, SKV},		/* 232 */
4530Sstevel@tonic-gate {"listen",	3, DEC, NOV, DEC, DEC, SKV},			/* 233 */
4540Sstevel@tonic-gate {"accept",	4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 234 */
4550Sstevel@tonic-gate {"connect",	4, DEC, NOV, DEC, HEX, DEC, SKV},		/* 235 */
4560Sstevel@tonic-gate {"shutdown",	3, DEC, NOV, DEC, SHT, SKV},			/* 236 */
4570Sstevel@tonic-gate {"recv",	4, DEC, NOV, DEC, IOB, DEC, DEC},		/* 237 */
4580Sstevel@tonic-gate {"recvfrom",	6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, HEX},	/* 238 */
4590Sstevel@tonic-gate {"recvmsg",	3, DEC, NOV, DEC, HEX, DEC},			/* 239 */
4600Sstevel@tonic-gate {"send",	4, DEC, NOV, DEC, IOB, DEC, DEC},		/* 240 */
4610Sstevel@tonic-gate {"sendmsg",	3, DEC, NOV, DEC, HEX, DEC},			/* 241 */
4620Sstevel@tonic-gate {"sendto",	6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, DEC},	/* 242 */
4630Sstevel@tonic-gate {"getpeername", 4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 243 */
4640Sstevel@tonic-gate {"getsockname", 4, DEC, NOV, DEC, HEX, HEX, SKV},		/* 244 */
4650Sstevel@tonic-gate {"getsockopt",	6, DEC, NOV, DEC, SOL, SON, HEX, HEX, SKV},	/* 245 */
4660Sstevel@tonic-gate {"setsockopt",	6, DEC, NOV, DEC, SOL, SON, HEX, DEC, SKV},	/* 246 */
4670Sstevel@tonic-gate {"sockconfig",	4, DEC, NOV, DEC, DEC, DEC, STG},		/* 247 */
4680Sstevel@tonic-gate {"ntp_gettime",	1, DEC, NOV, HEX},				/* 248 */
4690Sstevel@tonic-gate {"ntp_adjtime",	1, DEC, NOV, HEX},				/* 249 */
4700Sstevel@tonic-gate {"lwp_mutex_unlock", 1, DEC, NOV, HEX},				/* 250 */
47110887SRoger.Faulkner@Sun.COM {"lwp_mutex_trylock", 2, DEC, NOV, HEX, HEX},			/* 251 */
4729264SRoger.Faulkner@Sun.COM {"lwp_mutex_register", 2, DEC, NOV, HEX, HEX},			/* 252 */
4730Sstevel@tonic-gate {"cladm",	3, DEC, NOV, CLC, CLF, HEX},			/* 253 */
4742712Snn35248 {"uucopy",	3, DEC, NOV, HEX, HEX, UNS},			/* 254 */
4750Sstevel@tonic-gate {"umount2",	2, DEC, NOV, STG, MTF},				/* 255 */
4760Sstevel@tonic-gate { NULL, -1, DEC, NOV},
4770Sstevel@tonic-gate };
4780Sstevel@tonic-gate 
4790Sstevel@tonic-gate /* SYSEND == max syscall number + 1 */
4800Sstevel@tonic-gate #define	SYSEND	((sizeof (systable) / sizeof (struct systable))-1)
4810Sstevel@tonic-gate 
4820Sstevel@tonic-gate 
4830Sstevel@tonic-gate /*
4840Sstevel@tonic-gate  * The following are for interpreting syscalls with sub-codes.
4850Sstevel@tonic-gate  */
4860Sstevel@tonic-gate 
48711798SRoger.Faulkner@Sun.COM const	struct systable	faccessattable[] = {
48811798SRoger.Faulkner@Sun.COM {"faccessat",	4, DEC, NOV, ATC, STG, ACC, DEC},		/*  0 */
48911798SRoger.Faulkner@Sun.COM {"access",	3, DEC, NOV, HID, STG, ACC},			/*  1 */
49011798SRoger.Faulkner@Sun.COM };
49111798SRoger.Faulkner@Sun.COM #define	NACCESSCODE	(sizeof (faccessattable) / sizeof (struct systable))
49211798SRoger.Faulkner@Sun.COM 
49311798SRoger.Faulkner@Sun.COM const	struct systable	fchownattable[] = {
49411798SRoger.Faulkner@Sun.COM {"fchownat",	5, DEC, NOV, ATC, STG, DEC, DEC, UTF},		/*  0 */
49511798SRoger.Faulkner@Sun.COM {"chown",	4, DEC, NOV, HID, STG, DEC, DEC},		/*  1 */
49611798SRoger.Faulkner@Sun.COM {"lchown",	4, DEC, NOV, HID, STG, DEC, DEC},		/*  2 */
49711798SRoger.Faulkner@Sun.COM {"fchown",	4, DEC, NOV, DEC, HID, DEC, DEC},		/*  3 */
49811798SRoger.Faulkner@Sun.COM };
49911798SRoger.Faulkner@Sun.COM #define	NCHOWNCODE	(sizeof (fchownattable) / sizeof (struct systable))
50011798SRoger.Faulkner@Sun.COM 
50111798SRoger.Faulkner@Sun.COM const	struct systable	renameattable[] = {
50211798SRoger.Faulkner@Sun.COM {"renameat",	4, DEC, NOV, ATC, STG, ATC, STG},		/*  0 */
50311798SRoger.Faulkner@Sun.COM {"rename",	4, DEC, NOV, HID, STG, HID, STG},		/*  1 */
50411798SRoger.Faulkner@Sun.COM };
50511798SRoger.Faulkner@Sun.COM #define	NRENAMECODE	(sizeof (renameattable) / sizeof (struct systable))
50611798SRoger.Faulkner@Sun.COM 
50711798SRoger.Faulkner@Sun.COM const	struct systable	unlinkattable[] = {
50811798SRoger.Faulkner@Sun.COM {"unlinkat",	3, DEC, NOV, ATC, STG, DEC},			/*  0 */
50911798SRoger.Faulkner@Sun.COM {"unlink",	2, DEC, NOV, HID, STG},				/*  1 */
51011798SRoger.Faulkner@Sun.COM {"rmdir",	2, DEC, NOV, HID, STG},				/*  2 */
51111798SRoger.Faulkner@Sun.COM };
51211798SRoger.Faulkner@Sun.COM #define	NUNLINKCODE	(sizeof (unlinkattable) / sizeof (struct systable))
51311798SRoger.Faulkner@Sun.COM 
51411798SRoger.Faulkner@Sun.COM const	struct systable	fstatattable[] = {
51511798SRoger.Faulkner@Sun.COM {"fstatat",	4, DEC, NOV, ATC, STG, HEX, UTF},		/*  0 */
51611798SRoger.Faulkner@Sun.COM {"stat",	3, DEC, NOV, HID, STG, HEX},			/*  1 */
51711798SRoger.Faulkner@Sun.COM {"lstat",	3, DEC, NOV, HID, STG, HEX},			/*  2 */
51811798SRoger.Faulkner@Sun.COM {"fstat",	3, DEC, NOV, DEC, HID, HEX},			/*  3 */
51911798SRoger.Faulkner@Sun.COM };
52011798SRoger.Faulkner@Sun.COM #define	NSTATCODE	(sizeof (fstatattable) / sizeof (struct systable))
52111798SRoger.Faulkner@Sun.COM 
52211798SRoger.Faulkner@Sun.COM const	struct systable	fstatat64table[] = {
52311798SRoger.Faulkner@Sun.COM {"fstatat64",	4, DEC, NOV, ATC, STG, HEX, UTF},		/*  0 */
52411798SRoger.Faulkner@Sun.COM {"stat64",	3, DEC, NOV, HID, STG, HEX},			/*  1 */
52511798SRoger.Faulkner@Sun.COM {"lstat64",	3, DEC, NOV, HID, STG, HEX},			/*  2 */
52611798SRoger.Faulkner@Sun.COM {"fstat64",	3, DEC, NOV, DEC, HID, HEX},			/*  3 */
52711798SRoger.Faulkner@Sun.COM };
52811798SRoger.Faulkner@Sun.COM #define	NSTAT64CODE	(sizeof (fstatat64table) / sizeof (struct systable))
52911798SRoger.Faulkner@Sun.COM 
53011798SRoger.Faulkner@Sun.COM const	struct systable openattable[] = {
53111798SRoger.Faulkner@Sun.COM {"openat",	3, DEC, NOV, ATC, STG, OPN},			/* 0 */
53211798SRoger.Faulkner@Sun.COM {"openat",	4, DEC, NOV, ATC, STG, OPN, OCT},		/* 1 */
53311798SRoger.Faulkner@Sun.COM {"open",	3, DEC, NOV, HID, STG, OPN},			/* 2 */
53411798SRoger.Faulkner@Sun.COM {"open",	4, DEC, NOV, HID, STG, OPN, OCT},		/* 3 */
53511798SRoger.Faulkner@Sun.COM };
53611798SRoger.Faulkner@Sun.COM #define	NOPENATCODE	(sizeof (openattable) / sizeof (struct systable))
53711798SRoger.Faulkner@Sun.COM 
53811798SRoger.Faulkner@Sun.COM const	struct systable openat64table[] = {
53911798SRoger.Faulkner@Sun.COM {"openat64",	3, DEC, NOV, ATC, STG, OPN},			/* 0 */
54011798SRoger.Faulkner@Sun.COM {"openat64",	4, DEC, NOV, ATC, STG, OPN, OCT},		/* 1 */
54111798SRoger.Faulkner@Sun.COM {"open64",	3, DEC, NOV, HID, STG, OPN},			/* 2 */
54211798SRoger.Faulkner@Sun.COM {"open64",	4, DEC, NOV, HID, STG, OPN, OCT},		/* 3 */
54311798SRoger.Faulkner@Sun.COM };
54411798SRoger.Faulkner@Sun.COM #define	NOPENAT64CODE	(sizeof (openat64table) / sizeof (struct systable))
54511798SRoger.Faulkner@Sun.COM 
5460Sstevel@tonic-gate const	struct systable opentable[] = {
5470Sstevel@tonic-gate {"open",	2, DEC, NOV, STG, OPN},				/* 0 */
5480Sstevel@tonic-gate {"open",	3, DEC, NOV, STG, OPN, OCT},			/* 1 */
5490Sstevel@tonic-gate };
5500Sstevel@tonic-gate #define	NOPENCODE	(sizeof (opentable) / sizeof (struct systable))
5510Sstevel@tonic-gate 
5520Sstevel@tonic-gate const	struct systable open64table[] = {
5530Sstevel@tonic-gate {"open64",	2, DEC, NOV, STG, OPN},				/* 0 */
5540Sstevel@tonic-gate {"open64",	3, DEC, NOV, STG, OPN, OCT},			/* 1 */
5550Sstevel@tonic-gate };
5560Sstevel@tonic-gate #define	NOPEN64CODE	(sizeof (open64table) / sizeof (struct systable))
5570Sstevel@tonic-gate 
5580Sstevel@tonic-gate const	struct systable fcntltable[] = {
5590Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, HEX},			/* 0: default */
5600Sstevel@tonic-gate {"fcntl",	2, DEC, NOV, DEC, FCN},				/* 1: no arg */
5610Sstevel@tonic-gate {"fcntl",	3, DEC, NOV, DEC, FCN, FFG},			/* 2: F_SETFL */
5620Sstevel@tonic-gate };
5630Sstevel@tonic-gate #define	NFCNTLCODE	(sizeof (fcntltable) / sizeof (struct systable))
5640Sstevel@tonic-gate 
5650Sstevel@tonic-gate const	struct systable msgtable[] = {
5660Sstevel@tonic-gate {"msgget",	3, DEC, NOV, HID, KEY, MSF},			/* 0 */
5670Sstevel@tonic-gate {"msgctl",	4, DEC, NOV, HID, DEC, MSC, HEX},		/* 1 */
5680Sstevel@tonic-gate {"msgrcv",	6, DEC, NOV, HID, DEC, HEX, UNS, DEC, MSF},	/* 2 */
5690Sstevel@tonic-gate {"msgsnd",	5, DEC, NOV, HID, DEC, HEX, UNS, MSF},		/* 3 */
5700Sstevel@tonic-gate {"msgids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 4 */
5710Sstevel@tonic-gate {"msgsnap",	5, DEC, NOV, HID, DEC, HEX, UNS, DEC},		/* 5 */
5720Sstevel@tonic-gate };
5730Sstevel@tonic-gate #define	NMSGCODE	(sizeof (msgtable) / sizeof (struct systable))
5740Sstevel@tonic-gate 
5750Sstevel@tonic-gate const	struct systable semtable[] = {
5760Sstevel@tonic-gate {"semctl",	5, DEC, NOV, HID, DEC, DEC, SMC, DEX},		/* 0 */
5770Sstevel@tonic-gate {"semget",	4, DEC, NOV, HID, KEY, DEC, SEF},		/* 1 */
5780Sstevel@tonic-gate {"semop",	4, DEC, NOV, HID, DEC, HEX, UNS},		/* 2 */
5790Sstevel@tonic-gate {"semids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 3 */
5800Sstevel@tonic-gate {"semtimedop",	5, DEC, NOV, HID, DEC, HEX, UNS, HEX},		/* 4 */
5810Sstevel@tonic-gate };
5820Sstevel@tonic-gate #define	NSEMCODE	(sizeof (semtable) / sizeof (struct systable))
5830Sstevel@tonic-gate 
5840Sstevel@tonic-gate const	struct systable shmtable[] = {
5850Sstevel@tonic-gate {"shmat",	4, HEX, NOV, HID, DEC, DEX, SHF},		/* 0 */
5860Sstevel@tonic-gate {"shmctl",	4, DEC, NOV, HID, DEC, SHC, DEX},		/* 1 */
5870Sstevel@tonic-gate {"shmdt",	2, DEC, NOV, HID, HEX},				/* 2 */
5880Sstevel@tonic-gate {"shmget",	4, DEC, NOV, HID, KEY, UNS, SHF},		/* 3 */
5890Sstevel@tonic-gate {"shmids",	4, DEC, NOV, HID, HEX, UNS, HEX},		/* 4 */
5900Sstevel@tonic-gate };
5910Sstevel@tonic-gate #define	NSHMCODE	(sizeof (shmtable) / sizeof (struct systable))
5920Sstevel@tonic-gate 
5930Sstevel@tonic-gate const	struct systable pidtable[] = {
5940Sstevel@tonic-gate {"getpgrp",	1, DEC, NOV, HID},				/* 0 */
5950Sstevel@tonic-gate {"setpgrp",	1, DEC, NOV, HID},				/* 1 */
5960Sstevel@tonic-gate {"getsid",	2, DEC, NOV, HID, DEC},				/* 2 */
5970Sstevel@tonic-gate {"setsid",	1, DEC, NOV, HID},				/* 3 */
5980Sstevel@tonic-gate {"getpgid",	2, DEC, NOV, HID, DEC},				/* 4 */
5990Sstevel@tonic-gate {"setpgid",	3, DEC, NOV, HID, DEC, DEC},			/* 5 */
6000Sstevel@tonic-gate };
6010Sstevel@tonic-gate #define	NPIDCODE	(sizeof (pidtable) / sizeof (struct systable))
6020Sstevel@tonic-gate 
6030Sstevel@tonic-gate const	struct systable sfstable[] = {
6040Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEX, DEX},			/* 0 */
6050Sstevel@tonic-gate {"sysfs",	2, DEC, NOV, SFS, STG},				/* 1 */
6060Sstevel@tonic-gate {"sysfs",	3, DEC, NOV, SFS, DEC, RST},			/* 2 */
6070Sstevel@tonic-gate {"sysfs",	1, DEC, NOV, SFS},				/* 3 */
6080Sstevel@tonic-gate };
6090Sstevel@tonic-gate #define	NSFSCODE	(sizeof (sfstable) / sizeof (struct systable))
6100Sstevel@tonic-gate 
6110Sstevel@tonic-gate const	struct systable utstable[] = {
6120Sstevel@tonic-gate {"utssys",	3, DEC, NOV, HEX, DEC, UTS},			/* 0 */
6130Sstevel@tonic-gate {"utssys",	4, DEC, NOV, HEX, HEX, HEX, HEX},		/* err */
6140Sstevel@tonic-gate {"utssys",	3, DEC, NOV, HEX, HHX, UTS},			/* 2 */
6150Sstevel@tonic-gate {"utssys",	4, DEC, NOV, STG, FUI, UTS, HEX}		/* 3 */
6160Sstevel@tonic-gate };
6170Sstevel@tonic-gate #define	NUTSCODE	(sizeof (utstable) / sizeof (struct systable))
6180Sstevel@tonic-gate 
6192447Snf202958 const	struct systable rctltable[] = {
6202447Snf202958 {"getrctl",	6, DEC, NOV, HID, STG, HEX, HEX, HID, RGF},	/* 0 */
6212447Snf202958 {"setrctl",	6, DEC, NOV, HID, STG, HEX, HEX, HID, RSF},	/* 1 */
6222447Snf202958 {"rctlsys_lst",	6, DEC, NOV, HID, HID, HEX, HID, HEX, HID},	/* 2 */
6232447Snf202958 {"rctlsys_ctl",	6, DEC, NOV, HID, STG, HEX, HID, HID, RCF},	/* 3 */
6243684Srd117015 {"setprojrctl",	6, DEC, NOV, HID, STG, HID, HEX, HEX, SPF},	/* 4 */
6252447Snf202958 };
6262447Snf202958 #define	NRCTLCODE	(sizeof (rctltable) / sizeof (struct systable))
6272447Snf202958 
6280Sstevel@tonic-gate const	struct systable sgptable[] = {
6290Sstevel@tonic-gate {"sigpendsys",	2, DEC, NOV, DEC, HEX},				/* err */
6300Sstevel@tonic-gate {"sigpending",	2, DEC, NOV, HID, HEX},				/* 1 */
6310Sstevel@tonic-gate {"sigfillset",	2, DEC, NOV, HID, HEX},				/* 2 */
6320Sstevel@tonic-gate };
6330Sstevel@tonic-gate #define	NSGPCODE	(sizeof (sgptable) / sizeof (struct systable))
6340Sstevel@tonic-gate 
6350Sstevel@tonic-gate const	struct systable ctxtable[] = {
6360Sstevel@tonic-gate {"getcontext",	2, DEC, NOV, HID, HEX},				/* 0 */
6370Sstevel@tonic-gate {"setcontext",	2, DEC, NOV, HID, HEX},				/* 1 */
6380Sstevel@tonic-gate {"getustack",	2, DEC, NOV, HID, HEX},				/* 2 */
6390Sstevel@tonic-gate {"setustack",	2, DEC, NOV, HID, HEX},				/* 3 */
6400Sstevel@tonic-gate };
6410Sstevel@tonic-gate #define	NCTXCODE	(sizeof (ctxtable) / sizeof (struct systable))
6420Sstevel@tonic-gate 
6430Sstevel@tonic-gate const	struct systable hrttable[] = {
6440Sstevel@tonic-gate {"hrtcntl",	5, DEC, NOV, HID, DEC, DEC, HEX, HEX},		/* 0 */
6450Sstevel@tonic-gate {"hrtalarm",	3, DEC, NOV, HID, HEX, DEC},			/* 1 */
6460Sstevel@tonic-gate {"hrtsleep",	2, DEC, NOV, HID, HEX},				/* 2 */
6470Sstevel@tonic-gate {"hrtcancel",	3, DEC, NOV, HID, HEX, DEC},			/* 3 */
6480Sstevel@tonic-gate };
6490Sstevel@tonic-gate #define	NHRTCODE	(sizeof (hrttable) / sizeof (struct systable))
6500Sstevel@tonic-gate 
6510Sstevel@tonic-gate const	struct systable cortable[] = {
6520Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, HEX, HEX, HEX},		/* 0 */
6530Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCO},				/* 1 */
6540Sstevel@tonic-gate {"corectl",	1, HHX, NOV, COR},				/* 2 */
6550Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, STG, DEC},			/* 3 */
6560Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RST, DEC},			/* 4 */
6570Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, STG, DEC, DEC},		/* 5 */
6580Sstevel@tonic-gate {"corectl",	4, DEC, NOV, COR, RST, DEC, DEC},		/* 6 */
6590Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCC},				/* 7 */
6600Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, RCC},				/* 8 */
6610Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, CCC, DEC},			/* 9 */
6620Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RCC, DEC},			/* 10 */
6630Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, STG, DEC},			/* 11 */
6640Sstevel@tonic-gate {"corectl",	3, DEC, NOV, COR, RST, DEC},			/* 12 */
6650Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, CCC},				/* 13 */
6660Sstevel@tonic-gate {"corectl",	2, DEC, NOV, COR, RCC},				/* 14 */
6670Sstevel@tonic-gate };
6680Sstevel@tonic-gate #define	NCORCODE	(sizeof (cortable) / sizeof (struct systable))
6690Sstevel@tonic-gate 
6700Sstevel@tonic-gate const	struct systable aiotable[] = {
6710Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 0 */
6720Sstevel@tonic-gate {"kaio",	7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 1 */
6730Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, HEX, DEC},			/* 2 */
6740Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, DEC, HEX},			/* 3 */
6750Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 4 */
6760Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 5 */
6770Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 6 */
6780Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 7 */
6790Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, DEC},		/* 8 */
6800Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 9 */
6810Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 10 */
6820Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 11 */
6830Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 12 */
6840Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 13 */
6850Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, DEC},		/* 14 */
6860Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 15 */
6870Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, LIO, HEX, DEC, HEX},		/* 16 */
6880Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 17 */
6890Sstevel@tonic-gate {"kaio",	2, DEC, NOV, AIO, HEX},				/* 18 */
6900Sstevel@tonic-gate {"kaio",	3, DEC, NOV, AIO, DEC, HEX},			/* 19 */
6910Sstevel@tonic-gate {"kaio",	1, DEC, NOV, AIO},				/* 20 */
6920Sstevel@tonic-gate {"kaio",	5, DEC, NOV, AIO, HEX, DEC, HEX, HEX},		/* 21 */
6930Sstevel@tonic-gate };
6940Sstevel@tonic-gate #define	NAIOCODE	(sizeof (aiotable) / sizeof (struct systable))
6950Sstevel@tonic-gate 
6960Sstevel@tonic-gate const	struct systable doortable[] = {
6970Sstevel@tonic-gate {"door_create", 3, DEC, NOV, HEX, HEX, DFL},			/* 0 */
6980Sstevel@tonic-gate {"door_revoke", 1, DEC, NOV, DEC},				/* 1 */
6990Sstevel@tonic-gate {"door_info",	2, DEC, NOV, DEC, HEX},				/* 2 */
7000Sstevel@tonic-gate {"door_call",	2, DEC, NOV, DEC, HEX},				/* 3 */
7010Sstevel@tonic-gate {"door_return", 4, DEC, NOV, HEX, DEC, HEX, DEC},		/* 4 (old) */
7020Sstevel@tonic-gate {"door_cred",	1, DEC, NOV, HEX},				/* 5 (old) */
7030Sstevel@tonic-gate {"door_bind",	1, DEC, NOV, DEC},				/* 6 */
7040Sstevel@tonic-gate {"door_unbind", 0, DEC, NOV},					/* 7 */
7050Sstevel@tonic-gate {"door_unref",	0, DEC, NOV},					/* 8 */
7060Sstevel@tonic-gate {"door_ucred",	1, DEC, NOV, HEX},				/* 9 */
7070Sstevel@tonic-gate {"door_return", 5, DEC, NOV, HEX, DEC, HEX, HEX, DEC},		/* 10 */
7080Sstevel@tonic-gate {"door_getparam", 3, DEC, NOV, DEC, DPM, HEX},			/* 11 */
7090Sstevel@tonic-gate {"door_setparam", 3, DEC, NOV, DEC, DPM, DEC},			/* 12 */
7100Sstevel@tonic-gate };
7110Sstevel@tonic-gate #define	NDOORCODE	(sizeof (doortable) / sizeof (struct systable))
7120Sstevel@tonic-gate 
7130Sstevel@tonic-gate const	struct systable psettable[] = {
7140Sstevel@tonic-gate {"pset_create", 2, DEC, NOV, HID, HEX},				/* 0 */
7150Sstevel@tonic-gate {"pset_destroy", 2, DEC, NOV, HID, PST},			/* 1 */
7160Sstevel@tonic-gate {"pset_assign",	4, DEC, NOV, HID, PST, DEC, HEX},		/* 2 */
7170Sstevel@tonic-gate {"pset_info",	5, DEC, NOV, HID, PST, HEX, HEX, HEX},		/* 3 */
7180Sstevel@tonic-gate {"pset_bind",	5, DEC, NOV, HID, PST, IDT, DEC, HEX},		/* 4 */
7190Sstevel@tonic-gate {"pset_getloadavg", 4, DEC, NOV, HID, PST, HEX, DEC},		/* 5 */
7200Sstevel@tonic-gate {"pset_list",	3, DEC, NOV, HID, HEX, HEX},			/* 6 */
7210Sstevel@tonic-gate {"pset_setattr", 3, DEC, NOV, HID, PST, HEX},			/* 7 */
7220Sstevel@tonic-gate {"pset_getattr", 3, DEC, NOV, HID, PST, HEX},			/* 8 */
7230Sstevel@tonic-gate {"pset_assign_forced",	4, DEC, NOV, HID, PST, DEC, HEX},	/* 9 */
7240Sstevel@tonic-gate };
7250Sstevel@tonic-gate #define	NPSETCODE	(sizeof (psettable) / sizeof (struct systable))
7260Sstevel@tonic-gate 
7270Sstevel@tonic-gate const	struct systable lwpcreatetable[] = {
7280Sstevel@tonic-gate {"lwp_create",	3, DEC, NOV, HEX, LWF, HEX},			/* 0 */
7290Sstevel@tonic-gate {"lwp_create",	0, DEC, NOV},					/* 1 */
7300Sstevel@tonic-gate };
7310Sstevel@tonic-gate #define	NLWPCREATECODE	(sizeof (lwpcreatetable) / sizeof (struct systable))
7320Sstevel@tonic-gate 
7330Sstevel@tonic-gate static	const	struct systable tasksystable[] = {
7340Sstevel@tonic-gate {"settaskid",	3, DEC, NOV, HID, DEC, HEX},			/* 0 */
7350Sstevel@tonic-gate {"gettaskid",	1, DEC, NOV, HID},				/* 1 */
7360Sstevel@tonic-gate {"getprojid",	1, DEC, NOV, HID},				/* 2 */
7370Sstevel@tonic-gate };
7380Sstevel@tonic-gate #define	NTASKSYSCODE	(sizeof (tasksystable) / sizeof (struct systable))
7390Sstevel@tonic-gate 
7400Sstevel@tonic-gate static const	struct systable privsystable[] = {
7410Sstevel@tonic-gate {"setppriv",		4, DEC, NOV, HID, PRO, PRN, PRS},	/* 0 */
7420Sstevel@tonic-gate {"getppriv",		4, DEC, NOV, HID, HID, PRN, PRS},	/* 1 */
7430Sstevel@tonic-gate {"getprivimplinfo",	5, DEC, NOV, HID, HID, HID, HEX, DEC},	/* 2 */
7440Sstevel@tonic-gate {"setpflags",		3, DEC, NOV, HID, PFL, DEC},		/* 3 */
7450Sstevel@tonic-gate {"getpflags",		2, DEC, NOV, HID, PFL},			/* 4 */
7464321Scasper {"issetugid",		0, DEC, NOV, HID},			/* 5 */
7470Sstevel@tonic-gate };
7480Sstevel@tonic-gate #define	NPRIVSYSCODE	(sizeof (privsystable) / sizeof (struct systable))
7490Sstevel@tonic-gate 
7500Sstevel@tonic-gate static	const	struct systable exacctsystable[] = {
7510Sstevel@tonic-gate {"getacct",	5, DEC, NOV, HID, IDT, DEC, HEX, UNS},		/* 0 */
7520Sstevel@tonic-gate {"putacct",	6, DEC, NOV, HID, IDT, DEC, HEX, UNS, HEX},	/* 1 */
7530Sstevel@tonic-gate {"wracct",	4, DEC, NOV, HID, IDT, DEC, HEX},		/* 2 */
7540Sstevel@tonic-gate };
7550Sstevel@tonic-gate #define	NEXACCTSYSCODE	(sizeof (exacctsystable) / sizeof (struct systable))
7560Sstevel@tonic-gate 
7570Sstevel@tonic-gate static	const	struct systable lwpparktable[] = {
7580Sstevel@tonic-gate {"lwp_park",	3, DEC, NOV, HID, HEX, DEC},			/* 0 */
7590Sstevel@tonic-gate {"lwp_unpark",	2, DEC, NOV, HID, DEC},				/* 1 */
7600Sstevel@tonic-gate {"lwp_unpark_all", 3, DEC, NOV, HID, HEX, DEC},			/* 2 */
7614389Ssl108498 {"lwp_unpark_cancel",	2, DEC, NOV, HID, DEC},			/* 3 */
7624389Ssl108498 {"lwp_set_park",	3, DEC, NOV, HID, HEX, DEC},		/* 4 */
7630Sstevel@tonic-gate };
7640Sstevel@tonic-gate #define	NLWPPARKCODE	(sizeof (lwpparktable) / sizeof (struct systable))
7650Sstevel@tonic-gate 
7660Sstevel@tonic-gate static	const	struct systable lwprwlocktable[] = {
7670Sstevel@tonic-gate {"lwp_rwlock_rdlock", 3, DEC, NOV, HID, HEX, HEX},		/* 0 */
7680Sstevel@tonic-gate {"lwp_rwlock_wrlock", 3, DEC, NOV, HID, HEX, HEX},		/* 1 */
7690Sstevel@tonic-gate {"lwp_rwlock_tryrdlock", 2, DEC, NOV, HID, HEX},		/* 2 */
7700Sstevel@tonic-gate {"lwp_rwlock_trywrlock", 2, DEC, NOV, HID, HEX},		/* 3 */
7710Sstevel@tonic-gate {"lwp_rwlock_unlock", 2, DEC, NOV, HID, HEX},			/* 4 */
7720Sstevel@tonic-gate };
7730Sstevel@tonic-gate #define	NLWPRWLOCKCODE	(sizeof (lwprwlocktable) / sizeof (struct systable))
7740Sstevel@tonic-gate 
7750Sstevel@tonic-gate static	const	struct systable sendfilevsystable[] = {
7760Sstevel@tonic-gate {"sendfilev",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/* 0 */
7770Sstevel@tonic-gate {"sendfilev64",	5, DEC, NOV, DEC, DEC, HEX, DEC, HEX},		/* 1 */
7780Sstevel@tonic-gate };
7790Sstevel@tonic-gate #define	NSENDFILESYSCODE \
7800Sstevel@tonic-gate 		(sizeof (sendfilevsystable) / sizeof (struct systable))
7810Sstevel@tonic-gate 
7820Sstevel@tonic-gate static	const	struct systable lgrpsystable[] = {
7830Sstevel@tonic-gate {"meminfo",		3, DEC, NOV, HID, NOV, MIF},		/* 0 */
7840Sstevel@tonic-gate {"_lgrpsys",		3, DEC, NOV, DEC, DEC, NOV},		/* 1 */
7850Sstevel@tonic-gate {"lgrp_version",	3, DEC, NOV, HID, DEC, NOV},		/* 2 */
7860Sstevel@tonic-gate {"_lgrpsys",		3, DEC, NOV, DEC, HEX, HEX},		/* 3 */
7870Sstevel@tonic-gate {"lgrp_affinity_get",	3, DEC, NOV, HID, NOV, LAF},		/* 4 */
7880Sstevel@tonic-gate {"lgrp_affinity_set",	3, DEC, NOV, HID, NOV, LAF},		/* 5 */
7890Sstevel@tonic-gate {"lgrp_latency",	3, DEC, NOV, HID, DEC, DEC},		/* 6 */
7900Sstevel@tonic-gate };
7910Sstevel@tonic-gate #define	NLGRPSYSCODE	(sizeof (lgrpsystable) / sizeof (struct systable))
7920Sstevel@tonic-gate 
7930Sstevel@tonic-gate static	const	struct systable rusagesystable[] = {
7940Sstevel@tonic-gate {"getrusage",		2, DEC, NOV, HID, HEX},			/* 0 */
7950Sstevel@tonic-gate {"getrusage_chld",	2, DEC, NOV, HID, HEX},			/* 1 */
7960Sstevel@tonic-gate {"getrusage_lwp",	2, DEC, NOV, HID, HEX},			/* 2 */
7973247Sgjelinek {"getvmusage",		5, DEC, NOV, HID, HEX, DEC, HEX, HEX},	/* 3 */
7980Sstevel@tonic-gate };
7990Sstevel@tonic-gate #define	NRUSAGESYSCODE \
8000Sstevel@tonic-gate 		(sizeof (rusagesystable) / sizeof (struct systable))
8010Sstevel@tonic-gate 
8020Sstevel@tonic-gate static const	struct systable ucredsystable[] = {
8030Sstevel@tonic-gate {"ucred_get",	3, DEC, NOV, HID, DEC, HEX},
8040Sstevel@tonic-gate {"getpeerucred", 3, DEC, NOV, HID, DEC, HEX},
8050Sstevel@tonic-gate };
8060Sstevel@tonic-gate #define	NUCREDSYSCODE \
8070Sstevel@tonic-gate 		(sizeof (ucredsystable) / sizeof (struct systable))
8080Sstevel@tonic-gate 
8090Sstevel@tonic-gate const	struct systable portfstable[] = {
8100Sstevel@tonic-gate {"port_create",	2, DEC, NOV, HID, DEC},				/* 0 */
8110Sstevel@tonic-gate {"port_associate",	6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX}, /* 1 */
8120Sstevel@tonic-gate {"port_dissociate",	4, DEC, NOV, HID, DEC, DEC, HEX}, 	/* 2 */
8130Sstevel@tonic-gate {"port_send",	4, DEC, NOV, HID, DEC, HEX, HEX},		/* 3 */
8140Sstevel@tonic-gate {"port_sendn",	6, DEC, DEC, HID, HEX, HEX, DEC, HEX, HEX},	/* 4 */
8150Sstevel@tonic-gate {"port_get",	4, DEC, NOV, HID, DEC, HEX, HEX},		/* 5 */
8160Sstevel@tonic-gate {"port_getn",	6, DEC, DEC, HID, DEC, HEX, DEC, DEC, HEX},	/* 6 */
8170Sstevel@tonic-gate {"port_alert",	5, DEC, NOV, HID, DEC, HEX, HEX, HEX},		/* 7 */
8180Sstevel@tonic-gate {"port_dispatch", 6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX},	/* 8 */
8190Sstevel@tonic-gate };
8200Sstevel@tonic-gate #define	NPORTCODE	(sizeof (portfstable) / sizeof (struct systable))
8210Sstevel@tonic-gate 
8220Sstevel@tonic-gate static const struct systable zonetable[] = {
823813Sdp {"zone_create",	2, DEC, NOV, HID, HEX},				/* 0 */
8240Sstevel@tonic-gate {"zone_destroy", 2, DEC, NOV, HID, DEC},			/* 1 */
8250Sstevel@tonic-gate {"zone_getattr", 5, DEC, NOV, HID, DEC, ZGA, HEX, DEC},		/* 2 */
8260Sstevel@tonic-gate {"zone_enter",	2, DEC, NOV, HID, DEC},				/* 3 */
8270Sstevel@tonic-gate {"zone_list",	3, DEC, NOV, HID, HEX, HEX},			/* 4 */
8280Sstevel@tonic-gate {"zone_shutdown", 2, DEC, NOV, HID, DEC},			/* 5 */
8293235Sraf {"zone_lookup",	2, DEC, NOV, HID, STG},				/* 6 */
8303235Sraf {"zone_boot",	2, DEC, NOV, HID, DEC},				/* 7 */
831813Sdp {"zone_version", 2, HEX, NOV, HID, DEC},			/* 8 */
8322267Sdp {"zone_setattr", 5, DEC, NOV, HID, DEC, ZGA, HEX, DEC},		/* 9 */
8333448Sdh155122 {"zone_add_datalink", 3, DEC, NOV, HID, DEC, STG},		/* 10 */
8343448Sdh155122 {"zone_remove_datalink", 3, DEC, NOV, HID, DEC, STG},		/* 11 */
8353448Sdh155122 {"zone_check_datalink", 3, DEC, NOV, HID, HEX, STG},		/* 12 */
8363448Sdh155122 {"zone_list_datalink", 4, DEC, NOV, HID, DEC, HEX, HEX},	/* 13 */
8370Sstevel@tonic-gate };
8380Sstevel@tonic-gate #define	NZONECODE	(sizeof (zonetable) / sizeof (struct systable))
8390Sstevel@tonic-gate 
8401676Sjpk static const struct systable labeltable[] = {
8413235Sraf {"labelsys",	3, DEC, NOV, HID, HEX, HEX},			/* 0 */
8421676Sjpk {"is_system_labeled", 1, DEC, NOV, HID},			/* 1 */
8433235Sraf {"tnrh",	3, DEC, NOV, HID, TND, HEX},			/* 2 */
8443235Sraf {"tnrhtp",	3, DEC, NOV, HID, TND, HEX},			/* 3 */
8453235Sraf {"tnmlp",	3, DEC, NOV, HID, TND, HEX},			/* 4 */
8463235Sraf {"getlabel",	3, DEC, NOV, HID, STG, HEX},			/* 5 */
8473235Sraf {"fgetlabel",	3, DEC, NOV, HID, DEC, HEX},			/* 6 */
8481676Sjpk };
8491676Sjpk #define	NLABELCODE	(sizeof (labeltable) / sizeof (struct systable))
8501676Sjpk 
8513235Sraf const	struct systable forktable[] = {
8523235Sraf /* parent codes */
8533235Sraf {"forkx",	2, DEC, NOV, HID, FXF},				/* 0 */
8543235Sraf {"forkallx",	2, DEC, NOV, HID, FXF},				/* 1 */
8553235Sraf {"vforkx",	2, DEC, NOV, HID, FXF},				/* 2 */
8563235Sraf /* child codes */
8573235Sraf {"forkx",	0, DEC, NOV},					/* 3 */
8583235Sraf {"forkallx",	0, DEC, NOV},					/* 4 */
8593235Sraf {"vforkx",	0, DEC, NOV},					/* 5 */
8603235Sraf };
8613235Sraf #define	NFORKCODE	(sizeof (forktable) / sizeof (struct systable))
8623235Sraf 
8634321Scasper const	struct systable sidsystable[] = {
8644321Scasper {"allocids",	4, UNS, UNS, HID, DEC, DEC, DEC},		/* 0 */
8654321Scasper {"idmap_reg",	2, DEC, NOV, HID, DEC},				/* 1 */
8664321Scasper {"idmap_unreg",	2, DEC, NOV, HID, DEC},				/* 2 */
8674321Scasper };
8684321Scasper #define	NSIDSYSCODE	(sizeof (sidsystable) / sizeof (struct systable))
8694321Scasper 
87010440SRoger.Faulkner@Sun.COM const	struct systable utimesystable[] = {
87110440SRoger.Faulkner@Sun.COM {"futimens",	3, DEC, NOV, HID, DEC, HEX},			/* 0 */
87210440SRoger.Faulkner@Sun.COM {"utimensat",	5, DEC, NOV, HID, ATC, STG, HEX, UTF},		/* 1 */
87310440SRoger.Faulkner@Sun.COM };
87410440SRoger.Faulkner@Sun.COM #define	NUTIMESYSCODE	(sizeof (utimesystable) / sizeof (struct systable))
87510440SRoger.Faulkner@Sun.COM 
8760Sstevel@tonic-gate const	struct sysalias sysalias[] = {
8770Sstevel@tonic-gate 	{ "exit",	SYS_exit	},
8783235Sraf 	{ "fork",	SYS_forksys	},
87911798SRoger.Faulkner@Sun.COM 	{ "fork1",	SYS_forksys	},
88011798SRoger.Faulkner@Sun.COM 	{ "forkall",	SYS_forksys	},
8813235Sraf 	{ "forkx",	SYS_forksys	},
8823235Sraf 	{ "forkallx",	SYS_forksys	},
8833235Sraf 	{ "vforkx",	SYS_forksys	},
8840Sstevel@tonic-gate 	{ "sbrk",	SYS_brk		},
8850Sstevel@tonic-gate 	{ "getppid",	SYS_getpid	},
8860Sstevel@tonic-gate 	{ "geteuid",	SYS_getuid	},
8870Sstevel@tonic-gate 	{ "getpgrp",	SYS_pgrpsys	},
8880Sstevel@tonic-gate 	{ "setpgrp",	SYS_pgrpsys	},
8890Sstevel@tonic-gate 	{ "getsid",	SYS_pgrpsys	},
8900Sstevel@tonic-gate 	{ "setsid",	SYS_pgrpsys	},
8910Sstevel@tonic-gate 	{ "getpgid",	SYS_pgrpsys	},
8920Sstevel@tonic-gate 	{ "setpgid",	SYS_pgrpsys	},
8930Sstevel@tonic-gate 	{ "getegid",	SYS_getgid	},
8940Sstevel@tonic-gate 	{ "msgget",	SYS_msgsys	},
8950Sstevel@tonic-gate 	{ "msgctl",	SYS_msgsys	},
8960Sstevel@tonic-gate 	{ "msgctl64",	SYS_msgsys	},
8970Sstevel@tonic-gate 	{ "msgrcv",	SYS_msgsys	},
8980Sstevel@tonic-gate 	{ "msgsnd",	SYS_msgsys	},
8990Sstevel@tonic-gate 	{ "msgids",	SYS_msgsys	},
9000Sstevel@tonic-gate 	{ "msgsnap",	SYS_msgsys	},
9010Sstevel@tonic-gate 	{ "msgop",	SYS_msgsys	},
9020Sstevel@tonic-gate 	{ "shmat",	SYS_shmsys	},
9030Sstevel@tonic-gate 	{ "shmctl",	SYS_shmsys	},
9040Sstevel@tonic-gate 	{ "shmctl64",	SYS_shmsys	},
9050Sstevel@tonic-gate 	{ "shmdt",	SYS_shmsys	},
9060Sstevel@tonic-gate 	{ "shmget",	SYS_shmsys	},
9070Sstevel@tonic-gate 	{ "shmids",	SYS_shmsys	},
9080Sstevel@tonic-gate 	{ "shmop",	SYS_shmsys	},
9090Sstevel@tonic-gate 	{ "semctl",	SYS_semsys	},
9100Sstevel@tonic-gate 	{ "semctl64",	SYS_semsys	},
9110Sstevel@tonic-gate 	{ "semget",	SYS_semsys	},
9120Sstevel@tonic-gate 	{ "semids",	SYS_semsys	},
9130Sstevel@tonic-gate 	{ "semop",	SYS_semsys	},
9140Sstevel@tonic-gate 	{ "semtimedop",	SYS_semsys	},
9150Sstevel@tonic-gate 	{ "uname",	SYS_utssys	},
9160Sstevel@tonic-gate 	{ "ustat",	SYS_utssys	},
9170Sstevel@tonic-gate 	{ "fusers",	SYS_utssys	},
9180Sstevel@tonic-gate 	{ "exec",	SYS_execve	},
9190Sstevel@tonic-gate 	{ "execl",	SYS_execve	},
9200Sstevel@tonic-gate 	{ "execv",	SYS_execve	},
9210Sstevel@tonic-gate 	{ "execle",	SYS_execve	},
9220Sstevel@tonic-gate 	{ "execlp",	SYS_execve	},
9230Sstevel@tonic-gate 	{ "execvp",	SYS_execve	},
9240Sstevel@tonic-gate 	{ "sigfillset",	SYS_sigpending	},
9250Sstevel@tonic-gate 	{ "getcontext",	SYS_context	},
9260Sstevel@tonic-gate 	{ "setcontext",	SYS_context	},
9270Sstevel@tonic-gate 	{ "getustack",	SYS_context	},
9280Sstevel@tonic-gate 	{ "setustack",	SYS_context	},
9290Sstevel@tonic-gate 	{ "hrtcntl",	SYS_hrtsys	},
9300Sstevel@tonic-gate 	{ "hrtalarm",	SYS_hrtsys	},
9310Sstevel@tonic-gate 	{ "hrtsleep",	SYS_hrtsys	},
9320Sstevel@tonic-gate 	{ "hrtcancel",	SYS_hrtsys	},
9330Sstevel@tonic-gate 	{ "aioread",	SYS_kaio	},
9340Sstevel@tonic-gate 	{ "aiowrite",	SYS_kaio	},
9350Sstevel@tonic-gate 	{ "aiowait",	SYS_kaio	},
9360Sstevel@tonic-gate 	{ "aiocancel",	SYS_kaio	},
9370Sstevel@tonic-gate 	{ "aionotify",	SYS_kaio	},
9380Sstevel@tonic-gate 	{ "audit",	SYS_auditsys	},
9390Sstevel@tonic-gate 	{ "door_create",	SYS_door	},
9400Sstevel@tonic-gate 	{ "door_revoke",	SYS_door	},
9410Sstevel@tonic-gate 	{ "door_info",		SYS_door	},
9420Sstevel@tonic-gate 	{ "door_call",		SYS_door	},
9430Sstevel@tonic-gate 	{ "door_return",	SYS_door	},
9440Sstevel@tonic-gate 	{ "door_bind",		SYS_door	},
9450Sstevel@tonic-gate 	{ "door_unbind",	SYS_door	},
9460Sstevel@tonic-gate 	{ "door_unref",		SYS_door	},
9470Sstevel@tonic-gate 	{ "door_ucred",		SYS_door	},
9480Sstevel@tonic-gate 	{ "door_getparam",	SYS_door	},
9490Sstevel@tonic-gate 	{ "door_setparam",	SYS_door	},
9500Sstevel@tonic-gate 	{ "pset_create",	SYS_pset	},
9510Sstevel@tonic-gate 	{ "pset_destroy",	SYS_pset	},
9520Sstevel@tonic-gate 	{ "pset_assign",	SYS_pset	},
9530Sstevel@tonic-gate 	{ "pset_info",		SYS_pset	},
9540Sstevel@tonic-gate 	{ "pset_bind",		SYS_pset	},
9550Sstevel@tonic-gate 	{ "pset_getloadavg",	SYS_pset	},
9560Sstevel@tonic-gate 	{ "pset_list",		SYS_pset	},
9570Sstevel@tonic-gate 	{ "pset_setattr",	SYS_pset	},
9580Sstevel@tonic-gate 	{ "pset_getattr",	SYS_pset	},
9590Sstevel@tonic-gate 	{ "pset_assign_forced",	SYS_pset	},
9600Sstevel@tonic-gate 	{ "settaskid",		SYS_tasksys	},
9610Sstevel@tonic-gate 	{ "gettaskid",		SYS_tasksys	},
9620Sstevel@tonic-gate 	{ "getprojid",		SYS_tasksys	},
9630Sstevel@tonic-gate 	{ "setppriv",		SYS_privsys	},
9640Sstevel@tonic-gate 	{ "getppriv",		SYS_privsys	},
9650Sstevel@tonic-gate 	{ "getprivimplinfo",	SYS_privsys	},
9660Sstevel@tonic-gate 	{ "setpflags",		SYS_privsys	},
9670Sstevel@tonic-gate 	{ "getpflags",		SYS_privsys	},
9680Sstevel@tonic-gate 	{ "getacct",		SYS_exacctsys	},
9690Sstevel@tonic-gate 	{ "putacct",		SYS_exacctsys	},
9700Sstevel@tonic-gate 	{ "wracct",		SYS_exacctsys	},
9710Sstevel@tonic-gate 	{ "lwp_cond_timedwait",	SYS_lwp_cond_wait },
97211798SRoger.Faulkner@Sun.COM 	{ "lwp_sema_wait",	SYS_lwp_sema_timedwait },
9730Sstevel@tonic-gate 	{ "lwp_park",		SYS_lwp_park	},
9740Sstevel@tonic-gate 	{ "lwp_unpark",		SYS_lwp_park	},
9750Sstevel@tonic-gate 	{ "lwp_unpark_all",	SYS_lwp_park	},
9760Sstevel@tonic-gate 	{ "lwp_rwlock_rdlock",	SYS_lwp_rwlock_sys },
9770Sstevel@tonic-gate 	{ "lwp_rwlock_wrlock",	SYS_lwp_rwlock_sys },
9780Sstevel@tonic-gate 	{ "lwp_rwlock_tryrdlock", SYS_lwp_rwlock_sys },
9790Sstevel@tonic-gate 	{ "lwp_rwlock_trywrlock", SYS_lwp_rwlock_sys },
9800Sstevel@tonic-gate 	{ "lwp_rwlock_unlock",	SYS_lwp_rwlock_sys },
98111798SRoger.Faulkner@Sun.COM 	{ "lwp_mutex_lock",	SYS_lwp_mutex_timedlock },
9820Sstevel@tonic-gate 	{ "sendfilev64",	SYS_sendfilev	},
98311798SRoger.Faulkner@Sun.COM 	{ "creat",		SYS_open	},
98411798SRoger.Faulkner@Sun.COM 	{ "creat64",		SYS_open64	},
98511798SRoger.Faulkner@Sun.COM 	{ "openattrdirat",	SYS_openat	},
9860Sstevel@tonic-gate 	{ "lgrpsys",		SYS_lgrpsys	},
9870Sstevel@tonic-gate 	{ "getrusage",		SYS_rusagesys	},
9880Sstevel@tonic-gate 	{ "getrusage_chld",	SYS_rusagesys	},
9890Sstevel@tonic-gate 	{ "getrusage_lwp",	SYS_rusagesys	},
9903247Sgjelinek 	{ "getvmusage",		SYS_rusagesys	},
9910Sstevel@tonic-gate 	{ "getpeerucred",	SYS_ucredsys	},
9920Sstevel@tonic-gate 	{ "ucred_get",		SYS_ucredsys	},
9930Sstevel@tonic-gate 	{ "port_create",	SYS_port	},
9940Sstevel@tonic-gate 	{ "port_associate",	SYS_port	},
9950Sstevel@tonic-gate 	{ "port_dissociate",	SYS_port	},
9960Sstevel@tonic-gate 	{ "port_send",		SYS_port	},
9970Sstevel@tonic-gate 	{ "port_sendn",		SYS_port	},
9980Sstevel@tonic-gate 	{ "port_get",		SYS_port	},
9990Sstevel@tonic-gate 	{ "port_getn",		SYS_port	},
10000Sstevel@tonic-gate 	{ "port_alert",		SYS_port	},
10010Sstevel@tonic-gate 	{ "port_dispatch",	SYS_port	},
10020Sstevel@tonic-gate 	{ "zone_create",	SYS_zone	},
10030Sstevel@tonic-gate 	{ "zone_destroy",	SYS_zone	},
10040Sstevel@tonic-gate 	{ "zone_getattr",	SYS_zone	},
10053247Sgjelinek 	{ "zone_setattr",	SYS_zone	},
10060Sstevel@tonic-gate 	{ "zone_enter",		SYS_zone	},
10070Sstevel@tonic-gate 	{ "getzoneid",		SYS_zone	},
10080Sstevel@tonic-gate 	{ "zone_list",		SYS_zone	},
10090Sstevel@tonic-gate 	{ "zone_shutdown",	SYS_zone	},
10103448Sdh155122 	{ "zone_add_datalink",	SYS_zone	},
10113448Sdh155122 	{ "zone_remove_datalink", SYS_zone	},
10123448Sdh155122 	{ "zone_check_datalink", SYS_zone	},
10133448Sdh155122 	{ "zone_list_datalink",	SYS_zone	},
10141676Sjpk 	{ "is_system_labeled",	SYS_labelsys	},
10151676Sjpk 	{ "tnrh",		SYS_labelsys	},
10161676Sjpk 	{ "tnrhtp",		SYS_labelsys	},
10171676Sjpk 	{ "tnmlp",		SYS_labelsys	},
10181676Sjpk 	{ "getlabel",		SYS_labelsys	},
10191676Sjpk 	{ "fgetlabel",		SYS_labelsys	},
10202447Snf202958 	{ "getrctl",		SYS_rctlsys	},
10212447Snf202958 	{ "setrctl",		SYS_rctlsys	},
10222447Snf202958 	{ "rctlsys_lst",	SYS_rctlsys	},
10232447Snf202958 	{ "rctlsys_ctl",	SYS_rctlsys	},
10244321Scasper 	{ "allocids",		SYS_sidsys	},
102510440SRoger.Faulkner@Sun.COM 	{ "futimens",		SYS_utimesys	},
102610440SRoger.Faulkner@Sun.COM 	{ "utimensat",		SYS_utimesys	},
102711798SRoger.Faulkner@Sun.COM 	{ "poll",		SYS_pollsys	},
102811798SRoger.Faulkner@Sun.COM 	{ "umount",		SYS_umount2	},
102911798SRoger.Faulkner@Sun.COM 	{ "wait",		SYS_waitid	},
10300Sstevel@tonic-gate 	{  NULL,	0	}	/* end-of-list */
10310Sstevel@tonic-gate };
10320Sstevel@tonic-gate 
10330Sstevel@tonic-gate /*
10340Sstevel@tonic-gate  * Return structure to interpret system call with sub-codes.
10350Sstevel@tonic-gate  */
10360Sstevel@tonic-gate const struct systable *
10370Sstevel@tonic-gate subsys(int syscall, int subcode)
10380Sstevel@tonic-gate {
10390Sstevel@tonic-gate 	const struct systable *stp = NULL;
10400Sstevel@tonic-gate 
10410Sstevel@tonic-gate 	if (subcode != -1) {
10420Sstevel@tonic-gate 		switch (syscall) {
104311798SRoger.Faulkner@Sun.COM 		case SYS_faccessat:
104411798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NACCESSCODE)
104511798SRoger.Faulkner@Sun.COM 				stp = &faccessattable[subcode];
104611798SRoger.Faulkner@Sun.COM 			break;
104711798SRoger.Faulkner@Sun.COM 		case SYS_fchownat:
104811798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NCHOWNCODE)
104911798SRoger.Faulkner@Sun.COM 				stp = &fchownattable[subcode];
105011798SRoger.Faulkner@Sun.COM 			break;
105111798SRoger.Faulkner@Sun.COM 		case SYS_renameat:
105211798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NRENAMECODE)
105311798SRoger.Faulkner@Sun.COM 				stp = &renameattable[subcode];
105411798SRoger.Faulkner@Sun.COM 			break;
105511798SRoger.Faulkner@Sun.COM 		case SYS_unlinkat:
105611798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NUNLINKCODE)
105711798SRoger.Faulkner@Sun.COM 				stp = &unlinkattable[subcode];
105811798SRoger.Faulkner@Sun.COM 			break;
105911798SRoger.Faulkner@Sun.COM 		case SYS_fstatat:
106011798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NSTATCODE)
106111798SRoger.Faulkner@Sun.COM 				stp = &fstatattable[subcode];
106211798SRoger.Faulkner@Sun.COM 			break;
106311798SRoger.Faulkner@Sun.COM 		case SYS_fstatat64:
106411798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NSTAT64CODE)
106511798SRoger.Faulkner@Sun.COM 				stp = &fstatat64table[subcode];
106611798SRoger.Faulkner@Sun.COM 			break;
106711798SRoger.Faulkner@Sun.COM 		case SYS_openat:
106811798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NOPENATCODE)
106911798SRoger.Faulkner@Sun.COM 				stp = &openattable[subcode];
107011798SRoger.Faulkner@Sun.COM 			break;
107111798SRoger.Faulkner@Sun.COM 		case SYS_openat64:
107211798SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NOPENAT64CODE)
107311798SRoger.Faulkner@Sun.COM 				stp = &openat64table[subcode];
107411798SRoger.Faulkner@Sun.COM 			break;
10750Sstevel@tonic-gate 		case SYS_open:
10760Sstevel@tonic-gate 			if ((unsigned)subcode < NOPENCODE)
10770Sstevel@tonic-gate 				stp = &opentable[subcode];
10780Sstevel@tonic-gate 			break;
10790Sstevel@tonic-gate 		case SYS_open64:
10800Sstevel@tonic-gate 			if ((unsigned)subcode < NOPEN64CODE)
10810Sstevel@tonic-gate 				stp = &open64table[subcode];
10820Sstevel@tonic-gate 			break;
10830Sstevel@tonic-gate 		case SYS_msgsys:	/* msgsys() */
10840Sstevel@tonic-gate 			if ((unsigned)subcode < NMSGCODE)
10850Sstevel@tonic-gate 				stp = &msgtable[subcode];
10860Sstevel@tonic-gate 			break;
10870Sstevel@tonic-gate 		case SYS_semsys:	/* semsys() */
10880Sstevel@tonic-gate 			if ((unsigned)subcode < NSEMCODE)
10890Sstevel@tonic-gate 				stp = &semtable[subcode];
10900Sstevel@tonic-gate 			break;
10910Sstevel@tonic-gate 		case SYS_shmsys:	/* shmsys() */
10920Sstevel@tonic-gate 			if ((unsigned)subcode < NSHMCODE)
10930Sstevel@tonic-gate 				stp = &shmtable[subcode];
10940Sstevel@tonic-gate 			break;
10950Sstevel@tonic-gate 		case SYS_pgrpsys:	/* pgrpsys() */
10960Sstevel@tonic-gate 			if ((unsigned)subcode < NPIDCODE)
10970Sstevel@tonic-gate 				stp = &pidtable[subcode];
10980Sstevel@tonic-gate 			break;
10990Sstevel@tonic-gate 		case SYS_utssys:	/* utssys() */
11000Sstevel@tonic-gate 			if ((unsigned)subcode < NUTSCODE)
11010Sstevel@tonic-gate 				stp = &utstable[subcode];
11020Sstevel@tonic-gate 			break;
11030Sstevel@tonic-gate 		case SYS_sysfs:		/* sysfs() */
11040Sstevel@tonic-gate 			if ((unsigned)subcode < NSFSCODE)
11050Sstevel@tonic-gate 				stp = &sfstable[subcode];
11060Sstevel@tonic-gate 			break;
11070Sstevel@tonic-gate 		case SYS_sigpending:	/* sigpending()/sigfillset() */
11080Sstevel@tonic-gate 			if ((unsigned)subcode < NSGPCODE)
11090Sstevel@tonic-gate 				stp = &sgptable[subcode];
11100Sstevel@tonic-gate 			break;
11110Sstevel@tonic-gate 		case SYS_context:	/* [get|set]context() */
11120Sstevel@tonic-gate 			if ((unsigned)subcode < NCTXCODE)
11130Sstevel@tonic-gate 				stp = &ctxtable[subcode];
11140Sstevel@tonic-gate 			break;
11150Sstevel@tonic-gate 		case SYS_hrtsys:	/* hrtsys() */
11160Sstevel@tonic-gate 			if ((unsigned)subcode < NHRTCODE)
11170Sstevel@tonic-gate 				stp = &hrttable[subcode];
11180Sstevel@tonic-gate 			break;
11190Sstevel@tonic-gate 		case SYS_corectl:	/* corectl() */
11200Sstevel@tonic-gate 			if ((unsigned)subcode < NCORCODE)
11210Sstevel@tonic-gate 				stp = &cortable[subcode];
11220Sstevel@tonic-gate 			break;
11230Sstevel@tonic-gate 		case SYS_kaio:		/* kaio() */
11240Sstevel@tonic-gate 			if ((unsigned)subcode < NAIOCODE)
11250Sstevel@tonic-gate 				stp = &aiotable[subcode];
11260Sstevel@tonic-gate 			break;
11270Sstevel@tonic-gate 		case SYS_door:		/* doors */
11280Sstevel@tonic-gate 			if ((unsigned)subcode < NDOORCODE)
11290Sstevel@tonic-gate 				stp = &doortable[subcode];
11300Sstevel@tonic-gate 			break;
11310Sstevel@tonic-gate 		case SYS_pset:		/* pset() */
11320Sstevel@tonic-gate 			if ((unsigned)subcode < NPSETCODE)
11330Sstevel@tonic-gate 				stp = &psettable[subcode];
11340Sstevel@tonic-gate 			break;
11350Sstevel@tonic-gate 		case SYS_lwp_create:	/* lwp_create() */
11360Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPCREATECODE)
11370Sstevel@tonic-gate 				stp = &lwpcreatetable[subcode];
11380Sstevel@tonic-gate 			break;
11390Sstevel@tonic-gate 		case SYS_tasksys:	/* tasks */
11400Sstevel@tonic-gate 			if ((unsigned)subcode < NTASKSYSCODE)
11410Sstevel@tonic-gate 				stp = &tasksystable[subcode];
11420Sstevel@tonic-gate 			break;
11430Sstevel@tonic-gate 		case SYS_exacctsys:	/* exacct */
11440Sstevel@tonic-gate 			if ((unsigned)subcode < NEXACCTSYSCODE)
11450Sstevel@tonic-gate 				stp = &exacctsystable[subcode];
11460Sstevel@tonic-gate 			break;
11470Sstevel@tonic-gate 		case SYS_privsys:	/* privileges */
11480Sstevel@tonic-gate 			if ((unsigned)subcode < NPRIVSYSCODE)
11490Sstevel@tonic-gate 				stp = &privsystable[subcode];
11500Sstevel@tonic-gate 			break;
11510Sstevel@tonic-gate 		case SYS_lwp_park:	/* lwp_park */
11520Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPPARKCODE)
11530Sstevel@tonic-gate 				stp = &lwpparktable[subcode];
11540Sstevel@tonic-gate 			break;
11550Sstevel@tonic-gate 		case SYS_lwp_rwlock_sys:
11560Sstevel@tonic-gate 			if ((unsigned)subcode < NLWPRWLOCKCODE)
11570Sstevel@tonic-gate 				stp = &lwprwlocktable[subcode];
11580Sstevel@tonic-gate 			break;
11590Sstevel@tonic-gate 		case SYS_sendfilev:	/* sendfilev */
11600Sstevel@tonic-gate 			if ((unsigned)subcode < NSENDFILESYSCODE)
11610Sstevel@tonic-gate 				stp = &sendfilevsystable[subcode];
11620Sstevel@tonic-gate 			break;
11630Sstevel@tonic-gate 		case SYS_lgrpsys:	/* lgrpsys */
11640Sstevel@tonic-gate 			if ((unsigned)subcode < NLGRPSYSCODE)
11650Sstevel@tonic-gate 				stp = &lgrpsystable[subcode];
11660Sstevel@tonic-gate 			break;
11670Sstevel@tonic-gate 		case SYS_rusagesys:	/* rusagesys */
11680Sstevel@tonic-gate 			if ((unsigned)subcode < NRUSAGESYSCODE)
11690Sstevel@tonic-gate 				stp = &rusagesystable[subcode];
11700Sstevel@tonic-gate 			break;
11710Sstevel@tonic-gate 		case SYS_fcntl:		/* fcntl */
11720Sstevel@tonic-gate 			if ((unsigned)subcode < NFCNTLCODE)
11730Sstevel@tonic-gate 				stp = &fcntltable[subcode];
11740Sstevel@tonic-gate 			break;
11750Sstevel@tonic-gate 		case SYS_ucredsys:
11760Sstevel@tonic-gate 			if ((unsigned)subcode < NUCREDSYSCODE)
11770Sstevel@tonic-gate 				stp = &ucredsystable[subcode];
11780Sstevel@tonic-gate 			break;
11790Sstevel@tonic-gate 		case SYS_port:	/* portfs */
11800Sstevel@tonic-gate 			if ((unsigned)subcode < NPORTCODE)
11810Sstevel@tonic-gate 				stp = &portfstable[subcode];
11820Sstevel@tonic-gate 			break;
11830Sstevel@tonic-gate 		case SYS_zone:		/* zone family */
11840Sstevel@tonic-gate 			if ((unsigned)subcode < NZONECODE)
11850Sstevel@tonic-gate 				stp = &zonetable[subcode];
11860Sstevel@tonic-gate 			break;
11871676Sjpk 		case SYS_labelsys:	/* label family */
11881676Sjpk 			if ((unsigned)subcode < NLABELCODE)
11891676Sjpk 				stp = &labeltable[subcode];
11901676Sjpk 			break;
11912447Snf202958 		case SYS_rctlsys:	/* rctl family */
11922447Snf202958 			if ((unsigned)subcode < NRCTLCODE)
11932447Snf202958 				stp = &rctltable[subcode];
11942447Snf202958 			break;
11953235Sraf 		case SYS_forksys:	/* fork family */
11963235Sraf 			if ((unsigned)subcode < NFORKCODE)
11973235Sraf 				stp = &forktable[subcode];
11983235Sraf 			break;
11994321Scasper 		case SYS_sidsys:	/* SID family */
12004321Scasper 			if ((unsigned)subcode < NSIDSYSCODE)
12014321Scasper 				stp = &sidsystable[subcode];
12024321Scasper 			break;
120310440SRoger.Faulkner@Sun.COM 		case SYS_utimesys:	/* utime family */
120410440SRoger.Faulkner@Sun.COM 			if ((unsigned)subcode < NUTIMESYSCODE)
120510440SRoger.Faulkner@Sun.COM 				stp = &utimesystable[subcode];
120610440SRoger.Faulkner@Sun.COM 			break;
12070Sstevel@tonic-gate 		}
12080Sstevel@tonic-gate 	}
12090Sstevel@tonic-gate 
12100Sstevel@tonic-gate 	if (stp == NULL)
12110Sstevel@tonic-gate 		stp = &systable[((unsigned)syscall < SYSEND)? syscall : 0];
12120Sstevel@tonic-gate 
12130Sstevel@tonic-gate 	return (stp);
12140Sstevel@tonic-gate }
12150Sstevel@tonic-gate 
12160Sstevel@tonic-gate /*
12170Sstevel@tonic-gate  * Return the name of the system call.
12180Sstevel@tonic-gate  */
12190Sstevel@tonic-gate const char *
12200Sstevel@tonic-gate sysname(private_t *pri, int syscall, int subcode)
12210Sstevel@tonic-gate {
12220Sstevel@tonic-gate 	const struct systable *stp = subsys(syscall, subcode);
12230Sstevel@tonic-gate 	const char *name = stp->name;	/* may be NULL */
12240Sstevel@tonic-gate 
12250Sstevel@tonic-gate 	if (name == NULL) {		/* manufacture a name */
12260Sstevel@tonic-gate 		(void) sprintf(pri->sys_name, "sys#%d", syscall);
12270Sstevel@tonic-gate 		name = pri->sys_name;
12280Sstevel@tonic-gate 	}
12290Sstevel@tonic-gate 
12300Sstevel@tonic-gate 	return (name);
12310Sstevel@tonic-gate }
12320Sstevel@tonic-gate 
12330Sstevel@tonic-gate /*
12340Sstevel@tonic-gate  * Return the name of the signal.
12350Sstevel@tonic-gate  * Return NULL if unknown signal.
12360Sstevel@tonic-gate  */
12370Sstevel@tonic-gate const char *
12380Sstevel@tonic-gate rawsigname(private_t *pri, int sig)
12390Sstevel@tonic-gate {
12400Sstevel@tonic-gate 	/*
12410Sstevel@tonic-gate 	 * The C library function sig2str() omits the leading "SIG".
12420Sstevel@tonic-gate 	 */
12430Sstevel@tonic-gate 	(void) strcpy(pri->raw_sig_name, "SIG");
12440Sstevel@tonic-gate 
12450Sstevel@tonic-gate 	if (sig > 0 && sig2str(sig, pri->raw_sig_name+3) == 0)
12460Sstevel@tonic-gate 		return (pri->raw_sig_name);
12470Sstevel@tonic-gate 	return (NULL);
12480Sstevel@tonic-gate }
12490Sstevel@tonic-gate 
12500Sstevel@tonic-gate /*
12510Sstevel@tonic-gate  * Return the name of the signal.
12520Sstevel@tonic-gate  * Manufacture a name for unknown signal.
12530Sstevel@tonic-gate  */
12540Sstevel@tonic-gate const char *
12550Sstevel@tonic-gate signame(private_t *pri, int sig)
12560Sstevel@tonic-gate {
12570Sstevel@tonic-gate 	const char *name = rawsigname(pri, sig);
12580Sstevel@tonic-gate 
12590Sstevel@tonic-gate 	if (name == NULL) {			/* manufacture a name */
12600Sstevel@tonic-gate 		(void) sprintf(pri->sig_name, "SIG#%d", sig);
12610Sstevel@tonic-gate 		name = pri->sig_name;
12620Sstevel@tonic-gate 	}
12630Sstevel@tonic-gate 
12640Sstevel@tonic-gate 	return (name);
12650Sstevel@tonic-gate }
12660Sstevel@tonic-gate 
12670Sstevel@tonic-gate /*
12680Sstevel@tonic-gate  * Determine the subcode for this syscall, if any.
12690Sstevel@tonic-gate  */
12700Sstevel@tonic-gate int
12710Sstevel@tonic-gate getsubcode(private_t *pri)
12720Sstevel@tonic-gate {
12730Sstevel@tonic-gate 	const lwpstatus_t *Lsp = pri->lwpstat;
12740Sstevel@tonic-gate 	int syscall = Lsp->pr_syscall;
12750Sstevel@tonic-gate 	int nsysarg = Lsp->pr_nsysarg;
12760Sstevel@tonic-gate 	int subcode = -1;
12770Sstevel@tonic-gate 	int arg0;
12780Sstevel@tonic-gate 
127911798SRoger.Faulkner@Sun.COM 	if (syscall > 0 && nsysarg > 0 && !prismember(&rawout, syscall)) {
12800Sstevel@tonic-gate 		arg0 = Lsp->pr_sysarg[0];
12810Sstevel@tonic-gate 		switch (syscall) {
12820Sstevel@tonic-gate 		case SYS_utssys:	/* utssys() */
12830Sstevel@tonic-gate 			if (nsysarg > 2)
12840Sstevel@tonic-gate 				subcode = Lsp->pr_sysarg[2];
12850Sstevel@tonic-gate 			break;
128611798SRoger.Faulkner@Sun.COM 		case SYS_faccessat:
128711798SRoger.Faulkner@Sun.COM 			if (nsysarg > 3)
128811798SRoger.Faulkner@Sun.COM 				subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD &&
128911798SRoger.Faulkner@Sun.COM 				    Lsp->pr_sysarg[3] == 0)? 1 : 0;
129011798SRoger.Faulkner@Sun.COM 			break;
129111798SRoger.Faulkner@Sun.COM 		case SYS_fchownat:
129211798SRoger.Faulkner@Sun.COM 			if (nsysarg > 1 && Lsp->pr_sysarg[1] == NULL) {
129311798SRoger.Faulkner@Sun.COM 				subcode = 3;
129411798SRoger.Faulkner@Sun.COM 				break;
129511798SRoger.Faulkner@Sun.COM 			}
129611798SRoger.Faulkner@Sun.COM 			if (nsysarg > 0 && (int)Lsp->pr_sysarg[0] != AT_FDCWD) {
129711798SRoger.Faulkner@Sun.COM 				subcode = 0;
129811798SRoger.Faulkner@Sun.COM 				break;
129911798SRoger.Faulkner@Sun.COM 			}
130011798SRoger.Faulkner@Sun.COM 			if (nsysarg > 4)
130111798SRoger.Faulkner@Sun.COM 				subcode = (Lsp->pr_sysarg[4] == 0)? 1 :
130211798SRoger.Faulkner@Sun.COM 				    (Lsp->pr_sysarg[4] == AT_SYMLINK_NOFOLLOW)?
130311798SRoger.Faulkner@Sun.COM 				    2 : 0;
130411798SRoger.Faulkner@Sun.COM 			break;
130511798SRoger.Faulkner@Sun.COM 		case SYS_renameat:
130611798SRoger.Faulkner@Sun.COM 			if (nsysarg > 2)
130711798SRoger.Faulkner@Sun.COM 				subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD &&
130811798SRoger.Faulkner@Sun.COM 				    (int)Lsp->pr_sysarg[2] == AT_FDCWD)? 1 : 0;
130911798SRoger.Faulkner@Sun.COM 			break;
131011798SRoger.Faulkner@Sun.COM 		case SYS_unlinkat:
131111798SRoger.Faulkner@Sun.COM 			if (nsysarg > 2)
131211798SRoger.Faulkner@Sun.COM 				subcode =
131311798SRoger.Faulkner@Sun.COM 				    ((int)Lsp->pr_sysarg[0] != AT_FDCWD)? 0 :
131411798SRoger.Faulkner@Sun.COM 				    (Lsp->pr_sysarg[2] == AT_REMOVEDIR)? 2 :
131511798SRoger.Faulkner@Sun.COM 				    (Lsp->pr_sysarg[2] == 0)? 1 : 0;
131611798SRoger.Faulkner@Sun.COM 			break;
131711798SRoger.Faulkner@Sun.COM 		case SYS_fstatat:
131811798SRoger.Faulkner@Sun.COM 		case SYS_fstatat64:
131911798SRoger.Faulkner@Sun.COM 			if (nsysarg > 1 && Lsp->pr_sysarg[1] == NULL) {
132011798SRoger.Faulkner@Sun.COM 				subcode = 3;
132111798SRoger.Faulkner@Sun.COM 				break;
132211798SRoger.Faulkner@Sun.COM 			}
132311798SRoger.Faulkner@Sun.COM 			if (nsysarg > 0 && (int)Lsp->pr_sysarg[0] != AT_FDCWD) {
132411798SRoger.Faulkner@Sun.COM 				subcode = 0;
132511798SRoger.Faulkner@Sun.COM 				break;
132611798SRoger.Faulkner@Sun.COM 			}
132711798SRoger.Faulkner@Sun.COM 			if (nsysarg > 3)
132811798SRoger.Faulkner@Sun.COM 				subcode = (Lsp->pr_sysarg[3] == 0)? 1 :
132911798SRoger.Faulkner@Sun.COM 				    (Lsp->pr_sysarg[3] == AT_SYMLINK_NOFOLLOW)?
133011798SRoger.Faulkner@Sun.COM 				    2 : 0;
133111798SRoger.Faulkner@Sun.COM 			break;
133211798SRoger.Faulkner@Sun.COM 		case SYS_openat:	/* openat() w/ and w/o AT_FDCWD */
133311798SRoger.Faulkner@Sun.COM 		case SYS_openat64:	/* and with and w/o O_CREAT */
133411798SRoger.Faulkner@Sun.COM 			if (nsysarg > 2)
133511798SRoger.Faulkner@Sun.COM 				subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD)?
133611798SRoger.Faulkner@Sun.COM 				    ((Lsp->pr_sysarg[2] & O_CREAT)? 3 : 2) :
133711798SRoger.Faulkner@Sun.COM 				    ((Lsp->pr_sysarg[2] & O_CREAT)? 1 : 0);
133811798SRoger.Faulkner@Sun.COM 			break;
13390Sstevel@tonic-gate 		case SYS_open:		/* open() w/ and w/o O_CREAT */
13400Sstevel@tonic-gate 		case SYS_open64:
13410Sstevel@tonic-gate 			if (nsysarg > 1)
13420Sstevel@tonic-gate 				subcode = (Lsp->pr_sysarg[1] & O_CREAT)? 1 : 0;
13430Sstevel@tonic-gate 			break;
13440Sstevel@tonic-gate 		case SYS_kaio:		/* kaio() */
13450Sstevel@tonic-gate 			subcode = arg0 & ~AIO_POLL_BIT;
13460Sstevel@tonic-gate 			break;
13470Sstevel@tonic-gate 		case SYS_door:		/* doors */
13480Sstevel@tonic-gate 			if (nsysarg > 5)
13490Sstevel@tonic-gate 				subcode = Lsp->pr_sysarg[5];
13500Sstevel@tonic-gate 			break;
13510Sstevel@tonic-gate 		case SYS_lwp_create:	/* lwp_create() */
13520Sstevel@tonic-gate 			subcode =	/* 0 for parent, 1 for child */
13532267Sdp 			    (Lsp->pr_why == PR_SYSEXIT && Lsp->pr_errno == 0 &&
13542267Sdp 			    Lsp->pr_rval1 == 0);
13550Sstevel@tonic-gate 			break;
13563235Sraf 		case SYS_forksys:	/* forksys */
13573235Sraf 			subcode = arg0;
13583235Sraf 			if (Lsp->pr_why == PR_SYSEXIT && Lsp->pr_errno == 0 &&
13593235Sraf 			    pri->Rval2 != 0)	/* this is the child */
13603235Sraf 				subcode += 3;
13613235Sraf 			break;
13620Sstevel@tonic-gate 		case SYS_msgsys:	/* msgsys() */
13630Sstevel@tonic-gate 		case SYS_semsys:	/* semsys() */
13640Sstevel@tonic-gate 		case SYS_shmsys:	/* shmsys() */
13650Sstevel@tonic-gate 		case SYS_pgrpsys:	/* pgrpsys() */
13660Sstevel@tonic-gate 		case SYS_sysfs:		/* sysfs() */
13670Sstevel@tonic-gate 		case SYS_sigpending:	/* sigpending()/sigfillset() */
13680Sstevel@tonic-gate 		case SYS_context:	/* [get|set]context() */
13690Sstevel@tonic-gate 		case SYS_hrtsys:	/* hrtsys() */
13700Sstevel@tonic-gate 		case SYS_corectl:	/* corectl() */
13710Sstevel@tonic-gate 		case SYS_pset:		/* pset() */
13720Sstevel@tonic-gate 		case SYS_tasksys:	/* tasks */
13730Sstevel@tonic-gate 		case SYS_privsys:	/* privileges */
13740Sstevel@tonic-gate 		case SYS_exacctsys:	/* exacct */
13750Sstevel@tonic-gate 		case SYS_lwp_park:	/* lwp_park */
13760Sstevel@tonic-gate 		case SYS_lwp_rwlock_sys: /* lwp_rwlock_*() */
13770Sstevel@tonic-gate 		case SYS_sendfilev:	/* sendfilev */
13780Sstevel@tonic-gate 		case SYS_lgrpsys:	/* lgrpsys */
13790Sstevel@tonic-gate 		case SYS_rusagesys:	/* rusagesys */
13800Sstevel@tonic-gate 		case SYS_ucredsys:	/* ucredsys */
13810Sstevel@tonic-gate 		case SYS_zone:		/* zone */
13821676Sjpk 		case SYS_labelsys:	/* labelsys */
13832447Snf202958 		case SYS_rctlsys:	/* rctlsys */
13844321Scasper 		case SYS_sidsys:	/* sidsys */
138510440SRoger.Faulkner@Sun.COM 		case SYS_utimesys:	/* utimesys */
13860Sstevel@tonic-gate 			subcode = arg0;
13870Sstevel@tonic-gate 			break;
13880Sstevel@tonic-gate 		case SYS_fcntl:		/* fcntl() */
13890Sstevel@tonic-gate 			if (nsysarg > 2) {
13900Sstevel@tonic-gate 				switch (Lsp->pr_sysarg[1]) {
13910Sstevel@tonic-gate 				default:	subcode = 0; break;
13920Sstevel@tonic-gate 				case F_GETFL:
13930Sstevel@tonic-gate 				case F_GETOWN:
13940Sstevel@tonic-gate 				case F_GETXFL:	subcode = 1; break;
13950Sstevel@tonic-gate 				case F_SETFL:	subcode = 2; break;
13960Sstevel@tonic-gate 				}
13970Sstevel@tonic-gate 			}
13980Sstevel@tonic-gate 			break;
13990Sstevel@tonic-gate 		case SYS_port:		/* portfs */
14000Sstevel@tonic-gate 			subcode = arg0 & PORT_CODE_MASK;
14010Sstevel@tonic-gate 			break;
14020Sstevel@tonic-gate 		}
14030Sstevel@tonic-gate 	}
14040Sstevel@tonic-gate 
14050Sstevel@tonic-gate 	return (subcode);
14060Sstevel@tonic-gate }
14070Sstevel@tonic-gate 
14080Sstevel@tonic-gate /*
14090Sstevel@tonic-gate  * Return the maximum number of system calls, counting
14100Sstevel@tonic-gate  * all system calls with subcodes as separate calls.
14110Sstevel@tonic-gate  */
14120Sstevel@tonic-gate int
14130Sstevel@tonic-gate maxsyscalls()
14140Sstevel@tonic-gate {
14150Sstevel@tonic-gate 	return (PRMAXSYS + 1
141611798SRoger.Faulkner@Sun.COM 	    + NACCESSCODE - 1
141711798SRoger.Faulkner@Sun.COM 	    + NCHOWNCODE - 1
141811798SRoger.Faulkner@Sun.COM 	    + NRENAMECODE - 1
141911798SRoger.Faulkner@Sun.COM 	    + NUNLINKCODE - 1
142011798SRoger.Faulkner@Sun.COM 	    + NSTATCODE - 1
142111798SRoger.Faulkner@Sun.COM 	    + NSTAT64CODE - 1
142211798SRoger.Faulkner@Sun.COM 	    + NOPENATCODE - 1
142311798SRoger.Faulkner@Sun.COM 	    + NOPENAT64CODE - 1
14242267Sdp 	    + NOPENCODE - 1
14252267Sdp 	    + NOPEN64CODE - 1
14262267Sdp 	    + NMSGCODE - 1
14272267Sdp 	    + NSEMCODE - 1
14282267Sdp 	    + NSHMCODE - 1
14292267Sdp 	    + NPIDCODE - 1
14302267Sdp 	    + NSFSCODE - 1
14312267Sdp 	    + NUTSCODE - 1
14322267Sdp 	    + NSGPCODE - 1
14332267Sdp 	    + NCTXCODE - 1
14342267Sdp 	    + NHRTCODE - 1
14352267Sdp 	    + NCORCODE - 1
14362267Sdp 	    + NAIOCODE - 1
14372267Sdp 	    + NDOORCODE - 1
14382267Sdp 	    + NPSETCODE - 1
14392267Sdp 	    + NLWPCREATECODE - 1
14402267Sdp 	    + NTASKSYSCODE - 1
14412267Sdp 	    + NEXACCTSYSCODE - 1
14422267Sdp 	    + NLWPPARKCODE - 1
14432267Sdp 	    + NLWPRWLOCKCODE - 1
14442267Sdp 	    + NSENDFILESYSCODE - 1
14452267Sdp 	    + NLGRPSYSCODE - 1
14462267Sdp 	    + NRUSAGESYSCODE - 1
14472267Sdp 	    + NFCNTLCODE - 1
14482267Sdp 	    + NPRIVSYSCODE - 1
14492267Sdp 	    + NUCREDSYSCODE - 1
14502267Sdp 	    + NPORTCODE - 1
14512267Sdp 	    + NZONECODE - 1
14522447Snf202958 	    + NLABELCODE - 1
14533235Sraf 	    + NRCTLCODE - 1
14544321Scasper 	    + NFORKCODE - 1
145510440SRoger.Faulkner@Sun.COM 	    + NSIDSYSCODE - 1
145610440SRoger.Faulkner@Sun.COM 	    + NUTIMESYSCODE - 1);
14570Sstevel@tonic-gate }
14580Sstevel@tonic-gate 
14590Sstevel@tonic-gate /*
14600Sstevel@tonic-gate  * Return the number of subcodes for the specified system call number.
14610Sstevel@tonic-gate  */
14620Sstevel@tonic-gate int
14630Sstevel@tonic-gate nsubcodes(int syscall)
14640Sstevel@tonic-gate {
14650Sstevel@tonic-gate 	switch (syscall) {
146611798SRoger.Faulkner@Sun.COM 	case SYS_faccessat:
146711798SRoger.Faulkner@Sun.COM 		return (NACCESSCODE);
146811798SRoger.Faulkner@Sun.COM 	case SYS_fchownat:
146911798SRoger.Faulkner@Sun.COM 		return (NCHOWNCODE);
147011798SRoger.Faulkner@Sun.COM 	case SYS_renameat:
147111798SRoger.Faulkner@Sun.COM 		return (NRENAMECODE);
147211798SRoger.Faulkner@Sun.COM 	case SYS_unlinkat:
147311798SRoger.Faulkner@Sun.COM 		return (NUNLINKCODE);
147411798SRoger.Faulkner@Sun.COM 	case SYS_fstatat:
147511798SRoger.Faulkner@Sun.COM 		return (NSTATCODE);
147611798SRoger.Faulkner@Sun.COM 	case SYS_fstatat64:
147711798SRoger.Faulkner@Sun.COM 		return (NSTAT64CODE);
147811798SRoger.Faulkner@Sun.COM 	case SYS_openat:
147911798SRoger.Faulkner@Sun.COM 		return (NOPENATCODE);
148011798SRoger.Faulkner@Sun.COM 	case SYS_openat64:
148111798SRoger.Faulkner@Sun.COM 		return (NOPENAT64CODE);
14820Sstevel@tonic-gate 	case SYS_open:
14830Sstevel@tonic-gate 		return (NOPENCODE);
14840Sstevel@tonic-gate 	case SYS_open64:
14850Sstevel@tonic-gate 		return (NOPEN64CODE);
148611798SRoger.Faulkner@Sun.COM 	case SYS_msgsys:
14870Sstevel@tonic-gate 		return (NMSGCODE);
148811798SRoger.Faulkner@Sun.COM 	case SYS_semsys:
14890Sstevel@tonic-gate 		return (NSEMCODE);
149011798SRoger.Faulkner@Sun.COM 	case SYS_shmsys:
14910Sstevel@tonic-gate 		return (NSHMCODE);
149211798SRoger.Faulkner@Sun.COM 	case SYS_pgrpsys:
14930Sstevel@tonic-gate 		return (NPIDCODE);
149411798SRoger.Faulkner@Sun.COM 	case SYS_utssys:
14950Sstevel@tonic-gate 		return (NUTSCODE);
149611798SRoger.Faulkner@Sun.COM 	case SYS_sysfs:
14970Sstevel@tonic-gate 		return (NSFSCODE);
149811798SRoger.Faulkner@Sun.COM 	case SYS_sigpending:
14990Sstevel@tonic-gate 		return (NSGPCODE);
150011798SRoger.Faulkner@Sun.COM 	case SYS_context:
15010Sstevel@tonic-gate 		return (NCTXCODE);
150211798SRoger.Faulkner@Sun.COM 	case SYS_hrtsys:
15030Sstevel@tonic-gate 		return (NHRTCODE);
150411798SRoger.Faulkner@Sun.COM 	case SYS_corectl:
15050Sstevel@tonic-gate 		return (NCORCODE);
150611798SRoger.Faulkner@Sun.COM 	case SYS_kaio:
15070Sstevel@tonic-gate 		return (NAIOCODE);
150811798SRoger.Faulkner@Sun.COM 	case SYS_door:
15090Sstevel@tonic-gate 		return (NDOORCODE);
151011798SRoger.Faulkner@Sun.COM 	case SYS_pset:
15110Sstevel@tonic-gate 		return (NPSETCODE);
151211798SRoger.Faulkner@Sun.COM 	case SYS_lwp_create:
15130Sstevel@tonic-gate 		return (NLWPCREATECODE);
151411798SRoger.Faulkner@Sun.COM 	case SYS_tasksys:
15150Sstevel@tonic-gate 		return (NTASKSYSCODE);
151611798SRoger.Faulkner@Sun.COM 	case SYS_exacctsys:
15170Sstevel@tonic-gate 		return (NEXACCTSYSCODE);
151811798SRoger.Faulkner@Sun.COM 	case SYS_privsys:
15190Sstevel@tonic-gate 		return (NPRIVSYSCODE);
152011798SRoger.Faulkner@Sun.COM 	case SYS_lwp_park:
15210Sstevel@tonic-gate 		return (NLWPPARKCODE);
15220Sstevel@tonic-gate 	case SYS_lwp_rwlock_sys:
15230Sstevel@tonic-gate 		return (NLWPRWLOCKCODE);
152411798SRoger.Faulkner@Sun.COM 	case SYS_sendfilev:
15250Sstevel@tonic-gate 		return (NSENDFILESYSCODE);
152611798SRoger.Faulkner@Sun.COM 	case SYS_lgrpsys:
15270Sstevel@tonic-gate 		return (NLGRPSYSCODE);
15280Sstevel@tonic-gate 	case SYS_rusagesys:
15290Sstevel@tonic-gate 		return (NRUSAGESYSCODE);
15300Sstevel@tonic-gate 	case SYS_fcntl:
15310Sstevel@tonic-gate 		return (NFCNTLCODE);
15320Sstevel@tonic-gate 	case SYS_ucredsys:
15330Sstevel@tonic-gate 		return (NUCREDSYSCODE);
15340Sstevel@tonic-gate 	case SYS_port:
15350Sstevel@tonic-gate 		return (NPORTCODE);
153611798SRoger.Faulkner@Sun.COM 	case SYS_zone:
15370Sstevel@tonic-gate 		return (NZONECODE);
15381676Sjpk 	case SYS_labelsys:
15391676Sjpk 		return (NLABELCODE);
15402447Snf202958 	case SYS_rctlsys:
15412447Snf202958 		return (NRCTLCODE);
15423235Sraf 	case SYS_forksys:
15433235Sraf 		return (NFORKCODE);
15444321Scasper 	case SYS_sidsys:
15454321Scasper 		return (NSIDSYSCODE);
154610440SRoger.Faulkner@Sun.COM 	case SYS_utimesys:
154710440SRoger.Faulkner@Sun.COM 		return (NUTIMESYSCODE);
15480Sstevel@tonic-gate 	default:
15490Sstevel@tonic-gate 		return (1);
15500Sstevel@tonic-gate 	}
15510Sstevel@tonic-gate }
15520Sstevel@tonic-gate 
15530Sstevel@tonic-gate 
15540Sstevel@tonic-gate 
15550Sstevel@tonic-gate /* Socket address families (and protocol families) */
15560Sstevel@tonic-gate const char * const afcodes[] = {
15570Sstevel@tonic-gate 	"UNSPEC",	/* 0 */
15580Sstevel@tonic-gate 	"UNIX",		/* 1 */
15590Sstevel@tonic-gate 	"INET",		/* 2 */
15600Sstevel@tonic-gate 	"IMPLINK",	/* 3 */
15610Sstevel@tonic-gate 	"PUP",		/* 4 */
15620Sstevel@tonic-gate 	"CHAOS",	/* 5 */
15630Sstevel@tonic-gate 	"NS",		/* 6 */
15640Sstevel@tonic-gate 	"NBS",		/* 7 */
15650Sstevel@tonic-gate 	"ECMA",		/* 8 */
15660Sstevel@tonic-gate 	"DATAKIT",	/* 9 */
15670Sstevel@tonic-gate 	"CCITT",	/* 10 */
15680Sstevel@tonic-gate 	"SNA",		/* 11 */
15690Sstevel@tonic-gate 	"DECnet",	/* 12 */
15700Sstevel@tonic-gate 	"DLI",		/* 13 */
15710Sstevel@tonic-gate 	"LAT",		/* 14 */
15720Sstevel@tonic-gate 	"HYLINK",	/* 15 */
15730Sstevel@tonic-gate 	"APPLETALK",	/* 16 */
15740Sstevel@tonic-gate 	"NIT",		/* 17 */
15750Sstevel@tonic-gate 	"802",		/* 18 */
15760Sstevel@tonic-gate 	"OSI",		/* 19 */
15770Sstevel@tonic-gate 	"X25",		/* 20 */
15780Sstevel@tonic-gate 	"OSINET",	/* 21 */
15790Sstevel@tonic-gate 	"GOSIP",	/* 22 */
15800Sstevel@tonic-gate 	"IPX",		/* 23 */
15810Sstevel@tonic-gate 	"ROUTE",	/* 24 */
15820Sstevel@tonic-gate 	"LINK",		/* 25 */
15830Sstevel@tonic-gate 	"INET6",	/* 26 */
15840Sstevel@tonic-gate 	"KEY",		/* 27 */
15850Sstevel@tonic-gate 	"NCA",		/* 28 */
15863302Sagiri 	"POLICY",	/* 29 */
158710491SRishi.Srivatsavai@Sun.COM 	"RDS",		/* 30 */
158810639SDarren.Reed@Sun.COM 	"TRILL",	/* 31 */
158910639SDarren.Reed@Sun.COM 	"PACKET"	/* 32 */
15900Sstevel@tonic-gate };
159110639SDarren.Reed@Sun.COM #if MAX_AFCODES != 33
15920Sstevel@tonic-gate #error Need to update address-family table
15930Sstevel@tonic-gate #endif
15940Sstevel@tonic-gate 
15950Sstevel@tonic-gate 
15960Sstevel@tonic-gate const char * const socktype_codes[] = {		/* cf socket.h */
15970Sstevel@tonic-gate 	NULL,
15980Sstevel@tonic-gate 	"SOCK_DGRAM",		/* 1 */
15990Sstevel@tonic-gate 	"SOCK_STREAM",		/* 2 */
16000Sstevel@tonic-gate 	NULL,
16010Sstevel@tonic-gate 	"SOCK_RAW",		/* 4 */
16020Sstevel@tonic-gate 	"SOCK_RDM",		/* 5 */
16030Sstevel@tonic-gate 	"SOCK_SEQPACKET"	/* 6 */
16040Sstevel@tonic-gate };
16050Sstevel@tonic-gate #if MAX_SOCKTYPES != 7
16060Sstevel@tonic-gate #error Need to update socket-type table
16070Sstevel@tonic-gate #endif
1608