dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / truss / systable.c
blob104d4d81fc40b1a588936012ca66057ab45f87ca
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2015, Joyent, Inc. All rights reserved.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
30 /* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
32 #include <stdio.h>
33 #include <stdlib.h>
34 #include <fcntl.h>
35 #include <unistd.h>
36 #include <string.h>
37 #include <signal.h>
38 #include <sys/types.h>
39 #include <libproc.h>
40 #include <sys/aio.h>
41 #include <sys/port_impl.h>
42 #include "ramdata.h"
43 #include "systable.h"
44 #include "print.h"
45 #include "proto.h"
48 * Tables of information about system calls - read-only data.
51 const char *const errcode[] = { /* error code names */
52 NULL, /* 0 */
53 "EPERM", /* 1 */
54 "ENOENT", /* 2 */
55 "ESRCH", /* 3 */
56 "EINTR", /* 4 */
57 "EIO", /* 5 */
58 "ENXIO", /* 6 */
59 "E2BIG", /* 7 */
60 "ENOEXEC", /* 8 */
61 "EBADF", /* 9 */
62 "ECHILD", /* 10 */
63 "EAGAIN", /* 11 */
64 "ENOMEM", /* 12 */
65 "EACCES", /* 13 */
66 "EFAULT", /* 14 */
67 "ENOTBLK", /* 15 */
68 "EBUSY", /* 16 */
69 "EEXIST", /* 17 */
70 "EXDEV", /* 18 */
71 "ENODEV", /* 19 */
72 "ENOTDIR", /* 20 */
73 "EISDIR", /* 21 */
74 "EINVAL", /* 22 */
75 "ENFILE", /* 23 */
76 "EMFILE", /* 24 */
77 "ENOTTY", /* 25 */
78 "ETXTBSY", /* 26 */
79 "EFBIG", /* 27 */
80 "ENOSPC", /* 28 */
81 "ESPIPE", /* 29 */
82 "EROFS", /* 30 */
83 "EMLINK", /* 31 */
84 "EPIPE", /* 32 */
85 "EDOM", /* 33 */
86 "ERANGE", /* 34 */
87 "ENOMSG", /* 35 */
88 "EIDRM", /* 36 */
89 "ECHRNG", /* 37 */
90 "EL2NSYNC", /* 38 */
91 "EL3HLT", /* 39 */
92 "EL3RST", /* 40 */
93 "ELNRNG", /* 41 */
94 "EUNATCH", /* 42 */
95 "ENOCSI", /* 43 */
96 "EL2HLT", /* 44 */
97 "EDEADLK", /* 45 */
98 "ENOLCK", /* 46 */
99 "ECANCELED", /* 47 */
100 "ENOTSUP", /* 48 */
101 "EDQUOT", /* 49 */
102 "EBADE", /* 50 */
103 "EBADR", /* 51 */
104 "EXFULL", /* 52 */
105 "ENOANO", /* 53 */
106 "EBADRQC", /* 54 */
107 "EBADSLT", /* 55 */
108 "EDEADLOCK", /* 56 */
109 "EBFONT", /* 57 */
110 "EOWNERDEAD", /* 58 */
111 "ENOTRECOVERABLE", /* 59 */
112 "ENOSTR", /* 60 */
113 "ENODATA", /* 61 */
114 "ETIME", /* 62 */
115 "ENOSR", /* 63 */
116 "ENONET", /* 64 */
117 "ENOPKG", /* 65 */
118 "EREMOTE", /* 66 */
119 "ENOLINK", /* 67 */
120 "EADV", /* 68 */
121 "ESRMNT", /* 69 */
122 "ECOMM", /* 70 */
123 "EPROTO", /* 71 */
124 "ELOCKUNMAPPED", /* 72 */
125 "ENOTACTIVE", /* 73 */
126 "EMULTIHOP", /* 74 */
127 NULL, /* 75 */
128 NULL, /* 76 */
129 "EBADMSG", /* 77 */
130 "ENAMETOOLONG", /* 78 */
131 "EOVERFLOW", /* 79 */
132 "ENOTUNIQ", /* 80 */
133 "EBADFD", /* 81 */
134 "EREMCHG", /* 82 */
135 "ELIBACC", /* 83 */
136 "ELIBBAD", /* 84 */
137 "ELIBSCN", /* 85 */
138 "ELIBMAX", /* 86 */
139 "ELIBEXEC", /* 87 */
140 "EILSEQ", /* 88 */
141 "ENOSYS", /* 89 */
142 "ELOOP", /* 90 */
143 "ERESTART", /* 91 */
144 "ESTRPIPE", /* 92 */
145 "ENOTEMPTY", /* 93 */
146 "EUSERS", /* 94 */
147 "ENOTSOCK", /* 95 */
148 "EDESTADDRREQ", /* 96 */
149 "EMSGSIZE", /* 97 */
150 "EPROTOTYPE", /* 98 */
151 "ENOPROTOOPT", /* 99 */
152 NULL, /* 100 */
153 NULL, /* 101 */
154 NULL, /* 102 */
155 NULL, /* 103 */
156 NULL, /* 104 */
157 NULL, /* 105 */
158 NULL, /* 106 */
159 NULL, /* 107 */
160 NULL, /* 108 */
161 NULL, /* 109 */
162 NULL, /* 110 */
163 NULL, /* 111 */
164 NULL, /* 112 */
165 NULL, /* 113 */
166 NULL, /* 114 */
167 NULL, /* 115 */
168 NULL, /* 116 */
169 NULL, /* 117 */
170 NULL, /* 118 */
171 NULL, /* 119 */
172 "EPROTONOSUPPORT", /* 120 */
173 "ESOCKTNOSUPPORT", /* 121 */
174 "EOPNOTSUPP", /* 122 */
175 "EPFNOSUPPORT", /* 123 */
176 "EAFNOSUPPORT", /* 124 */
177 "EADDRINUSE", /* 125 */
178 "EADDRNOTAVAIL", /* 126 */
179 "ENETDOWN", /* 127 */
180 "ENETUNREACH", /* 128 */
181 "ENETRESET", /* 129 */
182 "ECONNABORTED", /* 130 */
183 "ECONNRESET", /* 131 */
184 "ENOBUFS", /* 132 */
185 "EISCONN", /* 133 */
186 "ENOTCONN", /* 134 */
187 NULL, /* 135 */
188 NULL, /* 136 */
189 NULL, /* 137 */
190 NULL, /* 138 */
191 NULL, /* 139 */
192 NULL, /* 140 */
193 NULL, /* 141 */
194 NULL, /* 142 */
195 "ESHUTDOWN", /* 143 */
196 "ETOOMANYREFS", /* 144 */
197 "ETIMEDOUT", /* 145 */
198 "ECONNREFUSED", /* 146 */
199 "EHOSTDOWN", /* 147 */
200 "EHOSTUNREACH", /* 148 */
201 "EALREADY", /* 149 */
202 "EINPROGRESS", /* 150 */
203 "ESTALE" /* 151 */
206 #define NERRCODE (sizeof (errcode) / sizeof (char *))
209 const char *
210 errname(int err) /* return the error code name (NULL if none) */
212 const char *ename = NULL;
214 if (err >= 0 && err < NERRCODE)
215 ename = errcode[err];
217 return (ename);
221 const struct systable systable[] = {
222 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
223 {"_exit", 1, DEC, NOV, DEC}, /* 1 */
224 {"psecflags", 3, DEC, NOV, HEX, PSFW, PSDLT}, /* 2 */
225 {"read", 3, DEC, NOV, DEC, IOB, UNS}, /* 3 */
226 {"write", 3, DEC, NOV, DEC, IOB, UNS}, /* 4 */
227 {"open", 3, DEC, NOV, STG, OPN, OCT}, /* 5 */
228 {"close", 1, DEC, NOV, DEC}, /* 6 */
229 {"linkat", 5, DEC, NOV, ATC, STG, ATC, STG, SNF}, /* 7 */
230 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
231 {"link", 2, DEC, NOV, STG, STG}, /* 9 */
232 {"unlink", 1, DEC, NOV, STG}, /* 10 */
233 {"symlinkat", 3, DEC, NOV, STG, ATC, STG}, /* 11 */
234 {"chdir", 1, DEC, NOV, STG}, /* 12 */
235 {"time", 0, DEC, NOV}, /* 13 */
236 {"mknod", 3, DEC, NOV, STG, OCT, HEX}, /* 14 */
237 {"chmod", 2, DEC, NOV, STG, OCT}, /* 15 */
238 {"chown", 3, DEC, NOV, STG, DEC, DEC}, /* 16 */
239 {"brk", 1, DEC, NOV, HEX}, /* 17 */
240 {"stat", 2, DEC, NOV, STG, HEX}, /* 18 */
241 {"lseek", 3, DEC, NOV, DEC, DEX, WHN}, /* 19 */
242 {"getpid", 0, DEC, DEC}, /* 20 */
243 {"mount", 8, DEC, NOV, STG, STG, MTF, MFT, HEX, DEC, HEX, DEC}, /* 21 */
244 {"readlinkat", 4, DEC, NOV, ATC, STG, RLK, UNS}, /* 22 */
245 {"setuid", 1, DEC, NOV, UNS}, /* 23 */
246 {"getuid", 0, UNS, UNS}, /* 24 */
247 {"stime", 1, DEC, NOV, DEC}, /* 25 */
248 {"pcsample", 2, DEC, NOV, HEX, DEC}, /* 26 */
249 {"alarm", 1, DEC, NOV, UNS}, /* 27 */
250 {"fstat", 2, DEC, NOV, DEC, HEX}, /* 28 */
251 {"pause", 0, DEC, NOV}, /* 29 */
252 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
253 {"stty", 2, DEC, NOV, DEC, DEC}, /* 31 */
254 {"gtty", 2, DEC, NOV, DEC, DEC}, /* 32 */
255 {"access", 2, DEC, NOV, STG, ACC}, /* 33 */
256 {"nice", 1, DEC, NOV, DEC}, /* 34 */
257 {"statfs", 4, DEC, NOV, STG, HEX, DEC, DEC}, /* 35 */
258 {"sync", 0, DEC, NOV}, /* 36 */
259 {"kill", 2, DEC, NOV, DEC, SIG}, /* 37 */
260 {"fstatfs", 4, DEC, NOV, DEC, HEX, DEC, DEC}, /* 38 */
261 {"pgrpsys", 3, DEC, NOV, DEC, DEC, DEC}, /* 39 */
262 {"uucopystr", 3, DEC, NOV, STG, RST, UNS}, /* 40 */
263 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
264 {"pipe", 2, DEC, NOV, PFD, PIP}, /* 42 */
265 {"times", 1, DEC, NOV, HEX}, /* 43 */
266 {"profil", 4, DEC, NOV, HEX, UNS, HEX, OCT}, /* 44 */
267 {"faccessat", 4, DEC, NOV, ATC, STG, ACC, FAT}, /* 45 */
268 {"setgid", 1, DEC, NOV, UNS}, /* 46 */
269 {"getgid", 0, UNS, UNS}, /* 47 */
270 {"mknodat", 4, DEC, NOV, ATC, STG, OCT, HEX}, /* 48 */
271 {"msgsys", 6, DEC, NOV, DEC, DEC, DEC, DEC, DEC, DEC}, /* 49 */
272 {"sysi86", 4, HEX, NOV, S86, HEX, HEX, HEX, DEC, DEC}, /* 50 */
273 {"acct", 1, DEC, NOV, STG}, /* 51 */
274 {"shmsys", 4, DEC, NOV, DEC, HEX, HEX, HEX}, /* 52 */
275 {"semsys", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 53 */
276 {"ioctl", 3, DEC, NOV, DEC, IOC, IOA}, /* 54 */
277 {"uadmin", 3, DEC, NOV, DEC, DEC, DEC}, /* 55 */
278 {"fchownat", 5, DEC, NOV, ATC, STG, DEC, DEC, SNF}, /* 56 */
279 {"utssys", 4, DEC, NOV, HEX, DEC, UTS, HEX}, /* 57 */
280 {"fdsync", 2, DEC, NOV, DEC, FFG}, /* 58 */
281 {"execve", 3, DEC, NOV, STG, HEX, HEX}, /* 59 */
282 {"umask", 1, OCT, NOV, OCT}, /* 60 */
283 {"chroot", 1, DEC, NOV, STG}, /* 61 */
284 {"fcntl", 3, DEC, NOV, DEC, FCN, HEX}, /* 62 */
285 {"ulimit", 2, DEX, NOV, ULM, DEC}, /* 63 */
286 {"renameat", 4, DEC, NOV, ATC, STG, ATC, STG}, /* 64 */
287 {"unlinkat", 3, DEC, NOV, ATC, STG, UAT}, /* 65 */
288 {"fstatat", 4, DEC, NOV, ATC, STG, HEX, SNF}, /* 66 */
289 {"fstatat64", 4, DEC, NOV, ATC, STG, HEX, SNF}, /* 67 */
290 {"openat", 4, DEC, NOV, ATC, STG, OPN, OCT}, /* 68 */
291 {"openat64", 4, DEC, NOV, ATC, STG, OPN, OCT}, /* 69 */
292 {"tasksys", 5, DEC, NOV, DEC, DEC, DEC, HEX, DEC}, /* 70 */
293 {"acctctl", 3, DEC, NOV, HEX, HEX, UNS}, /* 71 */
294 {"exacctsys", 6, DEC, NOV, DEC, IDT, DEC, HEX, DEC, HEX}, /* 72 */
295 {"getpagesizes", 2, DEC, NOV, HEX, DEC}, /* 73 */
296 {"rctlsys", 6, DEC, NOV, RSC, STG, HEX, HEX, DEC, DEC}, /* 74 */
297 {"sidsys", 4, UNS, UNS, DEC, DEC, DEC, DEC}, /* 75 */
298 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
299 {"lwp_park", 3, DEC, NOV, DEC, HEX, DEC}, /* 77 */
300 {"sendfilev", 5, DEC, NOV, DEC, DEC, HEX, DEC, HEX}, /* 78 */
301 {"rmdir", 1, DEC, NOV, STG}, /* 79 */
302 {"mkdir", 2, DEC, NOV, STG, OCT}, /* 80 */
303 {"getdents", 3, DEC, NOV, DEC, HEX, UNS}, /* 81 */
304 {"privsys", 5, HEX, NOV, DEC, DEC, DEC, HEX, DEC}, /* 82 */
305 {"ucredsys", 3, DEC, NOV, DEC, DEC, HEX}, /* 83 */
306 {"sysfs", 3, DEC, NOV, SFS, DEX, DEX}, /* 84 */
307 {"getmsg", 4, DEC, NOV, DEC, HEX, HEX, HEX}, /* 85 */
308 {"putmsg", 4, DEC, NOV, DEC, HEX, HEX, SMF}, /* 86 */
309 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
310 {"lstat", 2, DEC, NOV, STG, HEX}, /* 88 */
311 {"symlink", 2, DEC, NOV, STG, STG}, /* 89 */
312 {"readlink", 3, DEC, NOV, STG, RLK, UNS}, /* 90 */
313 {"setgroups", 2, DEC, NOV, DEC, HEX}, /* 91 */
314 {"getgroups", 2, DEC, NOV, DEC, HEX}, /* 92 */
315 {"fchmod", 2, DEC, NOV, DEC, OCT}, /* 93 */
316 {"fchown", 3, DEC, NOV, DEC, DEC, DEC}, /* 94 */
317 {"sigprocmask", 3, DEC, NOV, SPM, HEX, HEX}, /* 95 */
318 {"sigsuspend", 1, DEC, NOV, HEX}, /* 96 */
319 {"sigaltstack", 2, DEC, NOV, HEX, HEX}, /* 97 */
320 {"sigaction", 3, DEC, NOV, SIG, HEX, HEX}, /* 98 */
321 {"sigpendsys", 2, DEC, NOV, DEC, HEX}, /* 99 */
322 {"context", 2, DEC, NOV, DEC, HEX}, /* 100 */
323 {"fchmodat", 4, DEC, NOV, ATC, STG, OCT, SNF}, /* 101 */
324 {"mkdirat", 3, DEC, NOV, ATC, STG, OCT}, /* 102 */
325 {"statvfs", 2, DEC, NOV, STG, HEX}, /* 103 */
326 {"fstatvfs", 2, DEC, NOV, DEC, HEX}, /* 104 */
327 {"getloadavg", 2, DEC, NOV, HEX, DEC}, /* 105 */
328 {"nfssys", 2, DEC, NOV, DEC, HEX}, /* 106 */
329 {"waitid", 4, DEC, NOV, IDT, DEC, HEX, WOP}, /* 107 */
330 {"sigsendsys", 2, DEC, NOV, HEX, SIG}, /* 108 */
331 {"hrtsys", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 109 */
332 {"utimesys", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 110 */
333 {"sigresend", 3, DEC, NOV, SIG, HEX, HEX}, /* 111 */
334 {"priocntlsys", 5, DEC, NOV, DEC, HEX, DEC, PC4, PC5}, /* 112 */
335 {"pathconf", 2, DEC, NOV, STG, PTC}, /* 113 */
336 {"mincore", 3, DEC, NOV, HEX, UNS, HEX}, /* 114 */
337 {"mmap", 6, HEX, NOV, HEX, UNS, MPR, MTY, DEC, DEC}, /* 115 */
338 {"mprotect", 3, DEC, NOV, HEX, UNS, MPR}, /* 116 */
339 {"munmap", 2, DEC, NOV, HEX, UNS}, /* 117 */
340 {"fpathconf", 2, DEC, NOV, DEC, PTC}, /* 118 */
341 {"vfork", 0, DEC, NOV}, /* 119 */
342 {"fchdir", 1, DEC, NOV, DEC}, /* 120 */
343 {"readv", 3, DEC, NOV, DEC, HEX, DEC}, /* 121 */
344 {"writev", 3, DEC, NOV, DEC, HEX, DEC}, /* 122 */
345 {"preadv", 4, DEC, NOV, DEC, HEX, DEC, DEC}, /* 123 */
346 {"pwritev", 4, DEC, NOV, DEC, HEX, DEC, DEC}, /* 124 */
347 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
348 {"getrandom", 3, DEC, NOV, IOB, UNS, GRF}, /* 126 */
349 {"mmapobj", 5, DEC, NOV, DEC, MOB, HEX, HEX, HEX}, /* 127 */
350 {"setrlimit", 2, DEC, NOV, RLM, HEX}, /* 128 */
351 {"getrlimit", 2, DEC, NOV, RLM, HEX}, /* 129 */
352 {"lchown", 3, DEC, NOV, STG, DEC, DEC}, /* 130 */
353 {"memcntl", 6, DEC, NOV, HEX, UNS, MCF, MC4, MC5, DEC}, /* 131 */
354 {"getpmsg", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 132 */
355 {"putpmsg", 5, DEC, NOV, DEC, HEX, HEX, DEC, HHX}, /* 133 */
356 {"rename", 2, DEC, NOV, STG, STG}, /* 134 */
357 {"uname", 1, DEC, NOV, HEX}, /* 135 */
358 {"setegid", 1, DEC, NOV, UNS}, /* 136 */
359 {"sysconfig", 1, DEC, NOV, CNF}, /* 137 */
360 {"adjtime", 2, DEC, NOV, HEX, HEX}, /* 138 */
361 {"sysinfo", 3, DEC, NOV, INF, RST, DEC}, /* 139 */
362 {"sharefs", 3, DEC, NOV, DEC, HEX, DEC}, /* 140 */
363 {"seteuid", 1, DEC, NOV, UNS}, /* 141 */
364 {"forksys", 2, DEC, NOV, DEC, HHX}, /* 142 */
365 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
366 {"sigtimedwait", 3, DEC, NOV, HEX, HEX, HEX}, /* 144 */
367 {"lwp_info", 1, DEC, NOV, HEX}, /* 145 */
368 {"yield", 0, DEC, NOV}, /* 146 */
369 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
370 {"lwp_sema_post", 1, DEC, NOV, HEX}, /* 148 */
371 {"lwp_sema_trywait", 1, DEC, NOV, HEX}, /* 149 */
372 {"lwp_detach", 1, DEC, NOV, DEC}, /* 150 */
373 {"corectl", 4, DEC, NOV, DEC, HEX, HEX, HEX}, /* 151 */
374 {"modctl", 5, DEC, NOV, MOD, HEX, HEX, HEX, HEX}, /* 152 */
375 {"fchroot", 1, DEC, NOV, DEC}, /* 153 */
376 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
377 {"vhangup", 0, DEC, NOV}, /* 155 */
378 {"gettimeofday", 1, DEC, NOV, HEX}, /* 156 */
379 {"getitimer", 2, DEC, NOV, ITM, HEX}, /* 157 */
380 {"setitimer", 3, DEC, NOV, ITM, HEX, HEX}, /* 158 */
381 {"lwp_create", 3, DEC, NOV, HEX, LWF, HEX}, /* 159 */
382 {"lwp_exit", 0, DEC, NOV}, /* 160 */
383 {"lwp_suspend", 1, DEC, NOV, DEC}, /* 161 */
384 {"lwp_continue", 1, DEC, NOV, DEC}, /* 162 */
385 {"lwp_kill", 2, DEC, NOV, DEC, SIG}, /* 163 */
386 {"lwp_self", 0, DEC, NOV}, /* 164 */
387 {"lwp_sigmask", 5, HEX, HEX, SPM, HEX, HEX, HEX, HEX}, /* 165 */
388 {"lwp_private", 3, HEX, NOV, DEC, DEC, HEX}, /* 166 */
389 {"lwp_wait", 2, DEC, NOV, DEC, HEX}, /* 167 */
390 {"lwp_mutex_wakeup", 2, DEC, NOV, HEX, DEC}, /* 168 */
391 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
392 {"lwp_cond_wait", 4, DEC, NOV, HEX, HEX, HEX, DEC}, /* 170 */
393 {"lwp_cond_signal", 1, DEC, NOV, HEX}, /* 171 */
394 {"lwp_cond_broadcast", 1, DEC, NOV, HEX}, /* 172 */
395 {"pread", 4, DEC, NOV, DEC, IOB, UNS, DEX}, /* 173 */
396 {"pwrite", 4, DEC, NOV, DEC, IOB, UNS, DEX}, /* 174 */
397 {"llseek", 4, LLO, NOV, DEC, LLO, HID, WHN}, /* 175 */
398 {"inst_sync", 2, DEC, NOV, STG, DEC}, /* 176 */
399 {"brand", 6, DEC, NOV, DEC, HEX, HEX, HEX, HEX, HEX}, /* 177 */
400 {"kaio", 7, DEC, NOV, AIO, HEX, HEX, HEX, HEX, HEX, HEX}, /* 178 */
401 {"cpc", 5, DEC, NOV, CPC, DEC, HEX, HEX, HEX}, /* 179 */
402 {"lgrpsys", 3, DEC, NOV, DEC, DEC, HEX}, /* 180 */
403 {"rusagesys", 5, DEC, NOV, DEC, HEX, DEC, HEX, HEX}, /* 181 */
404 {"portfs", 6, HEX, HEX, DEC, HEX, HEX, HEX, HEX, HEX}, /* 182 */
405 {"pollsys", 4, DEC, NOV, HEX, DEC, HEX, HEX}, /* 183 */
406 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
407 {"acl", 4, DEC, NOV, STG, ACL, DEC, HEX}, /* 185 */
408 {"auditsys", 4, DEC, NOV, AUD, HEX, HEX, HEX}, /* 186 */
409 {"processor_bind", 4, DEC, NOV, IDT, DEC, DEC, HEX}, /* 187 */
410 {"processor_info", 2, DEC, NOV, DEC, HEX}, /* 188 */
411 {"p_online", 2, DEC, NOV, DEC, DEC}, /* 189 */
412 {"sigqueue", 5, DEC, NOV, DEC, SIG, HEX, SQC, DEC}, /* 190 */
413 {"clock_gettime", 2, DEC, NOV, DEC, HEX}, /* 191 */
414 {"clock_settime", 2, DEC, NOV, DEC, HEX}, /* 192 */
415 {"clock_getres", 2, DEC, NOV, DEC, HEX}, /* 193 */
416 {"timer_create", 3, DEC, NOV, DEC, HEX, HEX}, /* 194 */
417 {"timer_delete", 1, DEC, NOV, DEC}, /* 195 */
418 {"timer_settime", 4, DEC, NOV, DEC, DEC, HEX, HEX}, /* 196 */
419 {"timer_gettime", 2, DEC, NOV, DEC, HEX}, /* 197 */
420 {"timer_getoverrun", 1, DEC, NOV, DEC}, /* 198 */
421 {"nanosleep", 2, DEC, NOV, HEX, HEX}, /* 199 */
422 {"facl", 4, DEC, NOV, DEC, ACL, DEC, HEX}, /* 200 */
423 {"door", 6, DEC, NOV, DEC, HEX, HEX, HEX, HEX, DEC}, /* 201 */
424 {"setreuid", 2, DEC, NOV, UN1, UN1}, /* 202 */
425 {"setregid", 2, DEC, NOV, UN1, UN1}, /* 203 */
426 {"install_utrap", 3, DEC, NOV, DEC, HEX, HEX}, /* 204 */
427 {"signotify", 3, DEC, NOV, DEC, HEX, HEX}, /* 205 */
428 {"schedctl", 0, HEX, NOV}, /* 206 */
429 {"pset", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 207 */
430 {"sparc_utrap_install", 5, DEC, NOV, UTT, UTH, UTH, HEX, HEX}, /* 208 */
431 {"resolvepath", 3, DEC, NOV, STG, RLK, DEC}, /* 209 */
432 {"lwp_mutex_timedlock", 3, DEC, NOV, HEX, HEX, HEX}, /* 210 */
433 {"lwp_sema_timedwait", 3, DEC, NOV, HEX, HEX, DEC}, /* 211 */
434 {"lwp_rwlock_sys", 3, DEC, NOV, DEC, HEX, HEX}, /* 212 */
435 {"getdents64", 3, DEC, NOV, DEC, HEX, UNS}, /* 213 */
436 {"mmap64", 7, HEX, NOV, HEX, UNS, MPR, MTY, DEC, LLO, HID}, /* 214 */
437 {"stat64", 2, DEC, NOV, STG, HEX}, /* 215 */
438 {"lstat64", 2, DEC, NOV, STG, HEX}, /* 216 */
439 {"fstat64", 2, DEC, NOV, DEC, HEX}, /* 217 */
440 {"statvfs64", 2, DEC, NOV, STG, HEX}, /* 218 */
441 {"fstatvfs64", 2, DEC, NOV, DEC, HEX}, /* 219 */
442 {"setrlimit64", 2, DEC, NOV, RLM, HEX}, /* 220 */
443 {"getrlimit64", 2, DEC, NOV, RLM, HEX}, /* 221 */
444 {"pread64", 5, DEC, NOV, DEC, IOB, UNS, LLO, HID}, /* 222 */
445 {"pwrite64", 5, DEC, NOV, DEC, IOB, UNS, LLO, HID}, /* 223 */
446 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
447 {"open64", 3, DEC, NOV, STG, OPN, OCT}, /* 225 */
448 {"rpcmod", 3, DEC, NOV, DEC, HEX}, /* 226 */
449 {"zone", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 227 */
450 {"autofssys", 2, DEC, NOV, DEC, HEX}, /* 228 */
451 {"getcwd", 3, DEC, NOV, RST, DEC}, /* 229 */
452 {"so_socket", 5, DEC, NOV, PFM, SKT, SKP, STG, SKV}, /* 230 */
453 {"so_socketpair", 1, DEC, NOV, HEX}, /* 231 */
454 {"bind", 4, DEC, NOV, DEC, HEX, DEC, SKV}, /* 232 */
455 {"listen", 3, DEC, NOV, DEC, DEC, SKV}, /* 233 */
456 {"accept", 5, DEC, NOV, DEC, HEX, HEX, SKV, ACF}, /* 234 */
457 {"connect", 4, DEC, NOV, DEC, HEX, DEC, SKV}, /* 235 */
458 {"shutdown", 3, DEC, NOV, DEC, SHT, SKV}, /* 236 */
459 {"recv", 4, DEC, NOV, DEC, IOB, DEC, DEC}, /* 237 */
460 {"recvfrom", 6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, HEX}, /* 238 */
461 {"recvmsg", 3, DEC, NOV, DEC, HEX, DEC}, /* 239 */
462 {"send", 4, DEC, NOV, DEC, IOB, DEC, DEC}, /* 240 */
463 {"sendmsg", 3, DEC, NOV, DEC, HEX, DEC}, /* 241 */
464 {"sendto", 6, DEC, NOV, DEC, IOB, DEC, DEC, HEX, DEC}, /* 242 */
465 {"getpeername", 4, DEC, NOV, DEC, HEX, HEX, SKV}, /* 243 */
466 {"getsockname", 4, DEC, NOV, DEC, HEX, HEX, SKV}, /* 244 */
467 {"getsockopt", 6, DEC, NOV, DEC, SOL, SON, HEX, HEX, SKV}, /* 245 */
468 {"setsockopt", 6, DEC, NOV, DEC, SOL, SON, HEX, DEC, SKV}, /* 246 */
469 {"sockconfig", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 247 */
470 {"ntp_gettime", 1, DEC, NOV, HEX}, /* 248 */
471 {"ntp_adjtime", 1, DEC, NOV, HEX}, /* 249 */
472 {"lwp_mutex_unlock", 1, DEC, NOV, HEX}, /* 250 */
473 {"lwp_mutex_trylock", 2, DEC, NOV, HEX, HEX}, /* 251 */
474 {"lwp_mutex_register", 2, DEC, NOV, HEX, HEX}, /* 252 */
475 { NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
476 {"uucopy", 3, DEC, NOV, HEX, HEX, UNS}, /* 254 */
477 {"umount2", 2, DEC, NOV, STG, MTF}, /* 255 */
478 { NULL, -1, DEC, NOV},
481 /* SYSEND == max syscall number + 1 */
482 #define SYSEND ((sizeof (systable) / sizeof (struct systable))-1)
486 * The following are for interpreting syscalls with sub-codes.
489 const struct systable faccessattable[] = {
490 {"faccessat", 4, DEC, NOV, ATC, STG, ACC, FAT}, /* 0 */
491 {"access", 3, DEC, NOV, HID, STG, ACC}, /* 1 */
493 #define NACCESSCODE (sizeof (faccessattable) / sizeof (struct systable))
495 const struct systable fchmodattable[] = {
496 {"fchmodat", 4, DEC, NOV, ATC, STG, OCT, SNF}, /* 0 */
497 {"chmod", 3, DEC, NOV, HID, STG, OCT}, /* 1 */
498 {"fchmodat", 4, DEC, NOV, ATC, STG, OCT, SNF}, /* 2 */
499 {"fchmod", 3, DEC, NOV, DEC, HID, OCT}, /* 3 */
501 #define NCHMODCODE (sizeof (fchmodattable) / sizeof (struct systable))
503 const struct systable fchownattable[] = {
504 {"fchownat", 5, DEC, NOV, ATC, STG, DEC, DEC, SNF}, /* 0 */
505 {"chown", 4, DEC, NOV, HID, STG, DEC, DEC}, /* 1 */
506 {"lchown", 4, DEC, NOV, HID, STG, DEC, DEC}, /* 2 */
507 {"fchown", 4, DEC, NOV, DEC, HID, DEC, DEC}, /* 3 */
509 #define NCHOWNCODE (sizeof (fchownattable) / sizeof (struct systable))
511 const struct systable mkdiratattable[] = {
512 {"mkdirat", 3, DEC, NOV, ATC, STG, OCT}, /* 0 */
513 {"mkdir", 3, DEC, NOV, HID, STG, OCT}, /* 1 */
515 #define NMKDIRCODE (sizeof (mkdiratattable) / sizeof (struct systable))
517 const struct systable mknodatattable[] = {
518 {"mknodat", 4, DEC, NOV, ATC, STG, OCT, HEX}, /* 0 */
519 {"mknod", 4, DEC, NOV, HID, STG, OCT, HEX}, /* 1 */
521 #define NMKMODCODE (sizeof (mknodatattable) / sizeof (struct systable))
523 const struct systable renameattable[] = {
524 {"renameat", 4, DEC, NOV, ATC, STG, ATC, STG}, /* 0 */
525 {"rename", 4, DEC, NOV, HID, STG, HID, STG}, /* 1 */
527 #define NRENAMECODE (sizeof (renameattable) / sizeof (struct systable))
529 const struct systable linkattable[] = {
530 {"linkat", 5, DEC, NOV, ATC, STG, ATC, STG, SNF}, /* 0 */
531 {"link", 4, DEC, NOV, HID, STG, HID, STG}, /* 1 */
533 #define NLINKATCODE (sizeof (linkattable) / sizeof (struct systable))
535 const struct systable unlinkattable[] = {
536 {"unlinkat", 3, DEC, NOV, ATC, STG, UAT}, /* 0 */
537 {"unlink", 2, DEC, NOV, HID, STG}, /* 1 */
538 {"rmdir", 2, DEC, NOV, HID, STG}, /* 2 */
540 #define NUNLINKCODE (sizeof (unlinkattable) / sizeof (struct systable))
542 const struct systable symlinkattable[] = {
543 {"symlinkat", 3, DEC, NOV, STG, ATC, STG}, /* 0 */
544 {"symlink", 3, DEC, NOV, STG, HID, STG}, /* 1 */
546 #define NSYMLINKCODE (sizeof (symlinkattable) / sizeof (struct systable))
548 const struct systable readlinkattable[] = {
549 {"readlinkat", 4, DEC, NOV, ATC, STG, RLK, UNS}, /* 0 */
550 {"readlink", 4, DEC, NOV, HID, STG, RLK, UNS}, /* 1 */
552 #define NREADLINKCODE (sizeof (readlinkattable) / sizeof (struct systable))
554 const struct systable fstatattable[] = {
555 {"fstatat", 4, DEC, NOV, ATC, STG, HEX, SNF}, /* 0 */
556 {"stat", 3, DEC, NOV, HID, STG, HEX}, /* 1 */
557 {"lstat", 3, DEC, NOV, HID, STG, HEX}, /* 2 */
558 {"fstat", 3, DEC, NOV, DEC, HID, HEX}, /* 3 */
560 #define NSTATCODE (sizeof (fstatattable) / sizeof (struct systable))
562 const struct systable fstatat64table[] = {
563 {"fstatat64", 4, DEC, NOV, ATC, STG, HEX, SNF}, /* 0 */
564 {"stat64", 3, DEC, NOV, HID, STG, HEX}, /* 1 */
565 {"lstat64", 3, DEC, NOV, HID, STG, HEX}, /* 2 */
566 {"fstat64", 3, DEC, NOV, DEC, HID, HEX}, /* 3 */
568 #define NSTAT64CODE (sizeof (fstatat64table) / sizeof (struct systable))
570 const struct systable openattable[] = {
571 {"openat", 3, DEC, NOV, ATC, STG, OPN}, /* 0 */
572 {"openat", 4, DEC, NOV, ATC, STG, OPN, OCT}, /* 1 */
573 {"open", 3, DEC, NOV, HID, STG, OPN}, /* 2 */
574 {"open", 4, DEC, NOV, HID, STG, OPN, OCT}, /* 3 */
576 #define NOPENATCODE (sizeof (openattable) / sizeof (struct systable))
578 const struct systable openat64table[] = {
579 {"openat64", 3, DEC, NOV, ATC, STG, OPN}, /* 0 */
580 {"openat64", 4, DEC, NOV, ATC, STG, OPN, OCT}, /* 1 */
581 {"open64", 3, DEC, NOV, HID, STG, OPN}, /* 2 */
582 {"open64", 4, DEC, NOV, HID, STG, OPN, OCT}, /* 3 */
584 #define NOPENAT64CODE (sizeof (openat64table) / sizeof (struct systable))
586 const struct systable opentable[] = {
587 {"open", 2, DEC, NOV, STG, OPN}, /* 0 */
588 {"open", 3, DEC, NOV, STG, OPN, OCT}, /* 1 */
590 #define NOPENCODE (sizeof (opentable) / sizeof (struct systable))
592 const struct systable open64table[] = {
593 {"open64", 2, DEC, NOV, STG, OPN}, /* 0 */
594 {"open64", 3, DEC, NOV, STG, OPN, OCT}, /* 1 */
596 #define NOPEN64CODE (sizeof (open64table) / sizeof (struct systable))
598 const struct systable fcntltable[] = {
599 {"fcntl", 3, DEC, NOV, DEC, FCN, HEX}, /* 0: default */
600 {"fcntl", 2, DEC, NOV, DEC, FCN}, /* 1: no arg */
601 {"fcntl", 3, DEC, NOV, DEC, FCN, FFG}, /* 2: F_SETFL */
603 #define NFCNTLCODE (sizeof (fcntltable) / sizeof (struct systable))
605 const struct systable msgtable[] = {
606 {"msgget", 3, DEC, NOV, HID, KEY, MSF}, /* 0 */
607 {"msgctl", 4, DEC, NOV, HID, DEC, MSC, HEX}, /* 1 */
608 {"msgrcv", 6, DEC, NOV, HID, DEC, HEX, UNS, DEC, MSF}, /* 2 */
609 {"msgsnd", 5, DEC, NOV, HID, DEC, HEX, UNS, MSF}, /* 3 */
610 {"msgids", 4, DEC, NOV, HID, HEX, UNS, HEX}, /* 4 */
611 {"msgsnap", 5, DEC, NOV, HID, DEC, HEX, UNS, DEC}, /* 5 */
613 #define NMSGCODE (sizeof (msgtable) / sizeof (struct systable))
615 const struct systable semtable[] = {
616 {"semctl", 5, DEC, NOV, HID, DEC, DEC, SMC, DEX}, /* 0 */
617 {"semget", 4, DEC, NOV, HID, KEY, DEC, SEF}, /* 1 */
618 {"semop", 4, DEC, NOV, HID, DEC, HEX, UNS}, /* 2 */
619 {"semids", 4, DEC, NOV, HID, HEX, UNS, HEX}, /* 3 */
620 {"semtimedop", 5, DEC, NOV, HID, DEC, HEX, UNS, HEX}, /* 4 */
622 #define NSEMCODE (sizeof (semtable) / sizeof (struct systable))
624 const struct systable shmtable[] = {
625 {"shmat", 4, HEX, NOV, HID, DEC, DEX, SHF}, /* 0 */
626 {"shmctl", 4, DEC, NOV, HID, DEC, SHC, DEX}, /* 1 */
627 {"shmdt", 2, DEC, NOV, HID, HEX}, /* 2 */
628 {"shmget", 4, DEC, NOV, HID, KEY, UNS, SHF}, /* 3 */
629 {"shmids", 4, DEC, NOV, HID, HEX, UNS, HEX}, /* 4 */
631 #define NSHMCODE (sizeof (shmtable) / sizeof (struct systable))
633 const struct systable pidtable[] = {
634 {"getpgrp", 1, DEC, NOV, HID}, /* 0 */
635 {"setpgrp", 1, DEC, NOV, HID}, /* 1 */
636 {"getsid", 2, DEC, NOV, HID, DEC}, /* 2 */
637 {"setsid", 1, DEC, NOV, HID}, /* 3 */
638 {"getpgid", 2, DEC, NOV, HID, DEC}, /* 4 */
639 {"setpgid", 3, DEC, NOV, HID, DEC, DEC}, /* 5 */
641 #define NPIDCODE (sizeof (pidtable) / sizeof (struct systable))
643 const struct systable sfstable[] = {
644 {"sysfs", 3, DEC, NOV, SFS, DEX, DEX}, /* 0 */
645 {"sysfs", 2, DEC, NOV, SFS, STG}, /* 1 */
646 {"sysfs", 3, DEC, NOV, SFS, DEC, RST}, /* 2 */
647 {"sysfs", 1, DEC, NOV, SFS}, /* 3 */
649 #define NSFSCODE (sizeof (sfstable) / sizeof (struct systable))
651 const struct systable utstable[] = {
652 {"utssys", 3, DEC, NOV, HEX, DEC, UTS}, /* 0 */
653 {"utssys", 4, DEC, NOV, HEX, HEX, HEX, HEX}, /* err */
654 {"utssys", 3, DEC, NOV, HEX, HHX, UTS}, /* 2 */
655 {"utssys", 4, DEC, NOV, STG, FUI, UTS, HEX} /* 3 */
657 #define NUTSCODE (sizeof (utstable) / sizeof (struct systable))
659 const struct systable rctltable[] = {
660 {"getrctl", 6, DEC, NOV, HID, STG, HEX, HEX, HID, RGF}, /* 0 */
661 {"setrctl", 6, DEC, NOV, HID, STG, HEX, HEX, HID, RSF}, /* 1 */
662 {"rctlsys_lst", 6, DEC, NOV, HID, HID, HEX, HID, HEX, HID}, /* 2 */
663 {"rctlsys_ctl", 6, DEC, NOV, HID, STG, HEX, HID, HID, RCF}, /* 3 */
664 {"setprojrctl", 6, DEC, NOV, HID, STG, HID, HEX, HEX, SPF}, /* 4 */
666 #define NRCTLCODE (sizeof (rctltable) / sizeof (struct systable))
668 const struct systable sgptable[] = {
669 {"sigpendsys", 2, DEC, NOV, DEC, HEX}, /* err */
670 {"sigpending", 2, DEC, NOV, HID, HEX}, /* 1 */
671 {"sigfillset", 2, DEC, NOV, HID, HEX}, /* 2 */
673 #define NSGPCODE (sizeof (sgptable) / sizeof (struct systable))
675 const struct systable ctxtable[] = {
676 {"getcontext", 2, DEC, NOV, HID, HEX}, /* 0 */
677 {"setcontext", 2, DEC, NOV, HID, HEX}, /* 1 */
678 {"getustack", 2, DEC, NOV, HID, HEX}, /* 2 */
679 {"setustack", 2, DEC, NOV, HID, HEX}, /* 3 */
681 #define NCTXCODE (sizeof (ctxtable) / sizeof (struct systable))
683 const struct systable hrttable[] = {
684 {"hrtcntl", 5, DEC, NOV, HID, DEC, DEC, HEX, HEX}, /* 0 */
685 {"hrtalarm", 3, DEC, NOV, HID, HEX, DEC}, /* 1 */
686 {"hrtsleep", 2, DEC, NOV, HID, HEX}, /* 2 */
687 {"hrtcancel", 3, DEC, NOV, HID, HEX, DEC}, /* 3 */
689 #define NHRTCODE (sizeof (hrttable) / sizeof (struct systable))
691 const struct systable cortable[] = {
692 {"corectl", 4, DEC, NOV, COR, HEX, HEX, HEX}, /* 0 */
693 {"corectl", 2, DEC, NOV, COR, CCO}, /* 1 */
694 {"corectl", 1, HHX, NOV, COR}, /* 2 */
695 {"corectl", 3, DEC, NOV, COR, STG, DEC}, /* 3 */
696 {"corectl", 3, DEC, NOV, COR, RST, DEC}, /* 4 */
697 {"corectl", 4, DEC, NOV, COR, STG, DEC, DEC}, /* 5 */
698 {"corectl", 4, DEC, NOV, COR, RST, DEC, DEC}, /* 6 */
699 {"corectl", 2, DEC, NOV, COR, CCC}, /* 7 */
700 {"corectl", 2, DEC, NOV, COR, RCC}, /* 8 */
701 {"corectl", 3, DEC, NOV, COR, CCC, DEC}, /* 9 */
702 {"corectl", 3, DEC, NOV, COR, RCC, DEC}, /* 10 */
703 {"corectl", 3, DEC, NOV, COR, STG, DEC}, /* 11 */
704 {"corectl", 3, DEC, NOV, COR, RST, DEC}, /* 12 */
705 {"corectl", 2, DEC, NOV, COR, CCC}, /* 13 */
706 {"corectl", 2, DEC, NOV, COR, RCC}, /* 14 */
708 #define NCORCODE (sizeof (cortable) / sizeof (struct systable))
710 const struct systable aiotable[] = {
711 {"kaio", 7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 0 */
712 {"kaio", 7, DEC, NOV, AIO, DEC, HEX, DEC, LLO, HID, HEX}, /* 1 */
713 {"kaio", 3, DEC, NOV, AIO, HEX, DEC}, /* 2 */
714 {"kaio", 3, DEC, NOV, AIO, DEC, HEX}, /* 3 */
715 {"kaio", 1, DEC, NOV, AIO}, /* 4 */
716 {"kaio", 1, DEC, NOV, AIO}, /* 5 */
717 {"kaio", 1, DEC, NOV, AIO}, /* 6 */
718 {"kaio", 5, DEC, NOV, AIO, LIO, HEX, DEC, HEX}, /* 7 */
719 {"kaio", 5, DEC, NOV, AIO, HEX, DEC, HEX, DEC}, /* 8 */
720 {"kaio", 2, DEC, NOV, AIO, HEX}, /* 9 */
721 {"kaio", 5, DEC, NOV, AIO, LIO, HEX, DEC, HEX}, /* 10 */
722 {"kaio", 2, DEC, NOV, AIO, HEX}, /* 11 */
723 {"kaio", 2, DEC, NOV, AIO, HEX}, /* 12 */
724 {"kaio", 5, DEC, NOV, AIO, LIO, HEX, DEC, HEX}, /* 13 */
725 {"kaio", 5, DEC, NOV, AIO, HEX, DEC, HEX, DEC}, /* 14 */
726 {"kaio", 2, DEC, NOV, AIO, HEX}, /* 15 */
727 {"kaio", 5, DEC, NOV, AIO, LIO, HEX, DEC, HEX}, /* 16 */
728 {"kaio", 2, DEC, NOV, AIO, HEX}, /* 17 */
729 {"kaio", 2, DEC, NOV, AIO, HEX}, /* 18 */
730 {"kaio", 3, DEC, NOV, AIO, DEC, HEX}, /* 19 */
731 {"kaio", 1, DEC, NOV, AIO}, /* 20 */
732 {"kaio", 5, DEC, NOV, AIO, HEX, DEC, HEX, HEX}, /* 21 */
734 #define NAIOCODE (sizeof (aiotable) / sizeof (struct systable))
736 const struct systable doortable[] = {
737 {"door_create", 3, DEC, NOV, HEX, HEX, DFL}, /* 0 */
738 {"door_revoke", 1, DEC, NOV, DEC}, /* 1 */
739 {"door_info", 2, DEC, NOV, DEC, HEX}, /* 2 */
740 {"door_call", 2, DEC, NOV, DEC, HEX}, /* 3 */
741 {"door_return", 4, DEC, NOV, HEX, DEC, HEX, DEC}, /* 4 (old) */
742 {"door_cred", 1, DEC, NOV, HEX}, /* 5 (old) */
743 {"door_bind", 1, DEC, NOV, DEC}, /* 6 */
744 {"door_unbind", 0, DEC, NOV}, /* 7 */
745 {"door_unref", 0, DEC, NOV}, /* 8 */
746 {"door_ucred", 1, DEC, NOV, HEX}, /* 9 */
747 {"door_return", 5, DEC, NOV, HEX, DEC, HEX, HEX, DEC}, /* 10 */
748 {"door_getparam", 3, DEC, NOV, DEC, DPM, HEX}, /* 11 */
749 {"door_setparam", 3, DEC, NOV, DEC, DPM, DEC}, /* 12 */
751 #define NDOORCODE (sizeof (doortable) / sizeof (struct systable))
753 const struct systable psettable[] = {
754 {"pset_create", 2, DEC, NOV, HID, HEX}, /* 0 */
755 {"pset_destroy", 2, DEC, NOV, HID, PST}, /* 1 */
756 {"pset_assign", 4, DEC, NOV, HID, PST, DEC, HEX}, /* 2 */
757 {"pset_info", 5, DEC, NOV, HID, PST, HEX, HEX, HEX}, /* 3 */
758 {"pset_bind", 5, DEC, NOV, HID, PST, IDT, DEC, HEX}, /* 4 */
759 {"pset_getloadavg", 4, DEC, NOV, HID, PST, HEX, DEC}, /* 5 */
760 {"pset_list", 3, DEC, NOV, HID, HEX, HEX}, /* 6 */
761 {"pset_setattr", 3, DEC, NOV, HID, PST, HEX}, /* 7 */
762 {"pset_getattr", 3, DEC, NOV, HID, PST, HEX}, /* 8 */
763 {"pset_assign_forced", 4, DEC, NOV, HID, PST, DEC, HEX}, /* 9 */
765 #define NPSETCODE (sizeof (psettable) / sizeof (struct systable))
767 const struct systable lwpcreatetable[] = {
768 {"lwp_create", 3, DEC, NOV, HEX, LWF, HEX}, /* 0 */
769 {"lwp_create", 0, DEC, NOV}, /* 1 */
771 #define NLWPCREATECODE (sizeof (lwpcreatetable) / sizeof (struct systable))
773 static const struct systable tasksystable[] = {
774 {"settaskid", 3, DEC, NOV, HID, DEC, HEX}, /* 0 */
775 {"gettaskid", 1, DEC, NOV, HID}, /* 1 */
776 {"getprojid", 1, DEC, NOV, HID}, /* 2 */
778 #define NTASKSYSCODE (sizeof (tasksystable) / sizeof (struct systable))
780 static const struct systable privsystable[] = {
781 {"setppriv", 4, DEC, NOV, HID, PRO, PRN, PRS}, /* 0 */
782 {"getppriv", 4, DEC, NOV, HID, HID, PRN, PRS}, /* 1 */
783 {"getprivimplinfo", 5, DEC, NOV, HID, HID, HID, HEX, DEC}, /* 2 */
784 {"setpflags", 3, DEC, NOV, HID, PFL, DEC}, /* 3 */
785 {"getpflags", 2, DEC, NOV, HID, PFL}, /* 4 */
786 {"issetugid", 0, DEC, NOV, HID}, /* 5 */
788 #define NPRIVSYSCODE (sizeof (privsystable) / sizeof (struct systable))
790 static const struct systable exacctsystable[] = {
791 {"getacct", 5, DEC, NOV, HID, IDT, DEC, HEX, UNS}, /* 0 */
792 {"putacct", 6, DEC, NOV, HID, IDT, DEC, HEX, UNS, HEX}, /* 1 */
793 {"wracct", 4, DEC, NOV, HID, IDT, DEC, HEX}, /* 2 */
795 #define NEXACCTSYSCODE (sizeof (exacctsystable) / sizeof (struct systable))
797 static const struct systable lwpparktable[] = {
798 {"lwp_park", 3, DEC, NOV, HID, HEX, DEC}, /* 0 */
799 {"lwp_unpark", 2, DEC, NOV, HID, DEC}, /* 1 */
800 {"lwp_unpark_all", 3, DEC, NOV, HID, HEX, DEC}, /* 2 */
801 {"lwp_unpark_cancel", 2, DEC, NOV, HID, DEC}, /* 3 */
802 {"lwp_set_park", 3, DEC, NOV, HID, HEX, DEC}, /* 4 */
804 #define NLWPPARKCODE (sizeof (lwpparktable) / sizeof (struct systable))
806 static const struct systable lwprwlocktable[] = {
807 {"lwp_rwlock_rdlock", 3, DEC, NOV, HID, HEX, HEX}, /* 0 */
808 {"lwp_rwlock_wrlock", 3, DEC, NOV, HID, HEX, HEX}, /* 1 */
809 {"lwp_rwlock_tryrdlock", 2, DEC, NOV, HID, HEX}, /* 2 */
810 {"lwp_rwlock_trywrlock", 2, DEC, NOV, HID, HEX}, /* 3 */
811 {"lwp_rwlock_unlock", 2, DEC, NOV, HID, HEX}, /* 4 */
813 #define NLWPRWLOCKCODE (sizeof (lwprwlocktable) / sizeof (struct systable))
815 static const struct systable sendfilevsystable[] = {
816 {"sendfilev", 5, DEC, NOV, DEC, DEC, HEX, DEC, HEX}, /* 0 */
817 {"sendfilev64", 5, DEC, NOV, DEC, DEC, HEX, DEC, HEX}, /* 1 */
819 #define NSENDFILESYSCODE \
820 (sizeof (sendfilevsystable) / sizeof (struct systable))
822 static const struct systable lgrpsystable[] = {
823 {"meminfo", 3, DEC, NOV, HID, NOV, MIF}, /* 0 */
824 {"_lgrpsys", 3, DEC, NOV, DEC, DEC, NOV}, /* 1 */
825 {"lgrp_version", 3, DEC, NOV, HID, DEC, NOV}, /* 2 */
826 {"_lgrpsys", 3, DEC, NOV, DEC, HEX, HEX}, /* 3 */
827 {"lgrp_affinity_get", 3, DEC, NOV, HID, NOV, LAF}, /* 4 */
828 {"lgrp_affinity_set", 3, DEC, NOV, HID, NOV, LAF}, /* 5 */
829 {"lgrp_latency", 3, DEC, NOV, HID, DEC, DEC}, /* 6 */
831 #define NLGRPSYSCODE (sizeof (lgrpsystable) / sizeof (struct systable))
833 static const struct systable rusagesystable[] = {
834 {"getrusage", 2, DEC, NOV, HID, HEX}, /* 0 */
835 {"getrusage_chld", 2, DEC, NOV, HID, HEX}, /* 1 */
836 {"getrusage_lwp", 2, DEC, NOV, HID, HEX}, /* 2 */
837 {"getvmusage", 5, DEC, NOV, HID, HEX, DEC, HEX, HEX}, /* 3 */
839 #define NRUSAGESYSCODE \
840 (sizeof (rusagesystable) / sizeof (struct systable))
842 static const struct systable ucredsystable[] = {
843 {"ucred_get", 3, DEC, NOV, HID, DEC, HEX},
844 {"getpeerucred", 3, DEC, NOV, HID, DEC, HEX},
846 #define NUCREDSYSCODE \
847 (sizeof (ucredsystable) / sizeof (struct systable))
849 const struct systable portfstable[] = {
850 {"port_create", 2, DEC, NOV, HID, DEC}, /* 0 */
851 {"port_associate", 6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX}, /* 1 */
852 {"port_dissociate", 4, DEC, NOV, HID, DEC, DEC, HEX}, /* 2 */
853 {"port_send", 4, DEC, NOV, HID, DEC, HEX, HEX}, /* 3 */
854 {"port_sendn", 6, DEC, DEC, HID, HEX, HEX, DEC, HEX, HEX}, /* 4 */
855 {"port_get", 4, DEC, NOV, HID, DEC, HEX, HEX}, /* 5 */
856 {"port_getn", 6, DEC, DEC, HID, DEC, HEX, DEC, DEC, HEX}, /* 6 */
857 {"port_alert", 5, DEC, NOV, HID, DEC, HEX, HEX, HEX}, /* 7 */
858 {"port_dispatch", 6, DEC, NOV, HID, DEC, DEC, HEX, HEX, HEX}, /* 8 */
860 #define NPORTCODE (sizeof (portfstable) / sizeof (struct systable))
862 static const struct systable zonetable[] = {
863 {"zone_create", 2, DEC, NOV, HID, HEX}, /* 0 */
864 {"zone_destroy", 2, DEC, NOV, HID, DEC}, /* 1 */
865 {"zone_getattr", 5, DEC, NOV, HID, DEC, ZGA, HEX, DEC}, /* 2 */
866 {"zone_enter", 2, DEC, NOV, HID, DEC}, /* 3 */
867 {"zone_list", 3, DEC, NOV, HID, HEX, HEX}, /* 4 */
868 {"zone_shutdown", 2, DEC, NOV, HID, DEC}, /* 5 */
869 {"zone_lookup", 2, DEC, NOV, HID, STG}, /* 6 */
870 {"zone_boot", 2, DEC, NOV, HID, DEC}, /* 7 */
871 {"zone_version", 2, HEX, NOV, HID, DEC}, /* 8 */
872 {"zone_setattr", 5, DEC, NOV, HID, DEC, ZGA, HEX, DEC}, /* 9 */
873 {"zone_add_datalink", 3, DEC, NOV, HID, DEC, STG}, /* 10 */
874 {"zone_remove_datalink", 3, DEC, NOV, HID, DEC, STG}, /* 11 */
875 {"zone_check_datalink", 3, DEC, NOV, HID, HEX, STG}, /* 12 */
876 {"zone_list_datalink", 4, DEC, NOV, HID, DEC, HEX, HEX}, /* 13 */
878 #define NZONECODE (sizeof (zonetable) / sizeof (struct systable))
881 const struct systable forktable[] = {
882 /* parent codes */
883 {"forkx", 2, DEC, NOV, HID, FXF}, /* 0 */
884 {"forkallx", 2, DEC, NOV, HID, FXF}, /* 1 */
885 {"vforkx", 2, DEC, NOV, HID, FXF}, /* 2 */
886 /* child codes */
887 {"forkx", 0, DEC, NOV}, /* 3 */
888 {"forkallx", 0, DEC, NOV}, /* 4 */
889 {"vforkx", 0, DEC, NOV}, /* 5 */
891 #define NFORKCODE (sizeof (forktable) / sizeof (struct systable))
893 const struct systable sidsystable[] = {
894 {"allocids", 4, UNS, UNS, HID, DEC, DEC, DEC}, /* 0 */
895 {"idmap_reg", 2, DEC, NOV, HID, DEC}, /* 1 */
896 {"idmap_unreg", 2, DEC, NOV, HID, DEC}, /* 2 */
898 #define NSIDSYSCODE (sizeof (sidsystable) / sizeof (struct systable))
900 const struct systable utimesystable[] = {
901 {"futimens", 3, DEC, NOV, HID, DEC, HEX}, /* 0 */
902 {"utimensat", 5, DEC, NOV, HID, ATC, STG, HEX, SNF}, /* 1 */
904 #define NUTIMESYSCODE (sizeof (utimesystable) / sizeof (struct systable))
906 const struct systable sockconfigtable[] = {
907 {"sockconfig", 5, DEC, NOV, SKC, DEC, DEC, DEC, STG}, /* 0 */
908 {"sockconfig", 4, DEC, NOV, SKC, DEC, DEC, DEC}, /* 1 */
909 {"sockconfig", 3, DEC, NOV, SKC, STG, HEX }, /* 2 */
910 {"sockconfig", 2, DEC, NOV, SKC, STG }, /* 3 */
912 #define NSOCKCONFIGCODE (sizeof (sockconfigtable) / sizeof (struct systable))
914 const struct sysalias sysalias[] = {
915 { "exit", SYS_exit },
916 { "fork", SYS_forksys },
917 { "fork1", SYS_forksys },
918 { "forkall", SYS_forksys },
919 { "forkx", SYS_forksys },
920 { "forkallx", SYS_forksys },
921 { "vforkx", SYS_forksys },
922 { "sbrk", SYS_brk },
923 { "getppid", SYS_getpid },
924 { "geteuid", SYS_getuid },
925 { "getpgrp", SYS_pgrpsys },
926 { "setpgrp", SYS_pgrpsys },
927 { "getsid", SYS_pgrpsys },
928 { "setsid", SYS_pgrpsys },
929 { "getpgid", SYS_pgrpsys },
930 { "setpgid", SYS_pgrpsys },
931 { "getegid", SYS_getgid },
932 { "msgget", SYS_msgsys },
933 { "msgctl", SYS_msgsys },
934 { "msgctl64", SYS_msgsys },
935 { "msgrcv", SYS_msgsys },
936 { "msgsnd", SYS_msgsys },
937 { "msgids", SYS_msgsys },
938 { "msgsnap", SYS_msgsys },
939 { "msgop", SYS_msgsys },
940 { "shmat", SYS_shmsys },
941 { "shmctl", SYS_shmsys },
942 { "shmctl64", SYS_shmsys },
943 { "shmdt", SYS_shmsys },
944 { "shmget", SYS_shmsys },
945 { "shmids", SYS_shmsys },
946 { "shmop", SYS_shmsys },
947 { "semctl", SYS_semsys },
948 { "semctl64", SYS_semsys },
949 { "semget", SYS_semsys },
950 { "semids", SYS_semsys },
951 { "semop", SYS_semsys },
952 { "semtimedop", SYS_semsys },
953 { "uname", SYS_utssys },
954 { "ustat", SYS_utssys },
955 { "fusers", SYS_utssys },
956 { "exec", SYS_execve },
957 { "execl", SYS_execve },
958 { "execv", SYS_execve },
959 { "execle", SYS_execve },
960 { "execlp", SYS_execve },
961 { "execvp", SYS_execve },
962 { "sigfillset", SYS_sigpending },
963 { "getcontext", SYS_context },
964 { "setcontext", SYS_context },
965 { "getustack", SYS_context },
966 { "setustack", SYS_context },
967 { "hrtcntl", SYS_hrtsys },
968 { "hrtalarm", SYS_hrtsys },
969 { "hrtsleep", SYS_hrtsys },
970 { "hrtcancel", SYS_hrtsys },
971 { "aioread", SYS_kaio },
972 { "aiowrite", SYS_kaio },
973 { "aiowait", SYS_kaio },
974 { "aiocancel", SYS_kaio },
975 { "aionotify", SYS_kaio },
976 { "audit", SYS_auditsys },
977 { "door_create", SYS_door },
978 { "door_revoke", SYS_door },
979 { "door_info", SYS_door },
980 { "door_call", SYS_door },
981 { "door_return", SYS_door },
982 { "door_bind", SYS_door },
983 { "door_unbind", SYS_door },
984 { "door_unref", SYS_door },
985 { "door_ucred", SYS_door },
986 { "door_getparam", SYS_door },
987 { "door_setparam", SYS_door },
988 { "pset_create", SYS_pset },
989 { "pset_destroy", SYS_pset },
990 { "pset_assign", SYS_pset },
991 { "pset_info", SYS_pset },
992 { "pset_bind", SYS_pset },
993 { "pset_getloadavg", SYS_pset },
994 { "pset_list", SYS_pset },
995 { "pset_setattr", SYS_pset },
996 { "pset_getattr", SYS_pset },
997 { "pset_assign_forced", SYS_pset },
998 { "settaskid", SYS_tasksys },
999 { "gettaskid", SYS_tasksys },
1000 { "getprojid", SYS_tasksys },
1001 { "setppriv", SYS_privsys },
1002 { "getppriv", SYS_privsys },
1003 { "getprivimplinfo", SYS_privsys },
1004 { "setpflags", SYS_privsys },
1005 { "getpflags", SYS_privsys },
1006 { "getacct", SYS_exacctsys },
1007 { "putacct", SYS_exacctsys },
1008 { "wracct", SYS_exacctsys },
1009 { "lwp_cond_timedwait", SYS_lwp_cond_wait },
1010 { "lwp_sema_wait", SYS_lwp_sema_timedwait },
1011 { "lwp_park", SYS_lwp_park },
1012 { "lwp_unpark", SYS_lwp_park },
1013 { "lwp_unpark_all", SYS_lwp_park },
1014 { "lwp_rwlock_rdlock", SYS_lwp_rwlock_sys },
1015 { "lwp_rwlock_wrlock", SYS_lwp_rwlock_sys },
1016 { "lwp_rwlock_tryrdlock", SYS_lwp_rwlock_sys },
1017 { "lwp_rwlock_trywrlock", SYS_lwp_rwlock_sys },
1018 { "lwp_rwlock_unlock", SYS_lwp_rwlock_sys },
1019 { "lwp_mutex_lock", SYS_lwp_mutex_timedlock },
1020 { "sendfilev64", SYS_sendfilev },
1021 { "creat", SYS_open },
1022 { "creat64", SYS_open64 },
1023 { "openattrdirat", SYS_openat },
1024 { "lgrpsys", SYS_lgrpsys },
1025 { "getrusage", SYS_rusagesys },
1026 { "getrusage_chld", SYS_rusagesys },
1027 { "getrusage_lwp", SYS_rusagesys },
1028 { "getvmusage", SYS_rusagesys },
1029 { "getpeerucred", SYS_ucredsys },
1030 { "ucred_get", SYS_ucredsys },
1031 { "port_create", SYS_port },
1032 { "port_associate", SYS_port },
1033 { "port_dissociate", SYS_port },
1034 { "port_send", SYS_port },
1035 { "port_sendn", SYS_port },
1036 { "port_get", SYS_port },
1037 { "port_getn", SYS_port },
1038 { "port_alert", SYS_port },
1039 { "port_dispatch", SYS_port },
1040 { "zone_create", SYS_zone },
1041 { "zone_destroy", SYS_zone },
1042 { "zone_getattr", SYS_zone },
1043 { "zone_setattr", SYS_zone },
1044 { "zone_enter", SYS_zone },
1045 { "getzoneid", SYS_zone },
1046 { "zone_list", SYS_zone },
1047 { "zone_shutdown", SYS_zone },
1048 { "zone_add_datalink", SYS_zone },
1049 { "zone_remove_datalink", SYS_zone },
1050 { "zone_check_datalink", SYS_zone },
1051 { "zone_list_datalink", SYS_zone },
1052 { "getrctl", SYS_rctlsys },
1053 { "setrctl", SYS_rctlsys },
1054 { "rctlsys_lst", SYS_rctlsys },
1055 { "rctlsys_ctl", SYS_rctlsys },
1056 { "allocids", SYS_sidsys },
1057 { "futimens", SYS_utimesys },
1058 { "utimensat", SYS_utimesys },
1059 { "poll", SYS_pollsys },
1060 { "umount", SYS_umount2 },
1061 { "wait", SYS_waitid },
1062 { NULL, 0 } /* end-of-list */
1066 * Return structure to interpret system call with sub-codes.
1068 const struct systable *
1069 subsys(int syscall, int subcode)
1071 const struct systable *stp = NULL;
1073 if (subcode != -1) {
1074 switch (syscall) {
1075 case SYS_faccessat:
1076 if ((unsigned)subcode < NACCESSCODE)
1077 stp = &faccessattable[subcode];
1078 break;
1079 case SYS_fchmodat:
1080 if ((unsigned)subcode < NCHMODCODE)
1081 stp = &fchmodattable[subcode];
1082 break;
1083 case SYS_fchownat:
1084 if ((unsigned)subcode < NCHOWNCODE)
1085 stp = &fchownattable[subcode];
1086 break;
1087 case SYS_mkdirat:
1088 if ((unsigned)subcode < NMKDIRCODE)
1089 stp = &mkdiratattable[subcode];
1090 break;
1091 case SYS_mknodat:
1092 if ((unsigned)subcode < NMKMODCODE)
1093 stp = &mknodatattable[subcode];
1094 break;
1095 case SYS_renameat:
1096 if ((unsigned)subcode < NRENAMECODE)
1097 stp = &renameattable[subcode];
1098 break;
1099 case SYS_linkat:
1100 if ((unsigned)subcode < NLINKATCODE)
1101 stp = &linkattable[subcode];
1102 break;
1103 case SYS_unlinkat:
1104 if ((unsigned)subcode < NUNLINKCODE)
1105 stp = &unlinkattable[subcode];
1106 break;
1107 case SYS_symlinkat:
1108 if ((unsigned)subcode < NSYMLINKCODE)
1109 stp = &symlinkattable[subcode];
1110 break;
1111 case SYS_readlinkat:
1112 if ((unsigned)subcode < NREADLINKCODE)
1113 stp = &readlinkattable[subcode];
1114 break;
1115 case SYS_fstatat:
1116 if ((unsigned)subcode < NSTATCODE)
1117 stp = &fstatattable[subcode];
1118 break;
1119 case SYS_fstatat64:
1120 if ((unsigned)subcode < NSTAT64CODE)
1121 stp = &fstatat64table[subcode];
1122 break;
1123 case SYS_openat:
1124 if ((unsigned)subcode < NOPENATCODE)
1125 stp = &openattable[subcode];
1126 break;
1127 case SYS_openat64:
1128 if ((unsigned)subcode < NOPENAT64CODE)
1129 stp = &openat64table[subcode];
1130 break;
1131 case SYS_open:
1132 if ((unsigned)subcode < NOPENCODE)
1133 stp = &opentable[subcode];
1134 break;
1135 case SYS_open64:
1136 if ((unsigned)subcode < NOPEN64CODE)
1137 stp = &open64table[subcode];
1138 break;
1139 case SYS_msgsys: /* msgsys() */
1140 if ((unsigned)subcode < NMSGCODE)
1141 stp = &msgtable[subcode];
1142 break;
1143 case SYS_semsys: /* semsys() */
1144 if ((unsigned)subcode < NSEMCODE)
1145 stp = &semtable[subcode];
1146 break;
1147 case SYS_shmsys: /* shmsys() */
1148 if ((unsigned)subcode < NSHMCODE)
1149 stp = &shmtable[subcode];
1150 break;
1151 case SYS_pgrpsys: /* pgrpsys() */
1152 if ((unsigned)subcode < NPIDCODE)
1153 stp = &pidtable[subcode];
1154 break;
1155 case SYS_utssys: /* utssys() */
1156 if ((unsigned)subcode < NUTSCODE)
1157 stp = &utstable[subcode];
1158 break;
1159 case SYS_sysfs: /* sysfs() */
1160 if ((unsigned)subcode < NSFSCODE)
1161 stp = &sfstable[subcode];
1162 break;
1163 case SYS_sigpending: /* sigpending()/sigfillset() */
1164 if ((unsigned)subcode < NSGPCODE)
1165 stp = &sgptable[subcode];
1166 break;
1167 case SYS_context: /* [get|set]context() */
1168 if ((unsigned)subcode < NCTXCODE)
1169 stp = &ctxtable[subcode];
1170 break;
1171 case SYS_hrtsys: /* hrtsys() */
1172 if ((unsigned)subcode < NHRTCODE)
1173 stp = &hrttable[subcode];
1174 break;
1175 case SYS_corectl: /* corectl() */
1176 if ((unsigned)subcode < NCORCODE)
1177 stp = &cortable[subcode];
1178 break;
1179 case SYS_kaio: /* kaio() */
1180 if ((unsigned)subcode < NAIOCODE)
1181 stp = &aiotable[subcode];
1182 break;
1183 case SYS_door: /* doors */
1184 if ((unsigned)subcode < NDOORCODE)
1185 stp = &doortable[subcode];
1186 break;
1187 case SYS_pset: /* pset() */
1188 if ((unsigned)subcode < NPSETCODE)
1189 stp = &psettable[subcode];
1190 break;
1191 case SYS_lwp_create: /* lwp_create() */
1192 if ((unsigned)subcode < NLWPCREATECODE)
1193 stp = &lwpcreatetable[subcode];
1194 break;
1195 case SYS_tasksys: /* tasks */
1196 if ((unsigned)subcode < NTASKSYSCODE)
1197 stp = &tasksystable[subcode];
1198 break;
1199 case SYS_exacctsys: /* exacct */
1200 if ((unsigned)subcode < NEXACCTSYSCODE)
1201 stp = &exacctsystable[subcode];
1202 break;
1203 case SYS_privsys: /* privileges */
1204 if ((unsigned)subcode < NPRIVSYSCODE)
1205 stp = &privsystable[subcode];
1206 break;
1207 case SYS_lwp_park: /* lwp_park */
1208 if ((unsigned)subcode < NLWPPARKCODE)
1209 stp = &lwpparktable[subcode];
1210 break;
1211 case SYS_lwp_rwlock_sys:
1212 if ((unsigned)subcode < NLWPRWLOCKCODE)
1213 stp = &lwprwlocktable[subcode];
1214 break;
1215 case SYS_sendfilev: /* sendfilev */
1216 if ((unsigned)subcode < NSENDFILESYSCODE)
1217 stp = &sendfilevsystable[subcode];
1218 break;
1219 case SYS_lgrpsys: /* lgrpsys */
1220 if ((unsigned)subcode < NLGRPSYSCODE)
1221 stp = &lgrpsystable[subcode];
1222 break;
1223 case SYS_rusagesys: /* rusagesys */
1224 if ((unsigned)subcode < NRUSAGESYSCODE)
1225 stp = &rusagesystable[subcode];
1226 break;
1227 case SYS_fcntl: /* fcntl */
1228 if ((unsigned)subcode < NFCNTLCODE)
1229 stp = &fcntltable[subcode];
1230 break;
1231 case SYS_ucredsys:
1232 if ((unsigned)subcode < NUCREDSYSCODE)
1233 stp = &ucredsystable[subcode];
1234 break;
1235 case SYS_port: /* portfs */
1236 if ((unsigned)subcode < NPORTCODE)
1237 stp = &portfstable[subcode];
1238 break;
1239 case SYS_zone: /* zone family */
1240 if ((unsigned)subcode < NZONECODE)
1241 stp = &zonetable[subcode];
1242 break;
1243 case SYS_rctlsys: /* rctl family */
1244 if ((unsigned)subcode < NRCTLCODE)
1245 stp = &rctltable[subcode];
1246 break;
1247 case SYS_forksys: /* fork family */
1248 if ((unsigned)subcode < NFORKCODE)
1249 stp = &forktable[subcode];
1250 break;
1251 case SYS_sidsys: /* SID family */
1252 if ((unsigned)subcode < NSIDSYSCODE)
1253 stp = &sidsystable[subcode];
1254 break;
1255 case SYS_utimesys: /* utime family */
1256 if ((unsigned)subcode < NUTIMESYSCODE)
1257 stp = &utimesystable[subcode];
1258 break;
1259 case SYS_sockconfig: /* sockconfig family */
1260 if ((unsigned)subcode < NSOCKCONFIGCODE)
1261 stp = &sockconfigtable[subcode];
1262 break;
1266 if (stp == NULL)
1267 stp = &systable[((unsigned)syscall < SYSEND)? syscall : 0];
1269 return (stp);
1273 * Return the name of the system call.
1275 const char *
1276 sysname(private_t *pri, int syscall, int subcode)
1278 const struct systable *stp = subsys(syscall, subcode);
1279 const char *name = stp->name; /* may be NULL */
1281 if (name == NULL) { /* manufacture a name */
1282 (void) sprintf(pri->sys_name, "sys#%d", syscall);
1283 name = pri->sys_name;
1286 return (name);
1290 * Return the name of the signal.
1291 * Return NULL if unknown signal.
1293 const char *
1294 rawsigname(private_t *pri, int sig)
1297 * The C library function sig2str() omits the leading "SIG".
1299 (void) strcpy(pri->raw_sig_name, "SIG");
1301 if (sig > 0 && sig2str(sig, pri->raw_sig_name+3) == 0)
1302 return (pri->raw_sig_name);
1303 return (NULL);
1307 * Return the name of the signal.
1308 * Manufacture a name for unknown signal.
1310 const char *
1311 signame(private_t *pri, int sig)
1313 const char *name = rawsigname(pri, sig);
1315 if (name == NULL) { /* manufacture a name */
1316 (void) sprintf(pri->sig_name, "SIG#%d", sig);
1317 name = pri->sig_name;
1320 return (name);
1324 * Determine the subcode for this syscall, if any.
1327 getsubcode(private_t *pri)
1329 const lwpstatus_t *Lsp = pri->lwpstat;
1330 int syscall = Lsp->pr_syscall;
1331 int nsysarg = Lsp->pr_nsysarg;
1332 int subcode = -1;
1333 int arg0;
1335 if (syscall > 0 && nsysarg > 0 && !prismember(&rawout, syscall)) {
1336 arg0 = Lsp->pr_sysarg[0];
1337 switch (syscall) {
1338 case SYS_utssys: /* utssys() */
1339 if (nsysarg > 2)
1340 subcode = Lsp->pr_sysarg[2];
1341 break;
1342 case SYS_faccessat:
1343 if (nsysarg > 3)
1344 subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD &&
1345 Lsp->pr_sysarg[3] == 0)? 1 : 0;
1346 break;
1347 case SYS_fchmodat:
1348 if (nsysarg > 1 && Lsp->pr_sysarg[1] == 0) {
1349 subcode = 3;
1350 break;
1352 if (nsysarg > 0 && (int)Lsp->pr_sysarg[0] != AT_FDCWD) {
1353 subcode = 0;
1354 break;
1356 if (nsysarg > 3)
1357 subcode = (Lsp->pr_sysarg[3] == 0)? 1 :
1358 (Lsp->pr_sysarg[3] == AT_SYMLINK_NOFOLLOW)?
1359 2 : 0;
1360 break;
1361 case SYS_fchownat:
1362 if (nsysarg > 1 && Lsp->pr_sysarg[1] == 0) {
1363 subcode = 3;
1364 break;
1366 if (nsysarg > 0 && (int)Lsp->pr_sysarg[0] != AT_FDCWD) {
1367 subcode = 0;
1368 break;
1370 if (nsysarg > 4)
1371 subcode = (Lsp->pr_sysarg[4] == 0)? 1 :
1372 (Lsp->pr_sysarg[4] == AT_SYMLINK_NOFOLLOW)?
1373 2 : 0;
1374 break;
1375 case SYS_mkdirat:
1376 case SYS_mknodat:
1377 case SYS_readlinkat:
1378 if (nsysarg > 0)
1379 subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD)?
1380 1 : 0;
1381 break;
1382 case SYS_renameat:
1383 if (nsysarg > 2)
1384 subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD &&
1385 (int)Lsp->pr_sysarg[2] == AT_FDCWD)? 1 : 0;
1386 break;
1387 case SYS_linkat:
1388 if (nsysarg > 4)
1389 subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD &&
1390 (int)Lsp->pr_sysarg[2] == AT_FDCWD &&
1391 Lsp->pr_sysarg[4] == 0)? 1 : 0;
1392 break;
1393 case SYS_unlinkat:
1394 if (nsysarg > 2)
1395 subcode =
1396 ((int)Lsp->pr_sysarg[0] != AT_FDCWD)? 0 :
1397 (Lsp->pr_sysarg[2] == AT_REMOVEDIR)? 2 :
1398 (Lsp->pr_sysarg[2] == 0)? 1 : 0;
1399 break;
1400 case SYS_symlinkat:
1401 if (nsysarg > 1)
1402 subcode = ((int)Lsp->pr_sysarg[1] == AT_FDCWD)?
1403 1 : 0;
1404 break;
1405 case SYS_fstatat:
1406 case SYS_fstatat64:
1407 if (nsysarg > 1 && Lsp->pr_sysarg[1] == 0) {
1408 subcode = 3;
1409 break;
1411 if (nsysarg > 0 && (int)Lsp->pr_sysarg[0] != AT_FDCWD) {
1412 subcode = 0;
1413 break;
1415 if (nsysarg > 3)
1416 subcode = (Lsp->pr_sysarg[3] == 0)? 1 :
1417 (Lsp->pr_sysarg[3] == AT_SYMLINK_NOFOLLOW)?
1418 2 : 0;
1419 break;
1420 case SYS_openat: /* openat() w/ and w/o AT_FDCWD */
1421 case SYS_openat64: /* and with and w/o O_CREAT */
1422 if (nsysarg > 2)
1423 subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD)?
1424 ((Lsp->pr_sysarg[2] & O_CREAT)? 3 : 2) :
1425 ((Lsp->pr_sysarg[2] & O_CREAT)? 1 : 0);
1426 break;
1427 case SYS_open: /* open() w/ and w/o O_CREAT */
1428 case SYS_open64:
1429 if (nsysarg > 1)
1430 subcode = (Lsp->pr_sysarg[1] & O_CREAT)? 1 : 0;
1431 break;
1432 case SYS_kaio: /* kaio() */
1433 subcode = arg0 & ~AIO_POLL_BIT;
1434 break;
1435 case SYS_door: /* doors */
1436 if (nsysarg > 5)
1437 subcode = Lsp->pr_sysarg[5];
1438 break;
1439 case SYS_lwp_create: /* lwp_create() */
1440 subcode = /* 0 for parent, 1 for child */
1441 (Lsp->pr_why == PR_SYSEXIT && Lsp->pr_errno == 0 &&
1442 Lsp->pr_rval1 == 0);
1443 break;
1444 case SYS_forksys: /* forksys */
1445 subcode = arg0;
1446 if (Lsp->pr_why == PR_SYSEXIT && Lsp->pr_errno == 0 &&
1447 pri->Rval2 != 0) /* this is the child */
1448 subcode += 3;
1449 break;
1450 case SYS_msgsys: /* msgsys() */
1451 case SYS_semsys: /* semsys() */
1452 case SYS_shmsys: /* shmsys() */
1453 case SYS_pgrpsys: /* pgrpsys() */
1454 case SYS_sysfs: /* sysfs() */
1455 case SYS_sigpending: /* sigpending()/sigfillset() */
1456 case SYS_context: /* [get|set]context() */
1457 case SYS_hrtsys: /* hrtsys() */
1458 case SYS_corectl: /* corectl() */
1459 case SYS_pset: /* pset() */
1460 case SYS_tasksys: /* tasks */
1461 case SYS_privsys: /* privileges */
1462 case SYS_exacctsys: /* exacct */
1463 case SYS_lwp_park: /* lwp_park */
1464 case SYS_lwp_rwlock_sys: /* lwp_rwlock_*() */
1465 case SYS_sendfilev: /* sendfilev */
1466 case SYS_lgrpsys: /* lgrpsys */
1467 case SYS_rusagesys: /* rusagesys */
1468 case SYS_ucredsys: /* ucredsys */
1469 case SYS_zone: /* zone */
1470 case SYS_rctlsys: /* rctlsys */
1471 case SYS_sidsys: /* sidsys */
1472 case SYS_utimesys: /* utimesys */
1473 case SYS_sockconfig: /* sockconfig */
1474 subcode = arg0;
1475 break;
1476 case SYS_fcntl: /* fcntl() */
1477 if (nsysarg > 2) {
1478 switch (Lsp->pr_sysarg[1]) {
1479 default: subcode = 0; break;
1480 case F_GETFL:
1481 case F_GETOWN:
1482 case F_GETXFL: subcode = 1; break;
1483 case F_SETFL: subcode = 2; break;
1486 break;
1487 case SYS_port: /* portfs */
1488 subcode = arg0 & PORT_CODE_MASK;
1489 break;
1493 return (subcode);
1497 * Return the maximum number of system calls, counting
1498 * all system calls with subcodes as separate calls.
1501 maxsyscalls()
1503 return (PRMAXSYS + 1
1504 + NACCESSCODE - 1
1505 + NCHMODCODE - 1
1506 + NCHOWNCODE - 1
1507 + NMKDIRCODE - 1
1508 + NMKMODCODE - 1
1509 + NRENAMECODE - 1
1510 + NLINKATCODE - 1
1511 + NUNLINKCODE - 1
1512 + NSYMLINKCODE - 1
1513 + NREADLINKCODE - 1
1514 + NSTATCODE - 1
1515 + NSTAT64CODE - 1
1516 + NOPENATCODE - 1
1517 + NOPENAT64CODE - 1
1518 + NOPENCODE - 1
1519 + NOPEN64CODE - 1
1520 + NMSGCODE - 1
1521 + NSEMCODE - 1
1522 + NSHMCODE - 1
1523 + NPIDCODE - 1
1524 + NSFSCODE - 1
1525 + NUTSCODE - 1
1526 + NSGPCODE - 1
1527 + NCTXCODE - 1
1528 + NHRTCODE - 1
1529 + NCORCODE - 1
1530 + NAIOCODE - 1
1531 + NDOORCODE - 1
1532 + NPSETCODE - 1
1533 + NLWPCREATECODE - 1
1534 + NTASKSYSCODE - 1
1535 + NEXACCTSYSCODE - 1
1536 + NLWPPARKCODE - 1
1537 + NLWPRWLOCKCODE - 1
1538 + NSENDFILESYSCODE - 1
1539 + NLGRPSYSCODE - 1
1540 + NRUSAGESYSCODE - 1
1541 + NFCNTLCODE - 1
1542 + NPRIVSYSCODE - 1
1543 + NUCREDSYSCODE - 1
1544 + NPORTCODE - 1
1545 + NZONECODE - 1
1546 + NRCTLCODE - 1
1547 + NFORKCODE - 1
1548 + NSIDSYSCODE - 1
1549 + NUTIMESYSCODE - 1
1550 + NSOCKCONFIGCODE - 1);
1554 * Return the number of subcodes for the specified system call number.
1557 nsubcodes(int syscall)
1559 switch (syscall) {
1560 case SYS_faccessat:
1561 return (NACCESSCODE);
1562 case SYS_fchmodat:
1563 return (NCHMODCODE);
1564 case SYS_fchownat:
1565 return (NCHOWNCODE);
1566 case SYS_mkdirat:
1567 return (NMKDIRCODE);
1568 case SYS_mknodat:
1569 return (NMKMODCODE);
1570 case SYS_renameat:
1571 return (NRENAMECODE);
1572 case SYS_linkat:
1573 return (NLINKATCODE);
1574 case SYS_unlinkat:
1575 return (NUNLINKCODE);
1576 case SYS_symlinkat:
1577 return (NSYMLINKCODE);
1578 case SYS_readlinkat:
1579 return (NREADLINKCODE);
1580 case SYS_fstatat:
1581 return (NSTATCODE);
1582 case SYS_fstatat64:
1583 return (NSTAT64CODE);
1584 case SYS_openat:
1585 return (NOPENATCODE);
1586 case SYS_openat64:
1587 return (NOPENAT64CODE);
1588 case SYS_open:
1589 return (NOPENCODE);
1590 case SYS_open64:
1591 return (NOPEN64CODE);
1592 case SYS_msgsys:
1593 return (NMSGCODE);
1594 case SYS_semsys:
1595 return (NSEMCODE);
1596 case SYS_shmsys:
1597 return (NSHMCODE);
1598 case SYS_pgrpsys:
1599 return (NPIDCODE);
1600 case SYS_utssys:
1601 return (NUTSCODE);
1602 case SYS_sysfs:
1603 return (NSFSCODE);
1604 case SYS_sigpending:
1605 return (NSGPCODE);
1606 case SYS_context:
1607 return (NCTXCODE);
1608 case SYS_hrtsys:
1609 return (NHRTCODE);
1610 case SYS_corectl:
1611 return (NCORCODE);
1612 case SYS_kaio:
1613 return (NAIOCODE);
1614 case SYS_door:
1615 return (NDOORCODE);
1616 case SYS_pset:
1617 return (NPSETCODE);
1618 case SYS_lwp_create:
1619 return (NLWPCREATECODE);
1620 case SYS_tasksys:
1621 return (NTASKSYSCODE);
1622 case SYS_exacctsys:
1623 return (NEXACCTSYSCODE);
1624 case SYS_privsys:
1625 return (NPRIVSYSCODE);
1626 case SYS_lwp_park:
1627 return (NLWPPARKCODE);
1628 case SYS_lwp_rwlock_sys:
1629 return (NLWPRWLOCKCODE);
1630 case SYS_sendfilev:
1631 return (NSENDFILESYSCODE);
1632 case SYS_lgrpsys:
1633 return (NLGRPSYSCODE);
1634 case SYS_rusagesys:
1635 return (NRUSAGESYSCODE);
1636 case SYS_fcntl:
1637 return (NFCNTLCODE);
1638 case SYS_ucredsys:
1639 return (NUCREDSYSCODE);
1640 case SYS_port:
1641 return (NPORTCODE);
1642 case SYS_zone:
1643 return (NZONECODE);
1644 case SYS_rctlsys:
1645 return (NRCTLCODE);
1646 case SYS_forksys:
1647 return (NFORKCODE);
1648 case SYS_sidsys:
1649 return (NSIDSYSCODE);
1650 case SYS_utimesys:
1651 return (NUTIMESYSCODE);
1652 case SYS_sockconfig:
1653 return (NSOCKCONFIGCODE);
1654 default:
1655 return (1);
1661 /* Socket address families (and protocol families) */
1662 const char * const afcodes[] = {
1663 "UNSPEC", /* 0 */
1664 "UNIX", /* 1 */
1665 "INET", /* 2 */
1666 "IMPLINK", /* 3 */
1667 "PUP", /* 4 */
1668 "CHAOS", /* 5 */
1669 "NS", /* 6 */
1670 "NBS", /* 7 */
1671 "ECMA", /* 8 */
1672 "DATAKIT", /* 9 */
1673 "CCITT", /* 10 */
1674 "SNA", /* 11 */
1675 "DECnet", /* 12 */
1676 "DLI", /* 13 */
1677 "LAT", /* 14 */
1678 "HYLINK", /* 15 */
1679 "APPLETALK", /* 16 */
1680 "NIT", /* 17 */
1681 "802", /* 18 */
1682 "OSI", /* 19 */
1683 "X25", /* 20 */
1684 "OSINET", /* 21 */
1685 "GOSIP", /* 22 */
1686 "IPX", /* 23 */
1687 "ROUTE", /* 24 */
1688 "LINK", /* 25 */
1689 "INET6", /* 26 */
1690 "KEY", /* 27 */
1691 NULL, /* 28 */
1692 "POLICY", /* 29 */
1693 "RDS", /* 30 */
1694 "TRILL", /* 31 */
1695 "PACKET" /* 32 */
1697 #if MAX_AFCODES != 33
1698 #error Need to update address-family table
1699 #endif
1702 const char * const socktype_codes[] = { /* cf socket.h */
1703 NULL,
1704 "SOCK_DGRAM", /* 1 */
1705 "SOCK_STREAM", /* 2 */
1706 NULL,
1707 "SOCK_RAW", /* 4 */
1708 NULL,
1709 "SOCK_SEQPACKET" /* 6 */
1711 #if MAX_SOCKTYPES != 7
1712 #error Need to update socket-type table
1713 #endif