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