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 /* 239264SRoger.Faulkner@Sun.COM * Copyright 2009 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 */ 2220Sstevel@tonic-gate {"forkall", 0, DEC, NOV}, /* 2 */ 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 */ 2270Sstevel@tonic-gate {"wait", 0, DEC, HHX}, /* 7 */ 2280Sstevel@tonic-gate {"creat", 2, DEC, NOV, STG, OCT}, /* 8 */ 2290Sstevel@tonic-gate {"link", 2, DEC, NOV, STG, STG}, /* 9 */ 2300Sstevel@tonic-gate {"unlink", 1, DEC, NOV, STG}, /* 10 */ 2310Sstevel@tonic-gate {"exec", 2, DEC, NOV, STG, DEC}, /* 11 */ 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 */ 2410Sstevel@tonic-gate {"mount", 8, DEC, NOV, STG, STG, MTF, MFT, HEX, DEC, HEX, DEC}, /* 21 */ 2420Sstevel@tonic-gate {"umount", 1, DEC, NOV, STG}, /* 22 */ 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 */ 2500Sstevel@tonic-gate {"utime", 2, DEC, NOV, STG, HEX}, /* 30 */ 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 */ 2610Sstevel@tonic-gate {"dup", 1, DEC, NOV, DEC}, /* 41 */ 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 */ 2650Sstevel@tonic-gate {"plock", 1, DEC, NOV, PLK}, /* 45 */ 2664321Scasper {"setgid", 1, DEC, NOV, UNS}, /* 46 */ 2674321Scasper {"getgid", 0, UNS, UNS}, /* 47 */ 2680Sstevel@tonic-gate {"signal", 2, HEX, NOV, SIG, ACT}, /* 48 */ 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 */ 2760Sstevel@tonic-gate { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX}, 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 */ 2840Sstevel@tonic-gate 2850Sstevel@tonic-gate /* The following 6 entries were reserved for the UNIX PC */ 2860Sstevel@tonic-gate { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX}, 2870Sstevel@tonic-gate { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX}, 2880Sstevel@tonic-gate { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX}, 2890Sstevel@tonic-gate { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX}, 2900Sstevel@tonic-gate { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX}, 2910Sstevel@tonic-gate { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX}, 2920Sstevel@tonic-gate 2930Sstevel@tonic-gate {"tasksys", 5, DEC, NOV, DEC, DEC, DEC, HEX, DEC}, /* 70 */ 2940Sstevel@tonic-gate {"acctctl", 3, DEC, NOV, HEX, HEX, UNS}, /* 71 */ 2950Sstevel@tonic-gate {"exacctsys", 6, DEC, NOV, DEC, IDT, DEC, HEX, DEC, HEX}, /* 72 */ 2960Sstevel@tonic-gate {"getpagesizes", 2, DEC, NOV, HEX, DEC}, /* 73 */ 2972447Snf202958 {"rctlsys", 6, DEC, NOV, RSC, STG, HEX, HEX, DEC, DEC}, /* 74 */ 2984321Scasper {"sidsys", 4, UNS, UNS, DEC, DEC, DEC, DEC}, /* 75 */ 2990Sstevel@tonic-gate {"fsat", 6, DEC, NOV, HEX, HEX, HEX, HEX, HEX, HEX}, /* 76 */ 3000Sstevel@tonic-gate {"lwp_park", 3, DEC, NOV, DEC, HEX, DEC}, /* 77 */ 3010Sstevel@tonic-gate {"sendfilev", 5, DEC, NOV, DEC, DEC, HEX, DEC, HEX}, /* 78 */ 3020Sstevel@tonic-gate {"rmdir", 1, DEC, NOV, STG}, /* 79 */ 3030Sstevel@tonic-gate {"mkdir", 2, DEC, NOV, STG, OCT}, /* 80 */ 3040Sstevel@tonic-gate {"getdents", 3, DEC, NOV, DEC, HEX, UNS}, /* 81 */ 3050Sstevel@tonic-gate {"privsys", 5, HEX, NOV, DEC, DEC, DEC, HEX, DEC}, /* 82 */ 3060Sstevel@tonic-gate {"ucredsys", 3, DEC, NOV, DEC, DEC, HEX}, /* 83 */ 3070Sstevel@tonic-gate {"sysfs", 3, DEC, NOV, SFS, DEX, DEX}, /* 84 */ 3080Sstevel@tonic-gate {"getmsg", 4, DEC, NOV, DEC, HEX, HEX, HEX}, /* 85 */ 3090Sstevel@tonic-gate {"putmsg", 4, DEC, NOV, DEC, HEX, HEX, SMF}, /* 86 */ 3100Sstevel@tonic-gate {"poll", 3, DEC, NOV, HEX, DEC, DEC}, /* 87 */ 3110Sstevel@tonic-gate {"lstat", 2, DEC, NOV, STG, HEX}, /* 88 */ 3120Sstevel@tonic-gate {"symlink", 2, DEC, NOV, STG, STG}, /* 89 */ 3130Sstevel@tonic-gate {"readlink", 3, DEC, NOV, STG, RLK, UNS}, /* 90 */ 3140Sstevel@tonic-gate {"setgroups", 2, DEC, NOV, DEC, HEX}, /* 91 */ 3150Sstevel@tonic-gate {"getgroups", 2, DEC, NOV, DEC, HEX}, /* 92 */ 3160Sstevel@tonic-gate {"fchmod", 2, DEC, NOV, DEC, OCT}, /* 93 */ 3170Sstevel@tonic-gate {"fchown", 3, DEC, NOV, DEC, DEC, DEC}, /* 94 */ 3180Sstevel@tonic-gate {"sigprocmask", 3, DEC, NOV, SPM, HEX, HEX}, /* 95 */ 3190Sstevel@tonic-gate {"sigsuspend", 1, DEC, NOV, HEX}, /* 96 */ 3200Sstevel@tonic-gate {"sigaltstack", 2, DEC, NOV, HEX, HEX}, /* 97 */ 3210Sstevel@tonic-gate {"sigaction", 3, DEC, NOV, SIG, HEX, HEX}, /* 98 */ 3220Sstevel@tonic-gate {"sigpendsys", 2, DEC, NOV, DEC, HEX}, /* 99 */ 3230Sstevel@tonic-gate {"context", 2, DEC, NOV, DEC, HEX}, /* 100 */ 3240Sstevel@tonic-gate {"evsys", 3, DEC, NOV, DEC, DEC, HEX}, /* 101 */ 3250Sstevel@tonic-gate {"evtrapret", 0, DEC, NOV}, /* 102 */ 3260Sstevel@tonic-gate {"statvfs", 2, DEC, NOV, STG, HEX}, /* 103 */ 3270Sstevel@tonic-gate {"fstatvfs", 2, DEC, NOV, DEC, HEX}, /* 104 */ 3280Sstevel@tonic-gate {"getloadavg", 2, DEC, NOV, HEX, DEC}, /* 105 */ 3290Sstevel@tonic-gate {"nfssys", 2, DEC, NOV, DEC, HEX}, /* 106 */ 3300Sstevel@tonic-gate {"waitid", 4, DEC, NOV, IDT, DEC, HEX, WOP}, /* 107 */ 3310Sstevel@tonic-gate {"sigsendsys", 2, DEC, NOV, HEX, SIG}, /* 108 */ 3320Sstevel@tonic-gate {"hrtsys", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 109 */ 33310440SRoger.Faulkner@Sun.COM {"utimesys", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 110 */ 3344806Sraf {"sigresend", 3, DEC, NOV, SIG, HEX, HEX}, /* 111 */ 3350Sstevel@tonic-gate {"priocntlsys", 5, DEC, NOV, DEC, HEX, DEC, PC4, PC5}, /* 112 */ 3360Sstevel@tonic-gate {"pathconf", 2, DEC, NOV, STG, PTC}, /* 113 */ 3370Sstevel@tonic-gate {"mincore", 3, DEC, NOV, HEX, UNS, HEX}, /* 114 */ 3380Sstevel@tonic-gate {"mmap", 6, HEX, NOV, HEX, UNS, MPR, MTY, DEC, DEC}, /* 115 */ 3390Sstevel@tonic-gate {"mprotect", 3, DEC, NOV, HEX, UNS, MPR}, /* 116 */ 3400Sstevel@tonic-gate {"munmap", 2, DEC, NOV, HEX, UNS}, /* 117 */ 3410Sstevel@tonic-gate {"fpathconf", 2, DEC, NOV, DEC, PTC}, /* 118 */ 3420Sstevel@tonic-gate {"vfork", 0, DEC, NOV}, /* 119 */ 3430Sstevel@tonic-gate {"fchdir", 1, DEC, NOV, DEC}, /* 120 */ 3440Sstevel@tonic-gate {"readv", 3, DEC, NOV, DEC, HEX, DEC}, /* 121 */ 3450Sstevel@tonic-gate {"writev", 3, DEC, NOV, DEC, HEX, DEC}, /* 122 */ 3460Sstevel@tonic-gate {"xstat", 3, DEC, NOV, DEC, STG, HEX}, /* 123 */ 3470Sstevel@tonic-gate {"lxstat", 3, DEC, NOV, DEC, STG, HEX}, /* 124 */ 3480Sstevel@tonic-gate {"fxstat", 3, DEC, NOV, DEC, DEC, HEX}, /* 125 */ 3490Sstevel@tonic-gate {"xmknod", 4, DEC, NOV, DEC, STG, OCT, HEX}, /* 126 */ 35010198SAli.Bahrami@Sun.COM {"mmapobj", 5, DEC, NOV, DEC, MOB, HEX, HEX, HEX}, /* 127 */ 3510Sstevel@tonic-gate {"setrlimit", 2, DEC, NOV, RLM, HEX}, /* 128 */ 3520Sstevel@tonic-gate {"getrlimit", 2, DEC, NOV, RLM, HEX}, /* 129 */ 3530Sstevel@tonic-gate {"lchown", 3, DEC, NOV, STG, DEC, DEC}, /* 130 */ 3540Sstevel@tonic-gate {"memcntl", 6, DEC, NOV, HEX, UNS, MCF, MC4, MC5, DEC}, /* 131 */ 3550Sstevel@tonic-gate {"getpmsg", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 132 */ 3560Sstevel@tonic-gate {"putpmsg", 5, DEC, NOV, DEC, HEX, HEX, DEC, HHX}, /* 133 */ 3570Sstevel@tonic-gate {"rename", 2, DEC, NOV, STG, STG}, /* 134 */ 3580Sstevel@tonic-gate {"uname", 1, DEC, NOV, HEX}, /* 135 */ 3594321Scasper {"setegid", 1, DEC, NOV, UNS}, /* 136 */ 3600Sstevel@tonic-gate {"sysconfig", 1, DEC, NOV, CNF}, /* 137 */ 3610Sstevel@tonic-gate {"adjtime", 2, DEC, NOV, HEX, HEX}, /* 138 */ 3620Sstevel@tonic-gate {"sysinfo", 3, DEC, NOV, INF, RST, DEC}, /* 139 */ 3633957Sth199096 {"sharefs", 3, DEC, NOV, DEC, HEX, DEC}, /* 140 */ 3644321Scasper {"seteuid", 1, DEC, NOV, UNS}, /* 141 */ 3653235Sraf {"forksys", 2, DEC, NOV, DEC, HHX}, /* 142 */ 3660Sstevel@tonic-gate {"fork1", 0, DEC, NOV}, /* 143 */ 3670Sstevel@tonic-gate {"sigtimedwait", 3, DEC, NOV, HEX, HEX, HEX}, /* 144 */ 3680Sstevel@tonic-gate {"lwp_info", 1, DEC, NOV, HEX}, /* 145 */ 3690Sstevel@tonic-gate {"yield", 0, DEC, NOV}, /* 146 */ 3700Sstevel@tonic-gate {"lwp_sema_wait", 1, DEC, NOV, HEX}, /* 147 */ 3710Sstevel@tonic-gate {"lwp_sema_post", 1, DEC, NOV, HEX}, /* 148 */ 3720Sstevel@tonic-gate {"lwp_sema_trywait", 1, DEC, NOV, HEX}, /* 149 */ 3730Sstevel@tonic-gate {"lwp_detach", 1, DEC, NOV, DEC}, /* 150 */ 3740Sstevel@tonic-gate {"corectl", 4, DEC, NOV, DEC, HEX, HEX, HEX}, /* 151 */ 3750Sstevel@tonic-gate {"modctl", 5, DEC, NOV, MOD, HEX, HEX, HEX, HEX}, /* 152 */ 3760Sstevel@tonic-gate {"fchroot", 1, DEC, NOV, DEC}, /* 153 */ 3770Sstevel@tonic-gate {"utimes", 2, DEC, NOV, STG, HEX}, /* 154 */ 3780Sstevel@tonic-gate {"vhangup", 0, DEC, NOV}, /* 155 */ 3790Sstevel@tonic-gate {"gettimeofday", 1, DEC, NOV, HEX}, /* 156 */ 3800Sstevel@tonic-gate {"getitimer", 2, DEC, NOV, ITM, HEX}, /* 157 */ 3810Sstevel@tonic-gate {"setitimer", 3, DEC, NOV, ITM, HEX, HEX}, /* 158 */ 3820Sstevel@tonic-gate {"lwp_create", 3, DEC, NOV, HEX, LWF, HEX}, /* 159 */ 3830Sstevel@tonic-gate {"lwp_exit", 0, DEC, NOV}, /* 160 */ 3840Sstevel@tonic-gate {"lwp_suspend", 1, DEC, NOV, DEC}, /* 161 */ 3850Sstevel@tonic-gate {"lwp_continue", 1, DEC, NOV, DEC}, /* 162 */ 3860Sstevel@tonic-gate {"lwp_kill", 2, DEC, NOV, DEC, SIG}, /* 163 */ 3870Sstevel@tonic-gate {"lwp_self", 0, DEC, NOV}, /* 164 */ 3880Sstevel@tonic-gate {"lwp_sigmask", 3, HEX, HEX, SPM, HEX, HEX}, /* 165 */ 3890Sstevel@tonic-gate {"lwp_private", 3, HEX, NOV, DEC, DEC, HEX}, /* 166 */ 3900Sstevel@tonic-gate {"lwp_wait", 2, DEC, NOV, DEC, HEX}, /* 167 */ 3914574Sraf {"lwp_mutex_wakeup", 2, DEC, NOV, HEX, DEC}, /* 168 */ 3920Sstevel@tonic-gate {"lwp_mutex_lock", 1, DEC, NOV, HEX}, /* 169 */ 3930Sstevel@tonic-gate {"lwp_cond_wait", 4, DEC, NOV, HEX, HEX, HEX, DEC}, /* 170 */ 3940Sstevel@tonic-gate {"lwp_cond_signal", 1, DEC, NOV, HEX}, /* 171 */ 3950Sstevel@tonic-gate {"lwp_cond_broadcast", 1, DEC, NOV, HEX}, /* 172 */ 3960Sstevel@tonic-gate {"pread", 4, DEC, NOV, DEC, IOB, UNS, DEX}, /* 173 */ 3970Sstevel@tonic-gate {"pwrite", 4, DEC, NOV, DEC, IOB, UNS, DEX}, /* 174 */ 3980Sstevel@tonic-gate {"llseek", 4, LLO, NOV, DEC, LLO, HID, WHN}, /* 175 */ 3990Sstevel@tonic-gate {"inst_sync", 2, DEC, NOV, STG, DEC}, /* 176 */ 4002712Snn35248 {"brand", 6, DEC, NOV, DEC, HEX, HEX, HEX, HEX, HEX}, /* 177 */ 4010Sstevel@tonic-gate {"kaio", 7, DEC, NOV, AIO, HEX, HEX, HEX, HEX, HEX, HEX}, /* 178 */ 4020Sstevel@tonic-gate {"cpc", 5, DEC, NOV, CPC, DEC, HEX, HEX, HEX}, /* 179 */ 4030Sstevel@tonic-gate {"lgrpsys", 3, DEC, NOV, DEC, DEC, HEX}, /* 180 */ 4043247Sgjelinek {"rusagesys", 5, DEC, NOV, DEC, HEX, DEC, HEX, HEX}, /* 181 */ 4050Sstevel@tonic-gate {"portfs", 6, HEX, HEX, DEC, HEX, HEX, HEX, HEX, HEX}, /* 182 */ 4060Sstevel@tonic-gate {"pollsys", 4, DEC, NOV, HEX, DEC, HEX, HEX}, /* 183 */ 4071676Sjpk {"labelsys", 2, DEC, NOV, DEC, HEX}, /* 184 */ 4080Sstevel@tonic-gate {"acl", 4, DEC, NOV, STG, ACL, DEC, HEX}, /* 185 */ 4090Sstevel@tonic-gate {"auditsys", 4, DEC, NOV, AUD, HEX, HEX, HEX}, /* 186 */ 4100Sstevel@tonic-gate {"processor_bind", 4, DEC, NOV, IDT, DEC, DEC, HEX}, /* 187 */ 4110Sstevel@tonic-gate {"processor_info", 2, DEC, NOV, DEC, HEX}, /* 188 */ 4120Sstevel@tonic-gate {"p_online", 2, DEC, NOV, DEC, DEC}, /* 189 */ 4132248Sraf {"sigqueue", 5, DEC, NOV, DEC, SIG, HEX, SQC, DEC}, /* 190 */ 4140Sstevel@tonic-gate {"clock_gettime", 2, DEC, NOV, DEC, HEX}, /* 191 */ 4150Sstevel@tonic-gate {"clock_settime", 2, DEC, NOV, DEC, HEX}, /* 192 */ 4160Sstevel@tonic-gate {"clock_getres", 2, DEC, NOV, DEC, HEX}, /* 193 */ 4170Sstevel@tonic-gate {"timer_create", 3, DEC, NOV, DEC, HEX, HEX}, /* 194 */ 4180Sstevel@tonic-gate {"timer_delete", 1, DEC, NOV, DEC}, /* 195 */ 4190Sstevel@tonic-gate {"timer_settime", 4, DEC, NOV, DEC, DEC, HEX, HEX}, /* 196 */ 4200Sstevel@tonic-gate {"timer_gettime", 2, DEC, NOV, DEC, HEX}, /* 197 */ 4210Sstevel@tonic-gate {"timer_getoverrun", 1, DEC, NOV, DEC}, /* 198 */ 4220Sstevel@tonic-gate {"nanosleep", 2, DEC, NOV, HEX, HEX}, /* 199 */ 4230Sstevel@tonic-gate {"facl", 4, DEC, NOV, DEC, ACL, DEC, HEX}, /* 200 */ 4240Sstevel@tonic-gate {"door", 6, DEC, NOV, DEC, HEX, HEX, HEX, HEX, DEC}, /* 201 */ 4254321Scasper {"setreuid", 2, DEC, NOV, UN1, UN1}, /* 202 */ 4264321Scasper {"setregid", 2, DEC, NOV, UN1, UN1}, /* 203 */ 4270Sstevel@tonic-gate {"install_utrap", 3, DEC, NOV, DEC, HEX, HEX}, /* 204 */ 4280Sstevel@tonic-gate {"signotify", 3, DEC, NOV, DEC, HEX, HEX}, /* 205 */ 4290Sstevel@tonic-gate {"schedctl", 0, HEX, NOV}, /* 206 */ 4300Sstevel@tonic-gate {"pset", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 207 */ 4310Sstevel@tonic-gate {"sparc_utrap_install", 5, DEC, NOV, UTT, UTH, UTH, HEX, HEX}, /* 208 */ 4320Sstevel@tonic-gate {"resolvepath", 3, DEC, NOV, STG, RLK, DEC}, /* 209 */ 4330Sstevel@tonic-gate {"lwp_mutex_timedlock", 2, DEC, NOV, HEX, HEX}, /* 210 */ 4340Sstevel@tonic-gate {"lwp_sema_timedwait", 3, DEC, NOV, HEX, HEX, DEC}, /* 211 */ 4350Sstevel@tonic-gate {"lwp_rwlock_sys", 3, DEC, NOV, DEC, HEX, HEX}, /* 212 */ 4360Sstevel@tonic-gate {"getdents64", 3, DEC, NOV, DEC, HEX, UNS}, /* 213 */ 4370Sstevel@tonic-gate {"mmap64", 7, HEX, NOV, HEX, UNS, MPR, MTY, DEC, LLO, HID}, /* 214 */ 4380Sstevel@tonic-gate {"stat64", 2, DEC, NOV, STG, HEX}, /* 215 */ 4390Sstevel@tonic-gate {"lstat64", 2, DEC, NOV, STG, HEX}, /* 216 */ 4400Sstevel@tonic-gate {"fstat64", 2, DEC, NOV, DEC, HEX}, /* 217 */ 4410Sstevel@tonic-gate {"statvfs64", 2, DEC, NOV, STG, HEX}, /* 218 */ 4420Sstevel@tonic-gate {"fstatvfs64", 2, DEC, NOV, DEC, HEX}, /* 219 */ 4430Sstevel@tonic-gate {"setrlimit64", 2, DEC, NOV, RLM, HEX}, /* 220 */ 4440Sstevel@tonic-gate {"getrlimit64", 2, DEC, NOV, RLM, HEX}, /* 221 */ 4450Sstevel@tonic-gate {"pread64", 5, DEC, NOV, DEC, IOB, UNS, LLO, HID}, /* 222 */ 4460Sstevel@tonic-gate {"pwrite64", 5, DEC, NOV, DEC, IOB, UNS, LLO, HID}, /* 223 */ 4470Sstevel@tonic-gate {"creat64", 2, DEC, NOV, STG, OCT}, /* 224 */ 4480Sstevel@tonic-gate {"open64", 3, DEC, NOV, STG, OPN, OCT}, /* 225 */ 4490Sstevel@tonic-gate {"rpcmod", 3, DEC, NOV, DEC, HEX}, /* 226 */ 4500Sstevel@tonic-gate {"zone", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 227 */ 4510Sstevel@tonic-gate {"autofssys", 2, DEC, NOV, DEC, HEX}, /* 228 */ 4520Sstevel@tonic-gate {"getcwd", 3, DEC, NOV, RST, DEC}, /* 229 */ 4530Sstevel@tonic-gate {"so_socket", 5, DEC, NOV, PFM, SKT, SKP, STG, SKV}, /* 230 */ 4540Sstevel@tonic-gate {"so_socketpair", 1, DEC, NOV, HEX}, /* 231 */ 4550Sstevel@tonic-gate {"bind", 4, DEC, NOV, DEC, HEX, DEC, SKV}, /* 232 */ 4560Sstevel@tonic-gate {"listen", 3, DEC, NOV, DEC, DEC, SKV}, /* 233 */ 4570Sstevel@tonic-gate {"accept", 4, DEC, NOV, DEC, HEX, HEX, SKV}, /* 234 */ 4580Sstevel@tonic-gate {"connect", 4, DEC, NOV, DEC, HEX, DEC, SKV}, /* 235 */ 4590Sstevel@tonic-gate {"shutdown", 3, DEC, NOV, DEC, SHT, SKV}, /* 236 */ 4600Sstevel@tonic-gate {"recv", 4, DEC, NOV, DEC, IOB, DEC, DEC}, /* 237 */ 4610Sstevel@tonic-gate {"recvfrom", 6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, HEX}, /* 238 */ 4620Sstevel@tonic-gate {"recvmsg", 3, DEC, NOV, DEC, HEX, DEC}, /* 239 */ 4630Sstevel@tonic-gate {"send", 4, DEC, NOV, DEC, IOB, DEC, DEC}, /* 240 */ 4640Sstevel@tonic-gate {"sendmsg", 3, DEC, NOV, DEC, HEX, DEC}, /* 241 */ 4650Sstevel@tonic-gate {"sendto", 6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, DEC}, /* 242 */ 4660Sstevel@tonic-gate {"getpeername", 4, DEC, NOV, DEC, HEX, HEX, SKV}, /* 243 */ 4670Sstevel@tonic-gate {"getsockname", 4, DEC, NOV, DEC, HEX, HEX, SKV}, /* 244 */ 4680Sstevel@tonic-gate {"getsockopt", 6, DEC, NOV, DEC, SOL, SON, HEX, HEX, SKV}, /* 245 */ 4690Sstevel@tonic-gate {"setsockopt", 6, DEC, NOV, DEC, SOL, SON, HEX, DEC, SKV}, /* 246 */ 4700Sstevel@tonic-gate {"sockconfig", 4, DEC, NOV, DEC, DEC, DEC, STG}, /* 247 */ 4710Sstevel@tonic-gate {"ntp_gettime", 1, DEC, NOV, HEX}, /* 248 */ 4720Sstevel@tonic-gate {"ntp_adjtime", 1, DEC, NOV, HEX}, /* 249 */ 4730Sstevel@tonic-gate {"lwp_mutex_unlock", 1, DEC, NOV, HEX}, /* 250 */ 4740Sstevel@tonic-gate {"lwp_mutex_trylock", 1, DEC, NOV, HEX}, /* 251 */ 4759264SRoger.Faulkner@Sun.COM {"lwp_mutex_register", 2, DEC, NOV, HEX, HEX}, /* 252 */ 4760Sstevel@tonic-gate {"cladm", 3, DEC, NOV, CLC, CLF, HEX}, /* 253 */ 4772712Snn35248 {"uucopy", 3, DEC, NOV, HEX, HEX, UNS}, /* 254 */ 4780Sstevel@tonic-gate {"umount2", 2, DEC, NOV, STG, MTF}, /* 255 */ 4790Sstevel@tonic-gate { NULL, -1, DEC, NOV}, 4800Sstevel@tonic-gate }; 4810Sstevel@tonic-gate 4820Sstevel@tonic-gate /* SYSEND == max syscall number + 1 */ 4830Sstevel@tonic-gate #define SYSEND ((sizeof (systable) / sizeof (struct systable))-1) 4840Sstevel@tonic-gate 4850Sstevel@tonic-gate 4860Sstevel@tonic-gate /* 4870Sstevel@tonic-gate * The following are for interpreting syscalls with sub-codes. 4880Sstevel@tonic-gate */ 4890Sstevel@tonic-gate 4900Sstevel@tonic-gate const struct systable opentable[] = { 4910Sstevel@tonic-gate {"open", 2, DEC, NOV, STG, OPN}, /* 0 */ 4920Sstevel@tonic-gate {"open", 3, DEC, NOV, STG, OPN, OCT}, /* 1 */ 4930Sstevel@tonic-gate }; 4940Sstevel@tonic-gate #define NOPENCODE (sizeof (opentable) / sizeof (struct systable)) 4950Sstevel@tonic-gate 4960Sstevel@tonic-gate const struct systable open64table[] = { 4970Sstevel@tonic-gate {"open64", 2, DEC, NOV, STG, OPN}, /* 0 */ 4980Sstevel@tonic-gate {"open64", 3, DEC, NOV, STG, OPN, OCT}, /* 1 */ 4990Sstevel@tonic-gate }; 5000Sstevel@tonic-gate #define NOPEN64CODE (sizeof (open64table) / sizeof (struct systable)) 5010Sstevel@tonic-gate 5020Sstevel@tonic-gate const struct systable fcntltable[] = { 5030Sstevel@tonic-gate {"fcntl", 3, DEC, NOV, DEC, FCN, HEX}, /* 0: default */ 5040Sstevel@tonic-gate {"fcntl", 2, DEC, NOV, DEC, FCN}, /* 1: no arg */ 5050Sstevel@tonic-gate {"fcntl", 3, DEC, NOV, DEC, FCN, FFG}, /* 2: F_SETFL */ 5060Sstevel@tonic-gate }; 5070Sstevel@tonic-gate #define NFCNTLCODE (sizeof (fcntltable) / sizeof (struct systable)) 5080Sstevel@tonic-gate 5090Sstevel@tonic-gate const struct systable sigtable[] = { 5100Sstevel@tonic-gate {"signal", 2, HEX, NOV, SIG, ACT}, /* 0 */ 5110Sstevel@tonic-gate {"sigset", 2, HEX, NOV, SIX, ACT}, /* 1 */ 5120Sstevel@tonic-gate {"sighold", 1, HEX, NOV, SIX}, /* 2 */ 5130Sstevel@tonic-gate {"sigrelse", 1, HEX, NOV, SIX}, /* 3 */ 5140Sstevel@tonic-gate {"sigignore", 1, HEX, NOV, SIX}, /* 4 */ 5150Sstevel@tonic-gate {"sigpause", 1, HEX, NOV, SIX}, /* 5 */ 5160Sstevel@tonic-gate }; 5170Sstevel@tonic-gate #define NSIGCODE (sizeof (sigtable) / sizeof (struct systable)) 5180Sstevel@tonic-gate 5190Sstevel@tonic-gate const struct systable msgtable[] = { 5200Sstevel@tonic-gate {"msgget", 3, DEC, NOV, HID, KEY, MSF}, /* 0 */ 5210Sstevel@tonic-gate {"msgctl", 4, DEC, NOV, HID, DEC, MSC, HEX}, /* 1 */ 5220Sstevel@tonic-gate {"msgrcv", 6, DEC, NOV, HID, DEC, HEX, UNS, DEC, MSF}, /* 2 */ 5230Sstevel@tonic-gate {"msgsnd", 5, DEC, NOV, HID, DEC, HEX, UNS, MSF}, /* 3 */ 5240Sstevel@tonic-gate {"msgids", 4, DEC, NOV, HID, HEX, UNS, HEX}, /* 4 */ 5250Sstevel@tonic-gate {"msgsnap", 5, DEC, NOV, HID, DEC, HEX, UNS, DEC}, /* 5 */ 5260Sstevel@tonic-gate }; 5270Sstevel@tonic-gate #define NMSGCODE (sizeof (msgtable) / sizeof (struct systable)) 5280Sstevel@tonic-gate 5290Sstevel@tonic-gate const struct systable semtable[] = { 5300Sstevel@tonic-gate {"semctl", 5, DEC, NOV, HID, DEC, DEC, SMC, DEX}, /* 0 */ 5310Sstevel@tonic-gate {"semget", 4, DEC, NOV, HID, KEY, DEC, SEF}, /* 1 */ 5320Sstevel@tonic-gate {"semop", 4, DEC, NOV, HID, DEC, HEX, UNS}, /* 2 */ 5330Sstevel@tonic-gate {"semids", 4, DEC, NOV, HID, HEX, UNS, HEX}, /* 3 */ 5340Sstevel@tonic-gate {"semtimedop", 5, DEC, NOV, HID, DEC, HEX, UNS, HEX}, /* 4 */ 5350Sstevel@tonic-gate }; 5360Sstevel@tonic-gate #define NSEMCODE (sizeof (semtable) / sizeof (struct systable)) 5370Sstevel@tonic-gate 5380Sstevel@tonic-gate const struct systable shmtable[] = { 5390Sstevel@tonic-gate {"shmat", 4, HEX, NOV, HID, DEC, DEX, SHF}, /* 0 */ 5400Sstevel@tonic-gate {"shmctl", 4, DEC, NOV, HID, DEC, SHC, DEX}, /* 1 */ 5410Sstevel@tonic-gate {"shmdt", 2, DEC, NOV, HID, HEX}, /* 2 */ 5420Sstevel@tonic-gate {"shmget", 4, DEC, NOV, HID, KEY, UNS, SHF}, /* 3 */ 5430Sstevel@tonic-gate {"shmids", 4, DEC, NOV, HID, HEX, UNS, HEX}, /* 4 */ 5440Sstevel@tonic-gate }; 5450Sstevel@tonic-gate #define NSHMCODE (sizeof (shmtable) / sizeof (struct systable)) 5460Sstevel@tonic-gate 5470Sstevel@tonic-gate const struct systable pidtable[] = { 5480Sstevel@tonic-gate {"getpgrp", 1, DEC, NOV, HID}, /* 0 */ 5490Sstevel@tonic-gate {"setpgrp", 1, DEC, NOV, HID}, /* 1 */ 5500Sstevel@tonic-gate {"getsid", 2, DEC, NOV, HID, DEC}, /* 2 */ 5510Sstevel@tonic-gate {"setsid", 1, DEC, NOV, HID}, /* 3 */ 5520Sstevel@tonic-gate {"getpgid", 2, DEC, NOV, HID, DEC}, /* 4 */ 5530Sstevel@tonic-gate {"setpgid", 3, DEC, NOV, HID, DEC, DEC}, /* 5 */ 5540Sstevel@tonic-gate }; 5550Sstevel@tonic-gate #define NPIDCODE (sizeof (pidtable) / sizeof (struct systable)) 5560Sstevel@tonic-gate 5570Sstevel@tonic-gate const struct systable sfstable[] = { 5580Sstevel@tonic-gate {"sysfs", 3, DEC, NOV, SFS, DEX, DEX}, /* 0 */ 5590Sstevel@tonic-gate {"sysfs", 2, DEC, NOV, SFS, STG}, /* 1 */ 5600Sstevel@tonic-gate {"sysfs", 3, DEC, NOV, SFS, DEC, RST}, /* 2 */ 5610Sstevel@tonic-gate {"sysfs", 1, DEC, NOV, SFS}, /* 3 */ 5620Sstevel@tonic-gate }; 5630Sstevel@tonic-gate #define NSFSCODE (sizeof (sfstable) / sizeof (struct systable)) 5640Sstevel@tonic-gate 5650Sstevel@tonic-gate const struct systable utstable[] = { 5660Sstevel@tonic-gate {"utssys", 3, DEC, NOV, HEX, DEC, UTS}, /* 0 */ 5670Sstevel@tonic-gate {"utssys", 4, DEC, NOV, HEX, HEX, HEX, HEX}, /* err */ 5680Sstevel@tonic-gate {"utssys", 3, DEC, NOV, HEX, HHX, UTS}, /* 2 */ 5690Sstevel@tonic-gate {"utssys", 4, DEC, NOV, STG, FUI, UTS, HEX} /* 3 */ 5700Sstevel@tonic-gate }; 5710Sstevel@tonic-gate #define NUTSCODE (sizeof (utstable) / sizeof (struct systable)) 5720Sstevel@tonic-gate 5732447Snf202958 const struct systable rctltable[] = { 5742447Snf202958 {"getrctl", 6, DEC, NOV, HID, STG, HEX, HEX, HID, RGF}, /* 0 */ 5752447Snf202958 {"setrctl", 6, DEC, NOV, HID, STG, HEX, HEX, HID, RSF}, /* 1 */ 5762447Snf202958 {"rctlsys_lst", 6, DEC, NOV, HID, HID, HEX, HID, HEX, HID}, /* 2 */ 5772447Snf202958 {"rctlsys_ctl", 6, DEC, NOV, HID, STG, HEX, HID, HID, RCF}, /* 3 */ 5783684Srd117015 {"setprojrctl", 6, DEC, NOV, HID, STG, HID, HEX, HEX, SPF}, /* 4 */ 5792447Snf202958 }; 5802447Snf202958 #define NRCTLCODE (sizeof (rctltable) / sizeof (struct systable)) 5812447Snf202958 5820Sstevel@tonic-gate const struct systable sgptable[] = { 5830Sstevel@tonic-gate {"sigpendsys", 2, DEC, NOV, DEC, HEX}, /* err */ 5840Sstevel@tonic-gate {"sigpending", 2, DEC, NOV, HID, HEX}, /* 1 */ 5850Sstevel@tonic-gate {"sigfillset", 2, DEC, NOV, HID, HEX}, /* 2 */ 5860Sstevel@tonic-gate }; 5870Sstevel@tonic-gate #define NSGPCODE (sizeof (sgptable) / sizeof (struct systable)) 5880Sstevel@tonic-gate 5890Sstevel@tonic-gate const struct systable ctxtable[] = { 5900Sstevel@tonic-gate {"getcontext", 2, DEC, NOV, HID, HEX}, /* 0 */ 5910Sstevel@tonic-gate {"setcontext", 2, DEC, NOV, HID, HEX}, /* 1 */ 5920Sstevel@tonic-gate {"getustack", 2, DEC, NOV, HID, HEX}, /* 2 */ 5930Sstevel@tonic-gate {"setustack", 2, DEC, NOV, HID, HEX}, /* 3 */ 5940Sstevel@tonic-gate }; 5950Sstevel@tonic-gate #define NCTXCODE (sizeof (ctxtable) / sizeof (struct systable)) 5960Sstevel@tonic-gate 5970Sstevel@tonic-gate const struct systable hrttable[] = { 5980Sstevel@tonic-gate {"hrtcntl", 5, DEC, NOV, HID, DEC, DEC, HEX, HEX}, /* 0 */ 5990Sstevel@tonic-gate {"hrtalarm", 3, DEC, NOV, HID, HEX, DEC}, /* 1 */ 6000Sstevel@tonic-gate {"hrtsleep", 2, DEC, NOV, HID, HEX}, /* 2 */ 6010Sstevel@tonic-gate {"hrtcancel", 3, DEC, NOV, HID, HEX, DEC}, /* 3 */ 6020Sstevel@tonic-gate }; 6030Sstevel@tonic-gate #define NHRTCODE (sizeof (hrttable) / sizeof (struct systable)) 6040Sstevel@tonic-gate 6050Sstevel@tonic-gate const struct systable cortable[] = { 6060Sstevel@tonic-gate {"corectl", 4, DEC, NOV, COR, HEX, HEX, HEX}, /* 0 */ 6070Sstevel@tonic-gate {"corectl", 2, DEC, NOV, COR, CCO}, /* 1 */ 6080Sstevel@tonic-gate {"corectl", 1, HHX, NOV, COR}, /* 2 */ 6090Sstevel@tonic-gate {"corectl", 3, DEC, NOV, COR, STG, DEC}, /* 3 */ 6100Sstevel@tonic-gate {"corectl", 3, DEC, NOV, COR, RST, DEC}, /* 4 */ 6110Sstevel@tonic-gate {"corectl", 4, DEC, NOV, COR, STG, DEC, DEC}, /* 5 */ 6120Sstevel@tonic-gate {"corectl", 4, DEC, NOV, COR, RST, DEC, DEC}, /* 6 */ 6130Sstevel@tonic-gate {"corectl", 2, DEC, NOV, COR, CCC}, /* 7 */ 6140Sstevel@tonic-gate {"corectl", 2, DEC, NOV, COR, RCC}, /* 8 */ 6150Sstevel@tonic-gate {"corectl", 3, DEC, NOV, COR, CCC, DEC}, /* 9 */ 6160Sstevel@tonic-gate {"corectl", 3, DEC, NOV, COR, RCC, DEC}, /* 10 */ 6170Sstevel@tonic-gate {"corectl", 3, DEC, NOV, COR, STG, DEC}, /* 11 */ 6180Sstevel@tonic-gate {"corectl", 3, DEC, NOV, COR, RST, DEC}, /* 12 */ 6190Sstevel@tonic-gate {"corectl", 2, DEC, NOV, COR, CCC}, /* 13 */ 6200Sstevel@tonic-gate {"corectl", 2, DEC, NOV, COR, RCC}, /* 14 */ 6210Sstevel@tonic-gate }; 6220Sstevel@tonic-gate #define NCORCODE (sizeof (cortable) / sizeof (struct systable)) 6230Sstevel@tonic-gate 6240Sstevel@tonic-gate const struct systable aiotable[] = { 6250Sstevel@tonic-gate {"kaio", 7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 0 */ 6260Sstevel@tonic-gate {"kaio", 7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 1 */ 6270Sstevel@tonic-gate {"kaio", 3, DEC, NOV, AIO, HEX, DEC}, /* 2 */ 6280Sstevel@tonic-gate {"kaio", 3, DEC, NOV, AIO, DEC, HEX}, /* 3 */ 6290Sstevel@tonic-gate {"kaio", 1, DEC, NOV, AIO}, /* 4 */ 6300Sstevel@tonic-gate {"kaio", 1, DEC, NOV, AIO}, /* 5 */ 6310Sstevel@tonic-gate {"kaio", 1, DEC, NOV, AIO}, /* 6 */ 6320Sstevel@tonic-gate {"kaio", 5, DEC, NOV, AIO, LIO, HEX, DEC, HEX}, /* 7 */ 6330Sstevel@tonic-gate {"kaio", 5, DEC, NOV, AIO, HEX, DEC, HEX, DEC}, /* 8 */ 6340Sstevel@tonic-gate {"kaio", 2, DEC, NOV, AIO, HEX}, /* 9 */ 6350Sstevel@tonic-gate {"kaio", 5, DEC, NOV, AIO, LIO, HEX, DEC, HEX}, /* 10 */ 6360Sstevel@tonic-gate {"kaio", 2, DEC, NOV, AIO, HEX}, /* 11 */ 6370Sstevel@tonic-gate {"kaio", 2, DEC, NOV, AIO, HEX}, /* 12 */ 6380Sstevel@tonic-gate {"kaio", 5, DEC, NOV, AIO, LIO, HEX, DEC, HEX}, /* 13 */ 6390Sstevel@tonic-gate {"kaio", 5, DEC, NOV, AIO, HEX, DEC, HEX, DEC}, /* 14 */ 6400Sstevel@tonic-gate {"kaio", 2, DEC, NOV, AIO, HEX}, /* 15 */ 6410Sstevel@tonic-gate {"kaio", 5, DEC, NOV, AIO, LIO, HEX, DEC, HEX}, /* 16 */ 6420Sstevel@tonic-gate {"kaio", 2, DEC, NOV, AIO, HEX}, /* 17 */ 6430Sstevel@tonic-gate {"kaio", 2, DEC, NOV, AIO, HEX}, /* 18 */ 6440Sstevel@tonic-gate {"kaio", 3, DEC, NOV, AIO, DEC, HEX}, /* 19 */ 6450Sstevel@tonic-gate {"kaio", 1, DEC, NOV, AIO}, /* 20 */ 6460Sstevel@tonic-gate {"kaio", 5, DEC, NOV, AIO, HEX, DEC, HEX, HEX}, /* 21 */ 6470Sstevel@tonic-gate }; 6480Sstevel@tonic-gate #define NAIOCODE (sizeof (aiotable) / sizeof (struct systable)) 6490Sstevel@tonic-gate 6500Sstevel@tonic-gate const struct systable doortable[] = { 6510Sstevel@tonic-gate {"door_create", 3, DEC, NOV, HEX, HEX, DFL}, /* 0 */ 6520Sstevel@tonic-gate {"door_revoke", 1, DEC, NOV, DEC}, /* 1 */ 6530Sstevel@tonic-gate {"door_info", 2, DEC, NOV, DEC, HEX}, /* 2 */ 6540Sstevel@tonic-gate {"door_call", 2, DEC, NOV, DEC, HEX}, /* 3 */ 6550Sstevel@tonic-gate {"door_return", 4, DEC, NOV, HEX, DEC, HEX, DEC}, /* 4 (old) */ 6560Sstevel@tonic-gate {"door_cred", 1, DEC, NOV, HEX}, /* 5 (old) */ 6570Sstevel@tonic-gate {"door_bind", 1, DEC, NOV, DEC}, /* 6 */ 6580Sstevel@tonic-gate {"door_unbind", 0, DEC, NOV}, /* 7 */ 6590Sstevel@tonic-gate {"door_unref", 0, DEC, NOV}, /* 8 */ 6600Sstevel@tonic-gate {"door_ucred", 1, DEC, NOV, HEX}, /* 9 */ 6610Sstevel@tonic-gate {"door_return", 5, DEC, NOV, HEX, DEC, HEX, HEX, DEC}, /* 10 */ 6620Sstevel@tonic-gate {"door_getparam", 3, DEC, NOV, DEC, DPM, HEX}, /* 11 */ 6630Sstevel@tonic-gate {"door_setparam", 3, DEC, NOV, DEC, DPM, DEC}, /* 12 */ 6640Sstevel@tonic-gate }; 6650Sstevel@tonic-gate #define NDOORCODE (sizeof (doortable) / sizeof (struct systable)) 6660Sstevel@tonic-gate 6670Sstevel@tonic-gate const struct systable psettable[] = { 6680Sstevel@tonic-gate {"pset_create", 2, DEC, NOV, HID, HEX}, /* 0 */ 6690Sstevel@tonic-gate {"pset_destroy", 2, DEC, NOV, HID, PST}, /* 1 */ 6700Sstevel@tonic-gate {"pset_assign", 4, DEC, NOV, HID, PST, DEC, HEX}, /* 2 */ 6710Sstevel@tonic-gate {"pset_info", 5, DEC, NOV, HID, PST, HEX, HEX, HEX}, /* 3 */ 6720Sstevel@tonic-gate {"pset_bind", 5, DEC, NOV, HID, PST, IDT, DEC, HEX}, /* 4 */ 6730Sstevel@tonic-gate {"pset_getloadavg", 4, DEC, NOV, HID, PST, HEX, DEC}, /* 5 */ 6740Sstevel@tonic-gate {"pset_list", 3, DEC, NOV, HID, HEX, HEX}, /* 6 */ 6750Sstevel@tonic-gate {"pset_setattr", 3, DEC, NOV, HID, PST, HEX}, /* 7 */ 6760Sstevel@tonic-gate {"pset_getattr", 3, DEC, NOV, HID, PST, HEX}, /* 8 */ 6770Sstevel@tonic-gate {"pset_assign_forced", 4, DEC, NOV, HID, PST, DEC, HEX}, /* 9 */ 6780Sstevel@tonic-gate }; 6790Sstevel@tonic-gate #define NPSETCODE (sizeof (psettable) / sizeof (struct systable)) 6800Sstevel@tonic-gate 6810Sstevel@tonic-gate const struct systable lwpcreatetable[] = { 6820Sstevel@tonic-gate {"lwp_create", 3, DEC, NOV, HEX, LWF, HEX}, /* 0 */ 6830Sstevel@tonic-gate {"lwp_create", 0, DEC, NOV}, /* 1 */ 6840Sstevel@tonic-gate }; 6850Sstevel@tonic-gate #define NLWPCREATECODE (sizeof (lwpcreatetable) / sizeof (struct systable)) 6860Sstevel@tonic-gate 6870Sstevel@tonic-gate static const struct systable tasksystable[] = { 6880Sstevel@tonic-gate {"settaskid", 3, DEC, NOV, HID, DEC, HEX}, /* 0 */ 6890Sstevel@tonic-gate {"gettaskid", 1, DEC, NOV, HID}, /* 1 */ 6900Sstevel@tonic-gate {"getprojid", 1, DEC, NOV, HID}, /* 2 */ 6910Sstevel@tonic-gate }; 6920Sstevel@tonic-gate #define NTASKSYSCODE (sizeof (tasksystable) / sizeof (struct systable)) 6930Sstevel@tonic-gate 6940Sstevel@tonic-gate static const struct systable privsystable[] = { 6950Sstevel@tonic-gate {"setppriv", 4, DEC, NOV, HID, PRO, PRN, PRS}, /* 0 */ 6960Sstevel@tonic-gate {"getppriv", 4, DEC, NOV, HID, HID, PRN, PRS}, /* 1 */ 6970Sstevel@tonic-gate {"getprivimplinfo", 5, DEC, NOV, HID, HID, HID, HEX, DEC}, /* 2 */ 6980Sstevel@tonic-gate {"setpflags", 3, DEC, NOV, HID, PFL, DEC}, /* 3 */ 6990Sstevel@tonic-gate {"getpflags", 2, DEC, NOV, HID, PFL}, /* 4 */ 7004321Scasper {"issetugid", 0, DEC, NOV, HID}, /* 5 */ 7010Sstevel@tonic-gate }; 7020Sstevel@tonic-gate #define NPRIVSYSCODE (sizeof (privsystable) / sizeof (struct systable)) 7030Sstevel@tonic-gate 7040Sstevel@tonic-gate static const struct systable exacctsystable[] = { 7050Sstevel@tonic-gate {"getacct", 5, DEC, NOV, HID, IDT, DEC, HEX, UNS}, /* 0 */ 7060Sstevel@tonic-gate {"putacct", 6, DEC, NOV, HID, IDT, DEC, HEX, UNS, HEX}, /* 1 */ 7070Sstevel@tonic-gate {"wracct", 4, DEC, NOV, HID, IDT, DEC, HEX}, /* 2 */ 7080Sstevel@tonic-gate }; 7090Sstevel@tonic-gate #define NEXACCTSYSCODE (sizeof (exacctsystable) / sizeof (struct systable)) 7100Sstevel@tonic-gate 7110Sstevel@tonic-gate static const struct systable fsatsystable[] = { 7120Sstevel@tonic-gate {"openat", 5, DEC, NOV, HID, ATC, STG, OPN, OCT}, /* 0 */ 7130Sstevel@tonic-gate {"openat64", 5, DEC, NOV, HID, ATC, STG, OPN, OCT}, /* 1 */ 7140Sstevel@tonic-gate {"fstatat64", 5, DEC, NOV, HID, ATC, STG, HEX, HEX}, /* 2 */ 7150Sstevel@tonic-gate {"fstatat", 5, DEC, NOV, HID, ATC, STG, HEX, HEX}, /* 3 */ 7160Sstevel@tonic-gate {"fchownat", 6, DEC, NOV, HID, ATC, STG, HEX, HEX, HEX}, /* 4 */ 7170Sstevel@tonic-gate {"unlinkat", 4, DEC, NOV, HID, ATC, STG, HEX}, /* 5 */ 7180Sstevel@tonic-gate {"futimesat", 4, DEC, NOV, HID, ATC, STG, HEX}, /* 6 */ 7190Sstevel@tonic-gate {"renameat", 5, DEC, NOV, HID, ATC, STG, DEC, STG}, /* 7 */ 7209880SSumanth.Naropanth@Sun.COM {"faccessat", 5, DEC, NOV, HID, ATC, STG, ACC, ACC}, /* 8 */ 7215331Samw {"__openattrdirat", 3, DEC, NOV, HID, ATC, STG}, /* 9 */ 7223855Ssn199410 {"openat", 4, DEC, NOV, HID, ATC, STG, OPN}, /* N - 2 */ 7233855Ssn199410 {"openat64", 4, DEC, NOV, HID, ATC, STG, OPN}, /* N - 1 */ 7240Sstevel@tonic-gate }; 7250Sstevel@tonic-gate #define NFSATSYSCODE (sizeof (fsatsystable) / sizeof (struct systable)) 7260Sstevel@tonic-gate 7270Sstevel@tonic-gate static const struct systable lwpparktable[] = { 7280Sstevel@tonic-gate {"lwp_park", 3, DEC, NOV, HID, HEX, DEC}, /* 0 */ 7290Sstevel@tonic-gate {"lwp_unpark", 2, DEC, NOV, HID, DEC}, /* 1 */ 7300Sstevel@tonic-gate {"lwp_unpark_all", 3, DEC, NOV, HID, HEX, DEC}, /* 2 */ 7314389Ssl108498 {"lwp_unpark_cancel", 2, DEC, NOV, HID, DEC}, /* 3 */ 7324389Ssl108498 {"lwp_set_park", 3, DEC, NOV, HID, HEX, DEC}, /* 4 */ 7330Sstevel@tonic-gate }; 7340Sstevel@tonic-gate #define NLWPPARKCODE (sizeof (lwpparktable) / sizeof (struct systable)) 7350Sstevel@tonic-gate 7360Sstevel@tonic-gate static const struct systable lwprwlocktable[] = { 7370Sstevel@tonic-gate {"lwp_rwlock_rdlock", 3, DEC, NOV, HID, HEX, HEX}, /* 0 */ 7380Sstevel@tonic-gate {"lwp_rwlock_wrlock", 3, DEC, NOV, HID, HEX, HEX}, /* 1 */ 7390Sstevel@tonic-gate {"lwp_rwlock_tryrdlock", 2, DEC, NOV, HID, HEX}, /* 2 */ 7400Sstevel@tonic-gate {"lwp_rwlock_trywrlock", 2, DEC, NOV, HID, HEX}, /* 3 */ 7410Sstevel@tonic-gate {"lwp_rwlock_unlock", 2, DEC, NOV, HID, HEX}, /* 4 */ 7420Sstevel@tonic-gate }; 7430Sstevel@tonic-gate #define NLWPRWLOCKCODE (sizeof (lwprwlocktable) / sizeof (struct systable)) 7440Sstevel@tonic-gate 7450Sstevel@tonic-gate static const struct systable sendfilevsystable[] = { 7460Sstevel@tonic-gate {"sendfilev", 5, DEC, NOV, DEC, DEC, HEX, DEC, HEX}, /* 0 */ 7470Sstevel@tonic-gate {"sendfilev64", 5, DEC, NOV, DEC, DEC, HEX, DEC, HEX}, /* 1 */ 7480Sstevel@tonic-gate }; 7490Sstevel@tonic-gate #define NSENDFILESYSCODE \ 7500Sstevel@tonic-gate (sizeof (sendfilevsystable) / sizeof (struct systable)) 7510Sstevel@tonic-gate 7520Sstevel@tonic-gate static const struct systable lgrpsystable[] = { 7530Sstevel@tonic-gate {"meminfo", 3, DEC, NOV, HID, NOV, MIF}, /* 0 */ 7540Sstevel@tonic-gate {"_lgrpsys", 3, DEC, NOV, DEC, DEC, NOV}, /* 1 */ 7550Sstevel@tonic-gate {"lgrp_version", 3, DEC, NOV, HID, DEC, NOV}, /* 2 */ 7560Sstevel@tonic-gate {"_lgrpsys", 3, DEC, NOV, DEC, HEX, HEX}, /* 3 */ 7570Sstevel@tonic-gate {"lgrp_affinity_get", 3, DEC, NOV, HID, NOV, LAF}, /* 4 */ 7580Sstevel@tonic-gate {"lgrp_affinity_set", 3, DEC, NOV, HID, NOV, LAF}, /* 5 */ 7590Sstevel@tonic-gate {"lgrp_latency", 3, DEC, NOV, HID, DEC, DEC}, /* 6 */ 7600Sstevel@tonic-gate }; 7610Sstevel@tonic-gate #define NLGRPSYSCODE (sizeof (lgrpsystable) / sizeof (struct systable)) 7620Sstevel@tonic-gate 7630Sstevel@tonic-gate static const struct systable rusagesystable[] = { 7640Sstevel@tonic-gate {"getrusage", 2, DEC, NOV, HID, HEX}, /* 0 */ 7650Sstevel@tonic-gate {"getrusage_chld", 2, DEC, NOV, HID, HEX}, /* 1 */ 7660Sstevel@tonic-gate {"getrusage_lwp", 2, DEC, NOV, HID, HEX}, /* 2 */ 7673247Sgjelinek {"getvmusage", 5, DEC, NOV, HID, HEX, DEC, HEX, HEX}, /* 3 */ 7680Sstevel@tonic-gate }; 7690Sstevel@tonic-gate #define NRUSAGESYSCODE \ 7700Sstevel@tonic-gate (sizeof (rusagesystable) / sizeof (struct systable)) 7710Sstevel@tonic-gate 7720Sstevel@tonic-gate static const struct systable ucredsystable[] = { 7730Sstevel@tonic-gate {"ucred_get", 3, DEC, NOV, HID, DEC, HEX}, 7740Sstevel@tonic-gate {"getpeerucred", 3, DEC, NOV, HID, DEC, HEX}, 7750Sstevel@tonic-gate }; 7760Sstevel@tonic-gate #define NUCREDSYSCODE \ 7770Sstevel@tonic-gate (sizeof (ucredsystable) / sizeof (struct systable)) 7780Sstevel@tonic-gate 7790Sstevel@tonic-gate const struct systable portfstable[] = { 7800Sstevel@tonic-gate {"port_create", 2, DEC, NOV, HID, DEC}, /* 0 */ 7810Sstevel@tonic-gate {"port_associate", 6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX}, /* 1 */ 7820Sstevel@tonic-gate {"port_dissociate", 4, DEC, NOV, HID, DEC, DEC, HEX}, /* 2 */ 7830Sstevel@tonic-gate {"port_send", 4, DEC, NOV, HID, DEC, HEX, HEX}, /* 3 */ 7840Sstevel@tonic-gate {"port_sendn", 6, DEC, DEC, HID, HEX, HEX, DEC, HEX, HEX}, /* 4 */ 7850Sstevel@tonic-gate {"port_get", 4, DEC, NOV, HID, DEC, HEX, HEX}, /* 5 */ 7860Sstevel@tonic-gate {"port_getn", 6, DEC, DEC, HID, DEC, HEX, DEC, DEC, HEX}, /* 6 */ 7870Sstevel@tonic-gate {"port_alert", 5, DEC, NOV, HID, DEC, HEX, HEX, HEX}, /* 7 */ 7880Sstevel@tonic-gate {"port_dispatch", 6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX}, /* 8 */ 7890Sstevel@tonic-gate }; 7900Sstevel@tonic-gate #define NPORTCODE (sizeof (portfstable) / sizeof (struct systable)) 7910Sstevel@tonic-gate 7920Sstevel@tonic-gate static const struct systable zonetable[] = { 793813Sdp {"zone_create", 2, DEC, NOV, HID, HEX}, /* 0 */ 7940Sstevel@tonic-gate {"zone_destroy", 2, DEC, NOV, HID, DEC}, /* 1 */ 7950Sstevel@tonic-gate {"zone_getattr", 5, DEC, NOV, HID, DEC, ZGA, HEX, DEC}, /* 2 */ 7960Sstevel@tonic-gate {"zone_enter", 2, DEC, NOV, HID, DEC}, /* 3 */ 7970Sstevel@tonic-gate {"zone_list", 3, DEC, NOV, HID, HEX, HEX}, /* 4 */ 7980Sstevel@tonic-gate {"zone_shutdown", 2, DEC, NOV, HID, DEC}, /* 5 */ 7993235Sraf {"zone_lookup", 2, DEC, NOV, HID, STG}, /* 6 */ 8003235Sraf {"zone_boot", 2, DEC, NOV, HID, DEC}, /* 7 */ 801813Sdp {"zone_version", 2, HEX, NOV, HID, DEC}, /* 8 */ 8022267Sdp {"zone_setattr", 5, DEC, NOV, HID, DEC, ZGA, HEX, DEC}, /* 9 */ 8033448Sdh155122 {"zone_add_datalink", 3, DEC, NOV, HID, DEC, STG}, /* 10 */ 8043448Sdh155122 {"zone_remove_datalink", 3, DEC, NOV, HID, DEC, STG}, /* 11 */ 8053448Sdh155122 {"zone_check_datalink", 3, DEC, NOV, HID, HEX, STG}, /* 12 */ 8063448Sdh155122 {"zone_list_datalink", 4, DEC, NOV, HID, DEC, HEX, HEX}, /* 13 */ 8070Sstevel@tonic-gate }; 8080Sstevel@tonic-gate #define NZONECODE (sizeof (zonetable) / sizeof (struct systable)) 8090Sstevel@tonic-gate 8101676Sjpk static const struct systable labeltable[] = { 8113235Sraf {"labelsys", 3, DEC, NOV, HID, HEX, HEX}, /* 0 */ 8121676Sjpk {"is_system_labeled", 1, DEC, NOV, HID}, /* 1 */ 8133235Sraf {"tnrh", 3, DEC, NOV, HID, TND, HEX}, /* 2 */ 8143235Sraf {"tnrhtp", 3, DEC, NOV, HID, TND, HEX}, /* 3 */ 8153235Sraf {"tnmlp", 3, DEC, NOV, HID, TND, HEX}, /* 4 */ 8163235Sraf {"getlabel", 3, DEC, NOV, HID, STG, HEX}, /* 5 */ 8173235Sraf {"fgetlabel", 3, DEC, NOV, HID, DEC, HEX}, /* 6 */ 8181676Sjpk }; 8191676Sjpk #define NLABELCODE (sizeof (labeltable) / sizeof (struct systable)) 8201676Sjpk 8213235Sraf const struct systable forktable[] = { 8223235Sraf /* parent codes */ 8233235Sraf {"forkx", 2, DEC, NOV, HID, FXF}, /* 0 */ 8243235Sraf {"forkallx", 2, DEC, NOV, HID, FXF}, /* 1 */ 8253235Sraf {"vforkx", 2, DEC, NOV, HID, FXF}, /* 2 */ 8263235Sraf /* child codes */ 8273235Sraf {"forkx", 0, DEC, NOV}, /* 3 */ 8283235Sraf {"forkallx", 0, DEC, NOV}, /* 4 */ 8293235Sraf {"vforkx", 0, DEC, NOV}, /* 5 */ 8303235Sraf }; 8313235Sraf #define NFORKCODE (sizeof (forktable) / sizeof (struct systable)) 8323235Sraf 8334321Scasper const struct systable sidsystable[] = { 8344321Scasper {"allocids", 4, UNS, UNS, HID, DEC, DEC, DEC}, /* 0 */ 8354321Scasper {"idmap_reg", 2, DEC, NOV, HID, DEC}, /* 1 */ 8364321Scasper {"idmap_unreg", 2, DEC, NOV, HID, DEC}, /* 2 */ 8374321Scasper }; 8384321Scasper #define NSIDSYSCODE (sizeof (sidsystable) / sizeof (struct systable)) 8394321Scasper 84010440SRoger.Faulkner@Sun.COM const struct systable utimesystable[] = { 84110440SRoger.Faulkner@Sun.COM {"futimens", 3, DEC, NOV, HID, DEC, HEX}, /* 0 */ 84210440SRoger.Faulkner@Sun.COM {"utimensat", 5, DEC, NOV, HID, ATC, STG, HEX, UTF}, /* 1 */ 84310440SRoger.Faulkner@Sun.COM }; 84410440SRoger.Faulkner@Sun.COM #define NUTIMESYSCODE (sizeof (utimesystable) / sizeof (struct systable)) 84510440SRoger.Faulkner@Sun.COM 8460Sstevel@tonic-gate const struct sysalias sysalias[] = { 8470Sstevel@tonic-gate { "exit", SYS_exit }, 8483235Sraf { "fork", SYS_forksys }, 8493235Sraf { "forkx", SYS_forksys }, 8503235Sraf { "forkallx", SYS_forksys }, 8513235Sraf { "vforkx", SYS_forksys }, 8520Sstevel@tonic-gate { "sbrk", SYS_brk }, 8530Sstevel@tonic-gate { "getppid", SYS_getpid }, 8540Sstevel@tonic-gate { "geteuid", SYS_getuid }, 8550Sstevel@tonic-gate { "getpgrp", SYS_pgrpsys }, 8560Sstevel@tonic-gate { "setpgrp", SYS_pgrpsys }, 8570Sstevel@tonic-gate { "getsid", SYS_pgrpsys }, 8580Sstevel@tonic-gate { "setsid", SYS_pgrpsys }, 8590Sstevel@tonic-gate { "getpgid", SYS_pgrpsys }, 8600Sstevel@tonic-gate { "setpgid", SYS_pgrpsys }, 8610Sstevel@tonic-gate { "getegid", SYS_getgid }, 8620Sstevel@tonic-gate { "sigset", SYS_signal }, 8630Sstevel@tonic-gate { "sighold", SYS_signal }, 8640Sstevel@tonic-gate { "sigrelse", SYS_signal }, 8650Sstevel@tonic-gate { "sigignore", SYS_signal }, 8660Sstevel@tonic-gate { "sigpause", SYS_signal }, 8670Sstevel@tonic-gate { "msgget", SYS_msgsys }, 8680Sstevel@tonic-gate { "msgctl", SYS_msgsys }, 8690Sstevel@tonic-gate { "msgctl64", SYS_msgsys }, 8700Sstevel@tonic-gate { "msgrcv", SYS_msgsys }, 8710Sstevel@tonic-gate { "msgsnd", SYS_msgsys }, 8720Sstevel@tonic-gate { "msgids", SYS_msgsys }, 8730Sstevel@tonic-gate { "msgsnap", SYS_msgsys }, 8740Sstevel@tonic-gate { "msgop", SYS_msgsys }, 8750Sstevel@tonic-gate { "shmat", SYS_shmsys }, 8760Sstevel@tonic-gate { "shmctl", SYS_shmsys }, 8770Sstevel@tonic-gate { "shmctl64", SYS_shmsys }, 8780Sstevel@tonic-gate { "shmdt", SYS_shmsys }, 8790Sstevel@tonic-gate { "shmget", SYS_shmsys }, 8800Sstevel@tonic-gate { "shmids", SYS_shmsys }, 8810Sstevel@tonic-gate { "shmop", SYS_shmsys }, 8820Sstevel@tonic-gate { "semctl", SYS_semsys }, 8830Sstevel@tonic-gate { "semctl64", SYS_semsys }, 8840Sstevel@tonic-gate { "semget", SYS_semsys }, 8850Sstevel@tonic-gate { "semids", SYS_semsys }, 8860Sstevel@tonic-gate { "semop", SYS_semsys }, 8870Sstevel@tonic-gate { "semtimedop", SYS_semsys }, 8880Sstevel@tonic-gate { "uname", SYS_utssys }, 8890Sstevel@tonic-gate { "ustat", SYS_utssys }, 8900Sstevel@tonic-gate { "fusers", SYS_utssys }, 8910Sstevel@tonic-gate { "exec", SYS_execve }, 8920Sstevel@tonic-gate { "execl", SYS_execve }, 8930Sstevel@tonic-gate { "execv", SYS_execve }, 8940Sstevel@tonic-gate { "execle", SYS_execve }, 8950Sstevel@tonic-gate { "execlp", SYS_execve }, 8960Sstevel@tonic-gate { "execvp", SYS_execve }, 8970Sstevel@tonic-gate { "sigfillset", SYS_sigpending }, 8980Sstevel@tonic-gate { "getcontext", SYS_context }, 8990Sstevel@tonic-gate { "setcontext", SYS_context }, 9000Sstevel@tonic-gate { "getustack", SYS_context }, 9010Sstevel@tonic-gate { "setustack", SYS_context }, 9020Sstevel@tonic-gate { "hrtcntl", SYS_hrtsys }, 9030Sstevel@tonic-gate { "hrtalarm", SYS_hrtsys }, 9040Sstevel@tonic-gate { "hrtsleep", SYS_hrtsys }, 9050Sstevel@tonic-gate { "hrtcancel", SYS_hrtsys }, 9060Sstevel@tonic-gate { "aioread", SYS_kaio }, 9070Sstevel@tonic-gate { "aiowrite", SYS_kaio }, 9080Sstevel@tonic-gate { "aiowait", SYS_kaio }, 9090Sstevel@tonic-gate { "aiocancel", SYS_kaio }, 9100Sstevel@tonic-gate { "aionotify", SYS_kaio }, 9110Sstevel@tonic-gate { "audit", SYS_auditsys }, 9120Sstevel@tonic-gate { "door_create", SYS_door }, 9130Sstevel@tonic-gate { "door_revoke", SYS_door }, 9140Sstevel@tonic-gate { "door_info", SYS_door }, 9150Sstevel@tonic-gate { "door_call", SYS_door }, 9160Sstevel@tonic-gate { "door_return", SYS_door }, 9170Sstevel@tonic-gate { "door_bind", SYS_door }, 9180Sstevel@tonic-gate { "door_unbind", SYS_door }, 9190Sstevel@tonic-gate { "door_unref", SYS_door }, 9200Sstevel@tonic-gate { "door_ucred", SYS_door }, 9210Sstevel@tonic-gate { "door_getparam", SYS_door }, 9220Sstevel@tonic-gate { "door_setparam", SYS_door }, 9230Sstevel@tonic-gate { "pset_create", SYS_pset }, 9240Sstevel@tonic-gate { "pset_destroy", SYS_pset }, 9250Sstevel@tonic-gate { "pset_assign", SYS_pset }, 9260Sstevel@tonic-gate { "pset_info", SYS_pset }, 9270Sstevel@tonic-gate { "pset_bind", SYS_pset }, 9280Sstevel@tonic-gate { "pset_getloadavg", SYS_pset }, 9290Sstevel@tonic-gate { "pset_list", SYS_pset }, 9300Sstevel@tonic-gate { "pset_setattr", SYS_pset }, 9310Sstevel@tonic-gate { "pset_getattr", SYS_pset }, 9320Sstevel@tonic-gate { "pset_assign_forced", SYS_pset }, 9330Sstevel@tonic-gate { "settaskid", SYS_tasksys }, 9340Sstevel@tonic-gate { "gettaskid", SYS_tasksys }, 9350Sstevel@tonic-gate { "getprojid", SYS_tasksys }, 9360Sstevel@tonic-gate { "setppriv", SYS_privsys }, 9370Sstevel@tonic-gate { "getppriv", SYS_privsys }, 9380Sstevel@tonic-gate { "getprivimplinfo", SYS_privsys }, 9390Sstevel@tonic-gate { "setpflags", SYS_privsys }, 9400Sstevel@tonic-gate { "getpflags", SYS_privsys }, 9410Sstevel@tonic-gate { "getacct", SYS_exacctsys }, 9420Sstevel@tonic-gate { "putacct", SYS_exacctsys }, 9430Sstevel@tonic-gate { "wracct", SYS_exacctsys }, 9440Sstevel@tonic-gate { "lwp_cond_timedwait", SYS_lwp_cond_wait }, 9450Sstevel@tonic-gate { "lwp_park", SYS_lwp_park }, 9460Sstevel@tonic-gate { "lwp_unpark", SYS_lwp_park }, 9470Sstevel@tonic-gate { "lwp_unpark_all", SYS_lwp_park }, 9480Sstevel@tonic-gate { "lwp_rwlock_rdlock", SYS_lwp_rwlock_sys }, 9490Sstevel@tonic-gate { "lwp_rwlock_wrlock", SYS_lwp_rwlock_sys }, 9500Sstevel@tonic-gate { "lwp_rwlock_tryrdlock", SYS_lwp_rwlock_sys }, 9510Sstevel@tonic-gate { "lwp_rwlock_trywrlock", SYS_lwp_rwlock_sys }, 9520Sstevel@tonic-gate { "lwp_rwlock_unlock", SYS_lwp_rwlock_sys }, 9530Sstevel@tonic-gate { "sendfilev64", SYS_sendfilev }, 9540Sstevel@tonic-gate { "openat", SYS_fsat }, 9550Sstevel@tonic-gate { "openat64", SYS_fsat }, 9560Sstevel@tonic-gate { "fstatat64", SYS_fsat }, 9570Sstevel@tonic-gate { "fstatat", SYS_fsat }, 9580Sstevel@tonic-gate { "fchownat", SYS_fsat }, 9590Sstevel@tonic-gate { "unlinkat", SYS_fsat }, 9600Sstevel@tonic-gate { "futimesat", SYS_fsat }, 9610Sstevel@tonic-gate { "renameat", SYS_fsat }, 9629880SSumanth.Naropanth@Sun.COM { "faccessat", SYS_fsat }, 9635331Samw { "__openattrdirat", SYS_fsat }, 9640Sstevel@tonic-gate { "lgrpsys", SYS_lgrpsys }, 9650Sstevel@tonic-gate { "getrusage", SYS_rusagesys }, 9660Sstevel@tonic-gate { "getrusage_chld", SYS_rusagesys }, 9670Sstevel@tonic-gate { "getrusage_lwp", SYS_rusagesys }, 9683247Sgjelinek { "getvmusage", SYS_rusagesys }, 9690Sstevel@tonic-gate { "getpeerucred", SYS_ucredsys }, 9700Sstevel@tonic-gate { "ucred_get", SYS_ucredsys }, 9710Sstevel@tonic-gate { "port_create", SYS_port }, 9720Sstevel@tonic-gate { "port_associate", SYS_port }, 9730Sstevel@tonic-gate { "port_dissociate", SYS_port }, 9740Sstevel@tonic-gate { "port_send", SYS_port }, 9750Sstevel@tonic-gate { "port_sendn", SYS_port }, 9760Sstevel@tonic-gate { "port_get", SYS_port }, 9770Sstevel@tonic-gate { "port_getn", SYS_port }, 9780Sstevel@tonic-gate { "port_alert", SYS_port }, 9790Sstevel@tonic-gate { "port_dispatch", SYS_port }, 9800Sstevel@tonic-gate { "zone_create", SYS_zone }, 9810Sstevel@tonic-gate { "zone_destroy", SYS_zone }, 9820Sstevel@tonic-gate { "zone_getattr", SYS_zone }, 9833247Sgjelinek { "zone_setattr", SYS_zone }, 9840Sstevel@tonic-gate { "zone_enter", SYS_zone }, 9850Sstevel@tonic-gate { "getzoneid", SYS_zone }, 9860Sstevel@tonic-gate { "zone_list", SYS_zone }, 9870Sstevel@tonic-gate { "zone_shutdown", SYS_zone }, 9883448Sdh155122 { "zone_add_datalink", SYS_zone }, 9893448Sdh155122 { "zone_remove_datalink", SYS_zone }, 9903448Sdh155122 { "zone_check_datalink", SYS_zone }, 9913448Sdh155122 { "zone_list_datalink", SYS_zone }, 9921676Sjpk { "is_system_labeled", SYS_labelsys }, 9931676Sjpk { "tnrh", SYS_labelsys }, 9941676Sjpk { "tnrhtp", SYS_labelsys }, 9951676Sjpk { "tnmlp", SYS_labelsys }, 9961676Sjpk { "getlabel", SYS_labelsys }, 9971676Sjpk { "fgetlabel", SYS_labelsys }, 9982447Snf202958 { "getrctl", SYS_rctlsys }, 9992447Snf202958 { "setrctl", SYS_rctlsys }, 10002447Snf202958 { "rctlsys_lst", SYS_rctlsys }, 10012447Snf202958 { "rctlsys_ctl", SYS_rctlsys }, 10024321Scasper { "allocids", SYS_sidsys }, 100310440SRoger.Faulkner@Sun.COM { "futimens", SYS_utimesys }, 100410440SRoger.Faulkner@Sun.COM { "utimensat", SYS_utimesys }, 10050Sstevel@tonic-gate { NULL, 0 } /* end-of-list */ 10060Sstevel@tonic-gate }; 10070Sstevel@tonic-gate 10080Sstevel@tonic-gate /* 10090Sstevel@tonic-gate * Return structure to interpret system call with sub-codes. 10100Sstevel@tonic-gate */ 10110Sstevel@tonic-gate const struct systable * 10120Sstevel@tonic-gate subsys(int syscall, int subcode) 10130Sstevel@tonic-gate { 10140Sstevel@tonic-gate const struct systable *stp = NULL; 10150Sstevel@tonic-gate 10160Sstevel@tonic-gate if (subcode != -1) { 10170Sstevel@tonic-gate switch (syscall) { 10180Sstevel@tonic-gate case SYS_open: 10190Sstevel@tonic-gate if ((unsigned)subcode < NOPENCODE) 10200Sstevel@tonic-gate stp = &opentable[subcode]; 10210Sstevel@tonic-gate break; 10220Sstevel@tonic-gate case SYS_open64: 10230Sstevel@tonic-gate if ((unsigned)subcode < NOPEN64CODE) 10240Sstevel@tonic-gate stp = &open64table[subcode]; 10250Sstevel@tonic-gate break; 10260Sstevel@tonic-gate case SYS_signal: /* signal() + sigset() family */ 10270Sstevel@tonic-gate if ((unsigned)subcode < NSIGCODE) 10280Sstevel@tonic-gate stp = &sigtable[subcode]; 10290Sstevel@tonic-gate break; 10300Sstevel@tonic-gate case SYS_msgsys: /* msgsys() */ 10310Sstevel@tonic-gate if ((unsigned)subcode < NMSGCODE) 10320Sstevel@tonic-gate stp = &msgtable[subcode]; 10330Sstevel@tonic-gate break; 10340Sstevel@tonic-gate case SYS_semsys: /* semsys() */ 10350Sstevel@tonic-gate if ((unsigned)subcode < NSEMCODE) 10360Sstevel@tonic-gate stp = &semtable[subcode]; 10370Sstevel@tonic-gate break; 10380Sstevel@tonic-gate case SYS_shmsys: /* shmsys() */ 10390Sstevel@tonic-gate if ((unsigned)subcode < NSHMCODE) 10400Sstevel@tonic-gate stp = &shmtable[subcode]; 10410Sstevel@tonic-gate break; 10420Sstevel@tonic-gate case SYS_pgrpsys: /* pgrpsys() */ 10430Sstevel@tonic-gate if ((unsigned)subcode < NPIDCODE) 10440Sstevel@tonic-gate stp = &pidtable[subcode]; 10450Sstevel@tonic-gate break; 10460Sstevel@tonic-gate case SYS_utssys: /* utssys() */ 10470Sstevel@tonic-gate if ((unsigned)subcode < NUTSCODE) 10480Sstevel@tonic-gate stp = &utstable[subcode]; 10490Sstevel@tonic-gate break; 10500Sstevel@tonic-gate case SYS_sysfs: /* sysfs() */ 10510Sstevel@tonic-gate if ((unsigned)subcode < NSFSCODE) 10520Sstevel@tonic-gate stp = &sfstable[subcode]; 10530Sstevel@tonic-gate break; 10540Sstevel@tonic-gate case SYS_sigpending: /* sigpending()/sigfillset() */ 10550Sstevel@tonic-gate if ((unsigned)subcode < NSGPCODE) 10560Sstevel@tonic-gate stp = &sgptable[subcode]; 10570Sstevel@tonic-gate break; 10580Sstevel@tonic-gate case SYS_context: /* [get|set]context() */ 10590Sstevel@tonic-gate if ((unsigned)subcode < NCTXCODE) 10600Sstevel@tonic-gate stp = &ctxtable[subcode]; 10610Sstevel@tonic-gate break; 10620Sstevel@tonic-gate case SYS_hrtsys: /* hrtsys() */ 10630Sstevel@tonic-gate if ((unsigned)subcode < NHRTCODE) 10640Sstevel@tonic-gate stp = &hrttable[subcode]; 10650Sstevel@tonic-gate break; 10660Sstevel@tonic-gate case SYS_corectl: /* corectl() */ 10670Sstevel@tonic-gate if ((unsigned)subcode < NCORCODE) 10680Sstevel@tonic-gate stp = &cortable[subcode]; 10690Sstevel@tonic-gate break; 10700Sstevel@tonic-gate case SYS_kaio: /* kaio() */ 10710Sstevel@tonic-gate if ((unsigned)subcode < NAIOCODE) 10720Sstevel@tonic-gate stp = &aiotable[subcode]; 10730Sstevel@tonic-gate break; 10740Sstevel@tonic-gate case SYS_door: /* doors */ 10750Sstevel@tonic-gate if ((unsigned)subcode < NDOORCODE) 10760Sstevel@tonic-gate stp = &doortable[subcode]; 10770Sstevel@tonic-gate break; 10780Sstevel@tonic-gate case SYS_pset: /* pset() */ 10790Sstevel@tonic-gate if ((unsigned)subcode < NPSETCODE) 10800Sstevel@tonic-gate stp = &psettable[subcode]; 10810Sstevel@tonic-gate break; 10820Sstevel@tonic-gate case SYS_lwp_create: /* lwp_create() */ 10830Sstevel@tonic-gate if ((unsigned)subcode < NLWPCREATECODE) 10840Sstevel@tonic-gate stp = &lwpcreatetable[subcode]; 10850Sstevel@tonic-gate break; 10860Sstevel@tonic-gate case SYS_tasksys: /* tasks */ 10870Sstevel@tonic-gate if ((unsigned)subcode < NTASKSYSCODE) 10880Sstevel@tonic-gate stp = &tasksystable[subcode]; 10890Sstevel@tonic-gate break; 10900Sstevel@tonic-gate case SYS_exacctsys: /* exacct */ 10910Sstevel@tonic-gate if ((unsigned)subcode < NEXACCTSYSCODE) 10920Sstevel@tonic-gate stp = &exacctsystable[subcode]; 10930Sstevel@tonic-gate break; 10940Sstevel@tonic-gate case SYS_fsat: 10950Sstevel@tonic-gate if ((unsigned)subcode < NFSATSYSCODE) 10960Sstevel@tonic-gate stp = &fsatsystable[subcode]; 10970Sstevel@tonic-gate break; 10980Sstevel@tonic-gate case SYS_privsys: /* privileges */ 10990Sstevel@tonic-gate if ((unsigned)subcode < NPRIVSYSCODE) 11000Sstevel@tonic-gate stp = &privsystable[subcode]; 11010Sstevel@tonic-gate break; 11020Sstevel@tonic-gate case SYS_lwp_park: /* lwp_park */ 11030Sstevel@tonic-gate if ((unsigned)subcode < NLWPPARKCODE) 11040Sstevel@tonic-gate stp = &lwpparktable[subcode]; 11050Sstevel@tonic-gate break; 11060Sstevel@tonic-gate case SYS_lwp_rwlock_sys: 11070Sstevel@tonic-gate if ((unsigned)subcode < NLWPRWLOCKCODE) 11080Sstevel@tonic-gate stp = &lwprwlocktable[subcode]; 11090Sstevel@tonic-gate break; 11100Sstevel@tonic-gate case SYS_sendfilev: /* sendfilev */ 11110Sstevel@tonic-gate if ((unsigned)subcode < NSENDFILESYSCODE) 11120Sstevel@tonic-gate stp = &sendfilevsystable[subcode]; 11130Sstevel@tonic-gate break; 11140Sstevel@tonic-gate case SYS_lgrpsys: /* lgrpsys */ 11150Sstevel@tonic-gate if ((unsigned)subcode < NLGRPSYSCODE) 11160Sstevel@tonic-gate stp = &lgrpsystable[subcode]; 11170Sstevel@tonic-gate break; 11180Sstevel@tonic-gate case SYS_rusagesys: /* rusagesys */ 11190Sstevel@tonic-gate if ((unsigned)subcode < NRUSAGESYSCODE) 11200Sstevel@tonic-gate stp = &rusagesystable[subcode]; 11210Sstevel@tonic-gate break; 11220Sstevel@tonic-gate case SYS_fcntl: /* fcntl */ 11230Sstevel@tonic-gate if ((unsigned)subcode < NFCNTLCODE) 11240Sstevel@tonic-gate stp = &fcntltable[subcode]; 11250Sstevel@tonic-gate break; 11260Sstevel@tonic-gate case SYS_ucredsys: 11270Sstevel@tonic-gate if ((unsigned)subcode < NUCREDSYSCODE) 11280Sstevel@tonic-gate stp = &ucredsystable[subcode]; 11290Sstevel@tonic-gate break; 11300Sstevel@tonic-gate case SYS_port: /* portfs */ 11310Sstevel@tonic-gate if ((unsigned)subcode < NPORTCODE) 11320Sstevel@tonic-gate stp = &portfstable[subcode]; 11330Sstevel@tonic-gate break; 11340Sstevel@tonic-gate case SYS_zone: /* zone family */ 11350Sstevel@tonic-gate if ((unsigned)subcode < NZONECODE) 11360Sstevel@tonic-gate stp = &zonetable[subcode]; 11370Sstevel@tonic-gate break; 11381676Sjpk case SYS_labelsys: /* label family */ 11391676Sjpk if ((unsigned)subcode < NLABELCODE) 11401676Sjpk stp = &labeltable[subcode]; 11411676Sjpk break; 11422447Snf202958 case SYS_rctlsys: /* rctl family */ 11432447Snf202958 if ((unsigned)subcode < NRCTLCODE) 11442447Snf202958 stp = &rctltable[subcode]; 11452447Snf202958 break; 11463235Sraf case SYS_forksys: /* fork family */ 11473235Sraf if ((unsigned)subcode < NFORKCODE) 11483235Sraf stp = &forktable[subcode]; 11493235Sraf break; 11504321Scasper case SYS_sidsys: /* SID family */ 11514321Scasper if ((unsigned)subcode < NSIDSYSCODE) 11524321Scasper stp = &sidsystable[subcode]; 11534321Scasper break; 115410440SRoger.Faulkner@Sun.COM case SYS_utimesys: /* utime family */ 115510440SRoger.Faulkner@Sun.COM if ((unsigned)subcode < NUTIMESYSCODE) 115610440SRoger.Faulkner@Sun.COM stp = &utimesystable[subcode]; 115710440SRoger.Faulkner@Sun.COM break; 11580Sstevel@tonic-gate } 11590Sstevel@tonic-gate } 11600Sstevel@tonic-gate 11610Sstevel@tonic-gate if (stp == NULL) 11620Sstevel@tonic-gate stp = &systable[((unsigned)syscall < SYSEND)? syscall : 0]; 11630Sstevel@tonic-gate 11640Sstevel@tonic-gate return (stp); 11650Sstevel@tonic-gate } 11660Sstevel@tonic-gate 11670Sstevel@tonic-gate /* 11680Sstevel@tonic-gate * Return the name of the system call. 11690Sstevel@tonic-gate */ 11700Sstevel@tonic-gate const char * 11710Sstevel@tonic-gate sysname(private_t *pri, int syscall, int subcode) 11720Sstevel@tonic-gate { 11730Sstevel@tonic-gate const struct systable *stp = subsys(syscall, subcode); 11740Sstevel@tonic-gate const char *name = stp->name; /* may be NULL */ 11750Sstevel@tonic-gate 11760Sstevel@tonic-gate if (name == NULL) { /* manufacture a name */ 11770Sstevel@tonic-gate (void) sprintf(pri->sys_name, "sys#%d", syscall); 11780Sstevel@tonic-gate name = pri->sys_name; 11790Sstevel@tonic-gate } 11800Sstevel@tonic-gate 11810Sstevel@tonic-gate return (name); 11820Sstevel@tonic-gate } 11830Sstevel@tonic-gate 11840Sstevel@tonic-gate /* 11850Sstevel@tonic-gate * Return the name of the signal. 11860Sstevel@tonic-gate * Return NULL if unknown signal. 11870Sstevel@tonic-gate */ 11880Sstevel@tonic-gate const char * 11890Sstevel@tonic-gate rawsigname(private_t *pri, int sig) 11900Sstevel@tonic-gate { 11910Sstevel@tonic-gate /* 11920Sstevel@tonic-gate * The C library function sig2str() omits the leading "SIG". 11930Sstevel@tonic-gate */ 11940Sstevel@tonic-gate (void) strcpy(pri->raw_sig_name, "SIG"); 11950Sstevel@tonic-gate 11960Sstevel@tonic-gate if (sig > 0 && sig2str(sig, pri->raw_sig_name+3) == 0) 11970Sstevel@tonic-gate return (pri->raw_sig_name); 11980Sstevel@tonic-gate return (NULL); 11990Sstevel@tonic-gate } 12000Sstevel@tonic-gate 12010Sstevel@tonic-gate /* 12020Sstevel@tonic-gate * Return the name of the signal. 12030Sstevel@tonic-gate * Manufacture a name for unknown signal. 12040Sstevel@tonic-gate */ 12050Sstevel@tonic-gate const char * 12060Sstevel@tonic-gate signame(private_t *pri, int sig) 12070Sstevel@tonic-gate { 12080Sstevel@tonic-gate const char *name = rawsigname(pri, sig); 12090Sstevel@tonic-gate 12100Sstevel@tonic-gate if (name == NULL) { /* manufacture a name */ 12110Sstevel@tonic-gate (void) sprintf(pri->sig_name, "SIG#%d", sig); 12120Sstevel@tonic-gate name = pri->sig_name; 12130Sstevel@tonic-gate } 12140Sstevel@tonic-gate 12150Sstevel@tonic-gate return (name); 12160Sstevel@tonic-gate } 12170Sstevel@tonic-gate 12180Sstevel@tonic-gate /* 12190Sstevel@tonic-gate * Determine the subcode for this syscall, if any. 12200Sstevel@tonic-gate */ 12210Sstevel@tonic-gate int 12220Sstevel@tonic-gate getsubcode(private_t *pri) 12230Sstevel@tonic-gate { 12240Sstevel@tonic-gate const lwpstatus_t *Lsp = pri->lwpstat; 12250Sstevel@tonic-gate int syscall = Lsp->pr_syscall; 12260Sstevel@tonic-gate int nsysarg = Lsp->pr_nsysarg; 12270Sstevel@tonic-gate int subcode = -1; 12280Sstevel@tonic-gate int arg0; 12290Sstevel@tonic-gate 12300Sstevel@tonic-gate if (syscall > 0 && nsysarg > 0) { 12310Sstevel@tonic-gate arg0 = Lsp->pr_sysarg[0]; 12320Sstevel@tonic-gate switch (syscall) { 12330Sstevel@tonic-gate case SYS_utssys: /* utssys() */ 12340Sstevel@tonic-gate if (nsysarg > 2) 12350Sstevel@tonic-gate subcode = Lsp->pr_sysarg[2]; 12360Sstevel@tonic-gate break; 12370Sstevel@tonic-gate case SYS_open: /* open() w/ and w/o O_CREAT */ 12380Sstevel@tonic-gate case SYS_open64: 12390Sstevel@tonic-gate if (nsysarg > 1) 12400Sstevel@tonic-gate subcode = (Lsp->pr_sysarg[1] & O_CREAT)? 1 : 0; 12410Sstevel@tonic-gate break; 12420Sstevel@tonic-gate case SYS_fsat: 12430Sstevel@tonic-gate switch (arg0) { 12440Sstevel@tonic-gate case 0: /* openat */ 12450Sstevel@tonic-gate if (nsysarg > 3) 12460Sstevel@tonic-gate subcode = 12470Sstevel@tonic-gate (Lsp->pr_sysarg[3] & O_CREAT) ? 12483855Ssn199410 0 : NFSATSYSCODE - 2; 12490Sstevel@tonic-gate break; 12500Sstevel@tonic-gate case 1: /* openat64 */ 12510Sstevel@tonic-gate if (nsysarg > 3) 12520Sstevel@tonic-gate subcode = 12530Sstevel@tonic-gate (Lsp->pr_sysarg[3] & O_CREAT) ? 12543855Ssn199410 1 : NFSATSYSCODE - 1; 12550Sstevel@tonic-gate break; 12560Sstevel@tonic-gate case 2: 12570Sstevel@tonic-gate case 3: 12580Sstevel@tonic-gate case 4: 12590Sstevel@tonic-gate case 5: 12600Sstevel@tonic-gate case 6: 12610Sstevel@tonic-gate case 7: 12623855Ssn199410 case 8: 12635331Samw case 9: 12640Sstevel@tonic-gate subcode = arg0; 12650Sstevel@tonic-gate } 12660Sstevel@tonic-gate break; 12670Sstevel@tonic-gate case SYS_signal: /* signal() + sigset() family */ 12680Sstevel@tonic-gate switch (arg0 & ~SIGNO_MASK) { 12690Sstevel@tonic-gate default: subcode = 0; break; 12700Sstevel@tonic-gate case SIGDEFER: subcode = 1; break; 12710Sstevel@tonic-gate case SIGHOLD: subcode = 2; break; 12720Sstevel@tonic-gate case SIGRELSE: subcode = 3; break; 12730Sstevel@tonic-gate case SIGIGNORE: subcode = 4; break; 12740Sstevel@tonic-gate case SIGPAUSE: subcode = 5; break; 12750Sstevel@tonic-gate } 12760Sstevel@tonic-gate break; 12770Sstevel@tonic-gate case SYS_kaio: /* kaio() */ 12780Sstevel@tonic-gate subcode = arg0 & ~AIO_POLL_BIT; 12790Sstevel@tonic-gate break; 12800Sstevel@tonic-gate case SYS_door: /* doors */ 12810Sstevel@tonic-gate if (nsysarg > 5) 12820Sstevel@tonic-gate subcode = Lsp->pr_sysarg[5]; 12830Sstevel@tonic-gate break; 12840Sstevel@tonic-gate case SYS_lwp_create: /* lwp_create() */ 12850Sstevel@tonic-gate subcode = /* 0 for parent, 1 for child */ 12862267Sdp (Lsp->pr_why == PR_SYSEXIT && Lsp->pr_errno == 0 && 12872267Sdp Lsp->pr_rval1 == 0); 12880Sstevel@tonic-gate break; 12893235Sraf case SYS_forksys: /* forksys */ 12903235Sraf subcode = arg0; 12913235Sraf if (Lsp->pr_why == PR_SYSEXIT && Lsp->pr_errno == 0 && 12923235Sraf pri->Rval2 != 0) /* this is the child */ 12933235Sraf subcode += 3; 12943235Sraf break; 12950Sstevel@tonic-gate case SYS_msgsys: /* msgsys() */ 12960Sstevel@tonic-gate case SYS_semsys: /* semsys() */ 12970Sstevel@tonic-gate case SYS_shmsys: /* shmsys() */ 12980Sstevel@tonic-gate case SYS_pgrpsys: /* pgrpsys() */ 12990Sstevel@tonic-gate case SYS_sysfs: /* sysfs() */ 13000Sstevel@tonic-gate case SYS_sigpending: /* sigpending()/sigfillset() */ 13010Sstevel@tonic-gate case SYS_context: /* [get|set]context() */ 13020Sstevel@tonic-gate case SYS_hrtsys: /* hrtsys() */ 13030Sstevel@tonic-gate case SYS_corectl: /* corectl() */ 13040Sstevel@tonic-gate case SYS_pset: /* pset() */ 13050Sstevel@tonic-gate case SYS_tasksys: /* tasks */ 13060Sstevel@tonic-gate case SYS_privsys: /* privileges */ 13070Sstevel@tonic-gate case SYS_exacctsys: /* exacct */ 13080Sstevel@tonic-gate case SYS_lwp_park: /* lwp_park */ 13090Sstevel@tonic-gate case SYS_lwp_rwlock_sys: /* lwp_rwlock_*() */ 13100Sstevel@tonic-gate case SYS_sendfilev: /* sendfilev */ 13110Sstevel@tonic-gate case SYS_lgrpsys: /* lgrpsys */ 13120Sstevel@tonic-gate case SYS_rusagesys: /* rusagesys */ 13130Sstevel@tonic-gate case SYS_ucredsys: /* ucredsys */ 13140Sstevel@tonic-gate case SYS_zone: /* zone */ 13151676Sjpk case SYS_labelsys: /* labelsys */ 13162447Snf202958 case SYS_rctlsys: /* rctlsys */ 13174321Scasper case SYS_sidsys: /* sidsys */ 131810440SRoger.Faulkner@Sun.COM case SYS_utimesys: /* utimesys */ 13190Sstevel@tonic-gate subcode = arg0; 13200Sstevel@tonic-gate break; 13210Sstevel@tonic-gate case SYS_fcntl: /* fcntl() */ 13220Sstevel@tonic-gate if (nsysarg > 2) { 13230Sstevel@tonic-gate switch (Lsp->pr_sysarg[1]) { 13240Sstevel@tonic-gate default: subcode = 0; break; 13250Sstevel@tonic-gate case F_GETFL: 13260Sstevel@tonic-gate case F_GETOWN: 13270Sstevel@tonic-gate case F_GETXFL: subcode = 1; break; 13280Sstevel@tonic-gate case F_SETFL: subcode = 2; break; 13290Sstevel@tonic-gate } 13300Sstevel@tonic-gate } 13310Sstevel@tonic-gate break; 13320Sstevel@tonic-gate case SYS_port: /* portfs */ 13330Sstevel@tonic-gate subcode = arg0 & PORT_CODE_MASK; 13340Sstevel@tonic-gate break; 13350Sstevel@tonic-gate } 13360Sstevel@tonic-gate } 13370Sstevel@tonic-gate 13380Sstevel@tonic-gate return (subcode); 13390Sstevel@tonic-gate } 13400Sstevel@tonic-gate 13410Sstevel@tonic-gate /* 13420Sstevel@tonic-gate * Return the maximum number of system calls, counting 13430Sstevel@tonic-gate * all system calls with subcodes as separate calls. 13440Sstevel@tonic-gate */ 13450Sstevel@tonic-gate int 13460Sstevel@tonic-gate maxsyscalls() 13470Sstevel@tonic-gate { 13480Sstevel@tonic-gate return (PRMAXSYS + 1 13492267Sdp + NOPENCODE - 1 13502267Sdp + NOPEN64CODE - 1 13512267Sdp + NSIGCODE - 1 13522267Sdp + NMSGCODE - 1 13532267Sdp + NSEMCODE - 1 13542267Sdp + NSHMCODE - 1 13552267Sdp + NPIDCODE - 1 13562267Sdp + NSFSCODE - 1 13572267Sdp + NUTSCODE - 1 13582267Sdp + NSGPCODE - 1 13592267Sdp + NCTXCODE - 1 13602267Sdp + NHRTCODE - 1 13612267Sdp + NCORCODE - 1 13622267Sdp + NAIOCODE - 1 13632267Sdp + NDOORCODE - 1 13642267Sdp + NPSETCODE - 1 13652267Sdp + NLWPCREATECODE - 1 13662267Sdp + NTASKSYSCODE - 1 13672267Sdp + NEXACCTSYSCODE - 1 13682267Sdp + NFSATSYSCODE - 1 13692267Sdp + NLWPPARKCODE - 1 13702267Sdp + NLWPRWLOCKCODE - 1 13712267Sdp + NSENDFILESYSCODE - 1 13722267Sdp + NLGRPSYSCODE - 1 13732267Sdp + NRUSAGESYSCODE - 1 13742267Sdp + NFCNTLCODE - 1 13752267Sdp + NPRIVSYSCODE - 1 13762267Sdp + NUCREDSYSCODE - 1 13772267Sdp + NPORTCODE - 1 13782267Sdp + NZONECODE - 1 13792447Snf202958 + NLABELCODE - 1 13803235Sraf + NRCTLCODE - 1 13814321Scasper + NFORKCODE - 1 138210440SRoger.Faulkner@Sun.COM + NSIDSYSCODE - 1 138310440SRoger.Faulkner@Sun.COM + NUTIMESYSCODE - 1); 13840Sstevel@tonic-gate } 13850Sstevel@tonic-gate 13860Sstevel@tonic-gate /* 13870Sstevel@tonic-gate * Return the number of subcodes for the specified system call number. 13880Sstevel@tonic-gate */ 13890Sstevel@tonic-gate int 13900Sstevel@tonic-gate nsubcodes(int syscall) 13910Sstevel@tonic-gate { 13920Sstevel@tonic-gate switch (syscall) { 13930Sstevel@tonic-gate case SYS_open: 13940Sstevel@tonic-gate return (NOPENCODE); 13950Sstevel@tonic-gate case SYS_open64: 13960Sstevel@tonic-gate return (NOPEN64CODE); 13970Sstevel@tonic-gate case SYS_signal: /* signal() + sigset() family */ 13980Sstevel@tonic-gate return (NSIGCODE); 13990Sstevel@tonic-gate case SYS_msgsys: /* msgsys() */ 14000Sstevel@tonic-gate return (NMSGCODE); 14010Sstevel@tonic-gate case SYS_semsys: /* semsys() */ 14020Sstevel@tonic-gate return (NSEMCODE); 14030Sstevel@tonic-gate case SYS_shmsys: /* shmsys() */ 14040Sstevel@tonic-gate return (NSHMCODE); 14050Sstevel@tonic-gate case SYS_pgrpsys: /* pgrpsys() */ 14060Sstevel@tonic-gate return (NPIDCODE); 14070Sstevel@tonic-gate case SYS_utssys: /* utssys() */ 14080Sstevel@tonic-gate return (NUTSCODE); 14090Sstevel@tonic-gate case SYS_sysfs: /* sysfs() */ 14100Sstevel@tonic-gate return (NSFSCODE); 14110Sstevel@tonic-gate case SYS_sigpending: /* sigpending()/sigfillset() */ 14120Sstevel@tonic-gate return (NSGPCODE); 14130Sstevel@tonic-gate case SYS_context: /* [get|set]context() */ 14140Sstevel@tonic-gate return (NCTXCODE); 14150Sstevel@tonic-gate case SYS_hrtsys: /* hrtsys() */ 14160Sstevel@tonic-gate return (NHRTCODE); 14170Sstevel@tonic-gate case SYS_corectl: /* corectl() */ 14180Sstevel@tonic-gate return (NCORCODE); 14190Sstevel@tonic-gate case SYS_kaio: /* kaio() */ 14200Sstevel@tonic-gate return (NAIOCODE); 14210Sstevel@tonic-gate case SYS_door: /* doors */ 14220Sstevel@tonic-gate return (NDOORCODE); 14230Sstevel@tonic-gate case SYS_pset: /* pset() */ 14240Sstevel@tonic-gate return (NPSETCODE); 14250Sstevel@tonic-gate case SYS_lwp_create: /* lwp_create() */ 14260Sstevel@tonic-gate return (NLWPCREATECODE); 14270Sstevel@tonic-gate case SYS_tasksys: /* tasks */ 14280Sstevel@tonic-gate return (NTASKSYSCODE); 14290Sstevel@tonic-gate case SYS_exacctsys: /* exacct */ 14300Sstevel@tonic-gate return (NEXACCTSYSCODE); 14310Sstevel@tonic-gate case SYS_fsat: 14320Sstevel@tonic-gate return (NFSATSYSCODE); 14330Sstevel@tonic-gate case SYS_privsys: /* privileges */ 14340Sstevel@tonic-gate return (NPRIVSYSCODE); 14350Sstevel@tonic-gate case SYS_lwp_park: /* lwp_park */ 14360Sstevel@tonic-gate return (NLWPPARKCODE); 14370Sstevel@tonic-gate case SYS_lwp_rwlock_sys: 14380Sstevel@tonic-gate return (NLWPRWLOCKCODE); 14390Sstevel@tonic-gate case SYS_sendfilev: /* sendfilev */ 14400Sstevel@tonic-gate return (NSENDFILESYSCODE); 14410Sstevel@tonic-gate case SYS_lgrpsys: /* lgrpsys */ 14420Sstevel@tonic-gate return (NLGRPSYSCODE); 14430Sstevel@tonic-gate case SYS_rusagesys: 14440Sstevel@tonic-gate return (NRUSAGESYSCODE); 14450Sstevel@tonic-gate case SYS_fcntl: 14460Sstevel@tonic-gate return (NFCNTLCODE); 14470Sstevel@tonic-gate case SYS_ucredsys: 14480Sstevel@tonic-gate return (NUCREDSYSCODE); 14490Sstevel@tonic-gate case SYS_port: 14500Sstevel@tonic-gate return (NPORTCODE); 14510Sstevel@tonic-gate case SYS_zone: /* zone */ 14520Sstevel@tonic-gate return (NZONECODE); 14531676Sjpk case SYS_labelsys: 14541676Sjpk return (NLABELCODE); 14552447Snf202958 case SYS_rctlsys: 14562447Snf202958 return (NRCTLCODE); 14573235Sraf case SYS_forksys: 14583235Sraf return (NFORKCODE); 14594321Scasper case SYS_sidsys: 14604321Scasper return (NSIDSYSCODE); 146110440SRoger.Faulkner@Sun.COM case SYS_utimesys: 146210440SRoger.Faulkner@Sun.COM return (NUTIMESYSCODE); 14630Sstevel@tonic-gate default: 14640Sstevel@tonic-gate return (1); 14650Sstevel@tonic-gate } 14660Sstevel@tonic-gate } 14670Sstevel@tonic-gate 14680Sstevel@tonic-gate 14690Sstevel@tonic-gate 14700Sstevel@tonic-gate /* Socket address families (and protocol families) */ 14710Sstevel@tonic-gate const char * const afcodes[] = { 14720Sstevel@tonic-gate "UNSPEC", /* 0 */ 14730Sstevel@tonic-gate "UNIX", /* 1 */ 14740Sstevel@tonic-gate "INET", /* 2 */ 14750Sstevel@tonic-gate "IMPLINK", /* 3 */ 14760Sstevel@tonic-gate "PUP", /* 4 */ 14770Sstevel@tonic-gate "CHAOS", /* 5 */ 14780Sstevel@tonic-gate "NS", /* 6 */ 14790Sstevel@tonic-gate "NBS", /* 7 */ 14800Sstevel@tonic-gate "ECMA", /* 8 */ 14810Sstevel@tonic-gate "DATAKIT", /* 9 */ 14820Sstevel@tonic-gate "CCITT", /* 10 */ 14830Sstevel@tonic-gate "SNA", /* 11 */ 14840Sstevel@tonic-gate "DECnet", /* 12 */ 14850Sstevel@tonic-gate "DLI", /* 13 */ 14860Sstevel@tonic-gate "LAT", /* 14 */ 14870Sstevel@tonic-gate "HYLINK", /* 15 */ 14880Sstevel@tonic-gate "APPLETALK", /* 16 */ 14890Sstevel@tonic-gate "NIT", /* 17 */ 14900Sstevel@tonic-gate "802", /* 18 */ 14910Sstevel@tonic-gate "OSI", /* 19 */ 14920Sstevel@tonic-gate "X25", /* 20 */ 14930Sstevel@tonic-gate "OSINET", /* 21 */ 14940Sstevel@tonic-gate "GOSIP", /* 22 */ 14950Sstevel@tonic-gate "IPX", /* 23 */ 14960Sstevel@tonic-gate "ROUTE", /* 24 */ 14970Sstevel@tonic-gate "LINK", /* 25 */ 14980Sstevel@tonic-gate "INET6", /* 26 */ 14990Sstevel@tonic-gate "KEY", /* 27 */ 15000Sstevel@tonic-gate "NCA", /* 28 */ 15013302Sagiri "POLICY", /* 29 */ 1502*10491SRishi.Srivatsavai@Sun.COM "RDS", /* 30 */ 1503*10491SRishi.Srivatsavai@Sun.COM "TRILL" /* 31 */ 15040Sstevel@tonic-gate }; 1505*10491SRishi.Srivatsavai@Sun.COM #if MAX_AFCODES != 32 15060Sstevel@tonic-gate #error Need to update address-family table 15070Sstevel@tonic-gate #endif 15080Sstevel@tonic-gate 15090Sstevel@tonic-gate 15100Sstevel@tonic-gate const char * const socktype_codes[] = { /* cf socket.h */ 15110Sstevel@tonic-gate NULL, 15120Sstevel@tonic-gate "SOCK_DGRAM", /* 1 */ 15130Sstevel@tonic-gate "SOCK_STREAM", /* 2 */ 15140Sstevel@tonic-gate NULL, 15150Sstevel@tonic-gate "SOCK_RAW", /* 4 */ 15160Sstevel@tonic-gate "SOCK_RDM", /* 5 */ 15170Sstevel@tonic-gate "SOCK_SEQPACKET" /* 6 */ 15180Sstevel@tonic-gate }; 15190Sstevel@tonic-gate #if MAX_SOCKTYPES != 7 15200Sstevel@tonic-gate #error Need to update socket-type table 15210Sstevel@tonic-gate #endif 1522