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]
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. */
38 #include <sys/types.h>
41 #include <sys/port_impl.h>
48 * Tables of information about system calls - read-only data.
51 const char *const errcode
[] = { /* error code names */
108 "EDEADLOCK", /* 56 */
110 "EOWNERDEAD", /* 58 */
111 "ENOTRECOVERABLE", /* 59 */
124 "ELOCKUNMAPPED", /* 72 */
125 "ENOTACTIVE", /* 73 */
126 "EMULTIHOP", /* 74 */
130 "ENAMETOOLONG", /* 78 */
131 "EOVERFLOW", /* 79 */
145 "ENOTEMPTY", /* 93 */
148 "EDESTADDRREQ", /* 96 */
150 "EPROTOTYPE", /* 98 */
151 "ENOPROTOOPT", /* 99 */
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 */
186 "ENOTCONN", /* 134 */
195 "ESHUTDOWN", /* 143 */
196 "ETOOMANYREFS", /* 144 */
197 "ETIMEDOUT", /* 145 */
198 "ECONNREFUSED", /* 146 */
199 "EHOSTDOWN", /* 147 */
200 "EHOSTUNREACH", /* 148 */
201 "EALREADY", /* 149 */
202 "EINPROGRESS", /* 150 */
206 #define NERRCODE (sizeof (errcode) / sizeof (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
];
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 {"labelsys", 2, DEC
, NOV
, DEC
, HEX
}, /* 184 */
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 {"cladm", 3, DEC
, NOV
, CLC
, CLF
, HEX
}, /* 253 */
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))
880 static const struct systable labeltable
[] = {
881 {"labelsys", 3, DEC
, NOV
, HID
, HEX
, HEX
}, /* 0 */
882 {"is_system_labeled", 1, DEC
, NOV
, HID
}, /* 1 */
883 {"tnrh", 3, DEC
, NOV
, HID
, TND
, HEX
}, /* 2 */
884 {"tnrhtp", 3, DEC
, NOV
, HID
, TND
, HEX
}, /* 3 */
885 {"tnmlp", 3, DEC
, NOV
, HID
, TND
, HEX
}, /* 4 */
886 {"getlabel", 3, DEC
, NOV
, HID
, STG
, HEX
}, /* 5 */
887 {"fgetlabel", 3, DEC
, NOV
, HID
, DEC
, HEX
}, /* 6 */
889 #define NLABELCODE (sizeof (labeltable) / sizeof (struct systable))
891 const struct systable forktable
[] = {
893 {"forkx", 2, DEC
, NOV
, HID
, FXF
}, /* 0 */
894 {"forkallx", 2, DEC
, NOV
, HID
, FXF
}, /* 1 */
895 {"vforkx", 2, DEC
, NOV
, HID
, FXF
}, /* 2 */
897 {"forkx", 0, DEC
, NOV
}, /* 3 */
898 {"forkallx", 0, DEC
, NOV
}, /* 4 */
899 {"vforkx", 0, DEC
, NOV
}, /* 5 */
901 #define NFORKCODE (sizeof (forktable) / sizeof (struct systable))
903 const struct systable sidsystable
[] = {
904 {"allocids", 4, UNS
, UNS
, HID
, DEC
, DEC
, DEC
}, /* 0 */
905 {"idmap_reg", 2, DEC
, NOV
, HID
, DEC
}, /* 1 */
906 {"idmap_unreg", 2, DEC
, NOV
, HID
, DEC
}, /* 2 */
908 #define NSIDSYSCODE (sizeof (sidsystable) / sizeof (struct systable))
910 const struct systable utimesystable
[] = {
911 {"futimens", 3, DEC
, NOV
, HID
, DEC
, HEX
}, /* 0 */
912 {"utimensat", 5, DEC
, NOV
, HID
, ATC
, STG
, HEX
, SNF
}, /* 1 */
914 #define NUTIMESYSCODE (sizeof (utimesystable) / sizeof (struct systable))
916 const struct systable sockconfigtable
[] = {
917 {"sockconfig", 5, DEC
, NOV
, SKC
, DEC
, DEC
, DEC
, STG
}, /* 0 */
918 {"sockconfig", 4, DEC
, NOV
, SKC
, DEC
, DEC
, DEC
}, /* 1 */
919 {"sockconfig", 3, DEC
, NOV
, SKC
, STG
, HEX
}, /* 2 */
920 {"sockconfig", 2, DEC
, NOV
, SKC
, STG
}, /* 3 */
922 #define NSOCKCONFIGCODE (sizeof (sockconfigtable) / sizeof (struct systable))
924 const struct sysalias sysalias
[] = {
925 { "exit", SYS_exit
},
926 { "fork", SYS_forksys
},
927 { "fork1", SYS_forksys
},
928 { "forkall", SYS_forksys
},
929 { "forkx", SYS_forksys
},
930 { "forkallx", SYS_forksys
},
931 { "vforkx", SYS_forksys
},
933 { "getppid", SYS_getpid
},
934 { "geteuid", SYS_getuid
},
935 { "getpgrp", SYS_pgrpsys
},
936 { "setpgrp", SYS_pgrpsys
},
937 { "getsid", SYS_pgrpsys
},
938 { "setsid", SYS_pgrpsys
},
939 { "getpgid", SYS_pgrpsys
},
940 { "setpgid", SYS_pgrpsys
},
941 { "getegid", SYS_getgid
},
942 { "msgget", SYS_msgsys
},
943 { "msgctl", SYS_msgsys
},
944 { "msgctl64", SYS_msgsys
},
945 { "msgrcv", SYS_msgsys
},
946 { "msgsnd", SYS_msgsys
},
947 { "msgids", SYS_msgsys
},
948 { "msgsnap", SYS_msgsys
},
949 { "msgop", SYS_msgsys
},
950 { "shmat", SYS_shmsys
},
951 { "shmctl", SYS_shmsys
},
952 { "shmctl64", SYS_shmsys
},
953 { "shmdt", SYS_shmsys
},
954 { "shmget", SYS_shmsys
},
955 { "shmids", SYS_shmsys
},
956 { "shmop", SYS_shmsys
},
957 { "semctl", SYS_semsys
},
958 { "semctl64", SYS_semsys
},
959 { "semget", SYS_semsys
},
960 { "semids", SYS_semsys
},
961 { "semop", SYS_semsys
},
962 { "semtimedop", SYS_semsys
},
963 { "uname", SYS_utssys
},
964 { "ustat", SYS_utssys
},
965 { "fusers", SYS_utssys
},
966 { "exec", SYS_execve
},
967 { "execl", SYS_execve
},
968 { "execv", SYS_execve
},
969 { "execle", SYS_execve
},
970 { "execlp", SYS_execve
},
971 { "execvp", SYS_execve
},
972 { "sigfillset", SYS_sigpending
},
973 { "getcontext", SYS_context
},
974 { "setcontext", SYS_context
},
975 { "getustack", SYS_context
},
976 { "setustack", SYS_context
},
977 { "hrtcntl", SYS_hrtsys
},
978 { "hrtalarm", SYS_hrtsys
},
979 { "hrtsleep", SYS_hrtsys
},
980 { "hrtcancel", SYS_hrtsys
},
981 { "aioread", SYS_kaio
},
982 { "aiowrite", SYS_kaio
},
983 { "aiowait", SYS_kaio
},
984 { "aiocancel", SYS_kaio
},
985 { "aionotify", SYS_kaio
},
986 { "audit", SYS_auditsys
},
987 { "door_create", SYS_door
},
988 { "door_revoke", SYS_door
},
989 { "door_info", SYS_door
},
990 { "door_call", SYS_door
},
991 { "door_return", SYS_door
},
992 { "door_bind", SYS_door
},
993 { "door_unbind", SYS_door
},
994 { "door_unref", SYS_door
},
995 { "door_ucred", SYS_door
},
996 { "door_getparam", SYS_door
},
997 { "door_setparam", SYS_door
},
998 { "pset_create", SYS_pset
},
999 { "pset_destroy", SYS_pset
},
1000 { "pset_assign", SYS_pset
},
1001 { "pset_info", SYS_pset
},
1002 { "pset_bind", SYS_pset
},
1003 { "pset_getloadavg", SYS_pset
},
1004 { "pset_list", SYS_pset
},
1005 { "pset_setattr", SYS_pset
},
1006 { "pset_getattr", SYS_pset
},
1007 { "pset_assign_forced", SYS_pset
},
1008 { "settaskid", SYS_tasksys
},
1009 { "gettaskid", SYS_tasksys
},
1010 { "getprojid", SYS_tasksys
},
1011 { "setppriv", SYS_privsys
},
1012 { "getppriv", SYS_privsys
},
1013 { "getprivimplinfo", SYS_privsys
},
1014 { "setpflags", SYS_privsys
},
1015 { "getpflags", SYS_privsys
},
1016 { "getacct", SYS_exacctsys
},
1017 { "putacct", SYS_exacctsys
},
1018 { "wracct", SYS_exacctsys
},
1019 { "lwp_cond_timedwait", SYS_lwp_cond_wait
},
1020 { "lwp_sema_wait", SYS_lwp_sema_timedwait
},
1021 { "lwp_park", SYS_lwp_park
},
1022 { "lwp_unpark", SYS_lwp_park
},
1023 { "lwp_unpark_all", SYS_lwp_park
},
1024 { "lwp_rwlock_rdlock", SYS_lwp_rwlock_sys
},
1025 { "lwp_rwlock_wrlock", SYS_lwp_rwlock_sys
},
1026 { "lwp_rwlock_tryrdlock", SYS_lwp_rwlock_sys
},
1027 { "lwp_rwlock_trywrlock", SYS_lwp_rwlock_sys
},
1028 { "lwp_rwlock_unlock", SYS_lwp_rwlock_sys
},
1029 { "lwp_mutex_lock", SYS_lwp_mutex_timedlock
},
1030 { "sendfilev64", SYS_sendfilev
},
1031 { "creat", SYS_open
},
1032 { "creat64", SYS_open64
},
1033 { "openattrdirat", SYS_openat
},
1034 { "lgrpsys", SYS_lgrpsys
},
1035 { "getrusage", SYS_rusagesys
},
1036 { "getrusage_chld", SYS_rusagesys
},
1037 { "getrusage_lwp", SYS_rusagesys
},
1038 { "getvmusage", SYS_rusagesys
},
1039 { "getpeerucred", SYS_ucredsys
},
1040 { "ucred_get", SYS_ucredsys
},
1041 { "port_create", SYS_port
},
1042 { "port_associate", SYS_port
},
1043 { "port_dissociate", SYS_port
},
1044 { "port_send", SYS_port
},
1045 { "port_sendn", SYS_port
},
1046 { "port_get", SYS_port
},
1047 { "port_getn", SYS_port
},
1048 { "port_alert", SYS_port
},
1049 { "port_dispatch", SYS_port
},
1050 { "zone_create", SYS_zone
},
1051 { "zone_destroy", SYS_zone
},
1052 { "zone_getattr", SYS_zone
},
1053 { "zone_setattr", SYS_zone
},
1054 { "zone_enter", SYS_zone
},
1055 { "getzoneid", SYS_zone
},
1056 { "zone_list", SYS_zone
},
1057 { "zone_shutdown", SYS_zone
},
1058 { "zone_add_datalink", SYS_zone
},
1059 { "zone_remove_datalink", SYS_zone
},
1060 { "zone_check_datalink", SYS_zone
},
1061 { "zone_list_datalink", SYS_zone
},
1062 { "is_system_labeled", SYS_labelsys
},
1063 { "tnrh", SYS_labelsys
},
1064 { "tnrhtp", SYS_labelsys
},
1065 { "tnmlp", SYS_labelsys
},
1066 { "getlabel", SYS_labelsys
},
1067 { "fgetlabel", SYS_labelsys
},
1068 { "getrctl", SYS_rctlsys
},
1069 { "setrctl", SYS_rctlsys
},
1070 { "rctlsys_lst", SYS_rctlsys
},
1071 { "rctlsys_ctl", SYS_rctlsys
},
1072 { "allocids", SYS_sidsys
},
1073 { "futimens", SYS_utimesys
},
1074 { "utimensat", SYS_utimesys
},
1075 { "poll", SYS_pollsys
},
1076 { "umount", SYS_umount2
},
1077 { "wait", SYS_waitid
},
1078 { NULL
, 0 } /* end-of-list */
1082 * Return structure to interpret system call with sub-codes.
1084 const struct systable
*
1085 subsys(int syscall
, int subcode
)
1087 const struct systable
*stp
= NULL
;
1089 if (subcode
!= -1) {
1092 if ((unsigned)subcode
< NACCESSCODE
)
1093 stp
= &faccessattable
[subcode
];
1096 if ((unsigned)subcode
< NCHMODCODE
)
1097 stp
= &fchmodattable
[subcode
];
1100 if ((unsigned)subcode
< NCHOWNCODE
)
1101 stp
= &fchownattable
[subcode
];
1104 if ((unsigned)subcode
< NMKDIRCODE
)
1105 stp
= &mkdiratattable
[subcode
];
1108 if ((unsigned)subcode
< NMKMODCODE
)
1109 stp
= &mknodatattable
[subcode
];
1112 if ((unsigned)subcode
< NRENAMECODE
)
1113 stp
= &renameattable
[subcode
];
1116 if ((unsigned)subcode
< NLINKATCODE
)
1117 stp
= &linkattable
[subcode
];
1120 if ((unsigned)subcode
< NUNLINKCODE
)
1121 stp
= &unlinkattable
[subcode
];
1124 if ((unsigned)subcode
< NSYMLINKCODE
)
1125 stp
= &symlinkattable
[subcode
];
1127 case SYS_readlinkat
:
1128 if ((unsigned)subcode
< NREADLINKCODE
)
1129 stp
= &readlinkattable
[subcode
];
1132 if ((unsigned)subcode
< NSTATCODE
)
1133 stp
= &fstatattable
[subcode
];
1136 if ((unsigned)subcode
< NSTAT64CODE
)
1137 stp
= &fstatat64table
[subcode
];
1140 if ((unsigned)subcode
< NOPENATCODE
)
1141 stp
= &openattable
[subcode
];
1144 if ((unsigned)subcode
< NOPENAT64CODE
)
1145 stp
= &openat64table
[subcode
];
1148 if ((unsigned)subcode
< NOPENCODE
)
1149 stp
= &opentable
[subcode
];
1152 if ((unsigned)subcode
< NOPEN64CODE
)
1153 stp
= &open64table
[subcode
];
1155 case SYS_msgsys
: /* msgsys() */
1156 if ((unsigned)subcode
< NMSGCODE
)
1157 stp
= &msgtable
[subcode
];
1159 case SYS_semsys
: /* semsys() */
1160 if ((unsigned)subcode
< NSEMCODE
)
1161 stp
= &semtable
[subcode
];
1163 case SYS_shmsys
: /* shmsys() */
1164 if ((unsigned)subcode
< NSHMCODE
)
1165 stp
= &shmtable
[subcode
];
1167 case SYS_pgrpsys
: /* pgrpsys() */
1168 if ((unsigned)subcode
< NPIDCODE
)
1169 stp
= &pidtable
[subcode
];
1171 case SYS_utssys
: /* utssys() */
1172 if ((unsigned)subcode
< NUTSCODE
)
1173 stp
= &utstable
[subcode
];
1175 case SYS_sysfs
: /* sysfs() */
1176 if ((unsigned)subcode
< NSFSCODE
)
1177 stp
= &sfstable
[subcode
];
1179 case SYS_sigpending
: /* sigpending()/sigfillset() */
1180 if ((unsigned)subcode
< NSGPCODE
)
1181 stp
= &sgptable
[subcode
];
1183 case SYS_context
: /* [get|set]context() */
1184 if ((unsigned)subcode
< NCTXCODE
)
1185 stp
= &ctxtable
[subcode
];
1187 case SYS_hrtsys
: /* hrtsys() */
1188 if ((unsigned)subcode
< NHRTCODE
)
1189 stp
= &hrttable
[subcode
];
1191 case SYS_corectl
: /* corectl() */
1192 if ((unsigned)subcode
< NCORCODE
)
1193 stp
= &cortable
[subcode
];
1195 case SYS_kaio
: /* kaio() */
1196 if ((unsigned)subcode
< NAIOCODE
)
1197 stp
= &aiotable
[subcode
];
1199 case SYS_door
: /* doors */
1200 if ((unsigned)subcode
< NDOORCODE
)
1201 stp
= &doortable
[subcode
];
1203 case SYS_pset
: /* pset() */
1204 if ((unsigned)subcode
< NPSETCODE
)
1205 stp
= &psettable
[subcode
];
1207 case SYS_lwp_create
: /* lwp_create() */
1208 if ((unsigned)subcode
< NLWPCREATECODE
)
1209 stp
= &lwpcreatetable
[subcode
];
1211 case SYS_tasksys
: /* tasks */
1212 if ((unsigned)subcode
< NTASKSYSCODE
)
1213 stp
= &tasksystable
[subcode
];
1215 case SYS_exacctsys
: /* exacct */
1216 if ((unsigned)subcode
< NEXACCTSYSCODE
)
1217 stp
= &exacctsystable
[subcode
];
1219 case SYS_privsys
: /* privileges */
1220 if ((unsigned)subcode
< NPRIVSYSCODE
)
1221 stp
= &privsystable
[subcode
];
1223 case SYS_lwp_park
: /* lwp_park */
1224 if ((unsigned)subcode
< NLWPPARKCODE
)
1225 stp
= &lwpparktable
[subcode
];
1227 case SYS_lwp_rwlock_sys
:
1228 if ((unsigned)subcode
< NLWPRWLOCKCODE
)
1229 stp
= &lwprwlocktable
[subcode
];
1231 case SYS_sendfilev
: /* sendfilev */
1232 if ((unsigned)subcode
< NSENDFILESYSCODE
)
1233 stp
= &sendfilevsystable
[subcode
];
1235 case SYS_lgrpsys
: /* lgrpsys */
1236 if ((unsigned)subcode
< NLGRPSYSCODE
)
1237 stp
= &lgrpsystable
[subcode
];
1239 case SYS_rusagesys
: /* rusagesys */
1240 if ((unsigned)subcode
< NRUSAGESYSCODE
)
1241 stp
= &rusagesystable
[subcode
];
1243 case SYS_fcntl
: /* fcntl */
1244 if ((unsigned)subcode
< NFCNTLCODE
)
1245 stp
= &fcntltable
[subcode
];
1248 if ((unsigned)subcode
< NUCREDSYSCODE
)
1249 stp
= &ucredsystable
[subcode
];
1251 case SYS_port
: /* portfs */
1252 if ((unsigned)subcode
< NPORTCODE
)
1253 stp
= &portfstable
[subcode
];
1255 case SYS_zone
: /* zone family */
1256 if ((unsigned)subcode
< NZONECODE
)
1257 stp
= &zonetable
[subcode
];
1259 case SYS_labelsys
: /* label family */
1260 if ((unsigned)subcode
< NLABELCODE
)
1261 stp
= &labeltable
[subcode
];
1263 case SYS_rctlsys
: /* rctl family */
1264 if ((unsigned)subcode
< NRCTLCODE
)
1265 stp
= &rctltable
[subcode
];
1267 case SYS_forksys
: /* fork family */
1268 if ((unsigned)subcode
< NFORKCODE
)
1269 stp
= &forktable
[subcode
];
1271 case SYS_sidsys
: /* SID family */
1272 if ((unsigned)subcode
< NSIDSYSCODE
)
1273 stp
= &sidsystable
[subcode
];
1275 case SYS_utimesys
: /* utime family */
1276 if ((unsigned)subcode
< NUTIMESYSCODE
)
1277 stp
= &utimesystable
[subcode
];
1279 case SYS_sockconfig
: /* sockconfig family */
1280 if ((unsigned)subcode
< NSOCKCONFIGCODE
)
1281 stp
= &sockconfigtable
[subcode
];
1287 stp
= &systable
[((unsigned)syscall
< SYSEND
)? syscall
: 0];
1293 * Return the name of the system call.
1296 sysname(private_t
*pri
, int syscall
, int subcode
)
1298 const struct systable
*stp
= subsys(syscall
, subcode
);
1299 const char *name
= stp
->name
; /* may be NULL */
1301 if (name
== NULL
) { /* manufacture a name */
1302 (void) sprintf(pri
->sys_name
, "sys#%d", syscall
);
1303 name
= pri
->sys_name
;
1310 * Return the name of the signal.
1311 * Return NULL if unknown signal.
1314 rawsigname(private_t
*pri
, int sig
)
1317 * The C library function sig2str() omits the leading "SIG".
1319 (void) strcpy(pri
->raw_sig_name
, "SIG");
1321 if (sig
> 0 && sig2str(sig
, pri
->raw_sig_name
+3) == 0)
1322 return (pri
->raw_sig_name
);
1327 * Return the name of the signal.
1328 * Manufacture a name for unknown signal.
1331 signame(private_t
*pri
, int sig
)
1333 const char *name
= rawsigname(pri
, sig
);
1335 if (name
== NULL
) { /* manufacture a name */
1336 (void) sprintf(pri
->sig_name
, "SIG#%d", sig
);
1337 name
= pri
->sig_name
;
1344 * Determine the subcode for this syscall, if any.
1347 getsubcode(private_t
*pri
)
1349 const lwpstatus_t
*Lsp
= pri
->lwpstat
;
1350 int syscall
= Lsp
->pr_syscall
;
1351 int nsysarg
= Lsp
->pr_nsysarg
;
1355 if (syscall
> 0 && nsysarg
> 0 && !prismember(&rawout
, syscall
)) {
1356 arg0
= Lsp
->pr_sysarg
[0];
1358 case SYS_utssys
: /* utssys() */
1360 subcode
= Lsp
->pr_sysarg
[2];
1364 subcode
= ((int)Lsp
->pr_sysarg
[0] == AT_FDCWD
&&
1365 Lsp
->pr_sysarg
[3] == 0)? 1 : 0;
1368 if (nsysarg
> 1 && Lsp
->pr_sysarg
[1] == NULL
) {
1372 if (nsysarg
> 0 && (int)Lsp
->pr_sysarg
[0] != AT_FDCWD
) {
1377 subcode
= (Lsp
->pr_sysarg
[3] == 0)? 1 :
1378 (Lsp
->pr_sysarg
[3] == AT_SYMLINK_NOFOLLOW
)?
1382 if (nsysarg
> 1 && Lsp
->pr_sysarg
[1] == NULL
) {
1386 if (nsysarg
> 0 && (int)Lsp
->pr_sysarg
[0] != AT_FDCWD
) {
1391 subcode
= (Lsp
->pr_sysarg
[4] == 0)? 1 :
1392 (Lsp
->pr_sysarg
[4] == AT_SYMLINK_NOFOLLOW
)?
1397 case SYS_readlinkat
:
1399 subcode
= ((int)Lsp
->pr_sysarg
[0] == AT_FDCWD
)?
1404 subcode
= ((int)Lsp
->pr_sysarg
[0] == AT_FDCWD
&&
1405 (int)Lsp
->pr_sysarg
[2] == AT_FDCWD
)? 1 : 0;
1409 subcode
= ((int)Lsp
->pr_sysarg
[0] == AT_FDCWD
&&
1410 (int)Lsp
->pr_sysarg
[2] == AT_FDCWD
&&
1411 Lsp
->pr_sysarg
[4] == 0)? 1 : 0;
1416 ((int)Lsp
->pr_sysarg
[0] != AT_FDCWD
)? 0 :
1417 (Lsp
->pr_sysarg
[2] == AT_REMOVEDIR
)? 2 :
1418 (Lsp
->pr_sysarg
[2] == 0)? 1 : 0;
1422 subcode
= ((int)Lsp
->pr_sysarg
[1] == AT_FDCWD
)?
1427 if (nsysarg
> 1 && Lsp
->pr_sysarg
[1] == NULL
) {
1431 if (nsysarg
> 0 && (int)Lsp
->pr_sysarg
[0] != AT_FDCWD
) {
1436 subcode
= (Lsp
->pr_sysarg
[3] == 0)? 1 :
1437 (Lsp
->pr_sysarg
[3] == AT_SYMLINK_NOFOLLOW
)?
1440 case SYS_openat
: /* openat() w/ and w/o AT_FDCWD */
1441 case SYS_openat64
: /* and with and w/o O_CREAT */
1443 subcode
= ((int)Lsp
->pr_sysarg
[0] == AT_FDCWD
)?
1444 ((Lsp
->pr_sysarg
[2] & O_CREAT
)? 3 : 2) :
1445 ((Lsp
->pr_sysarg
[2] & O_CREAT
)? 1 : 0);
1447 case SYS_open
: /* open() w/ and w/o O_CREAT */
1450 subcode
= (Lsp
->pr_sysarg
[1] & O_CREAT
)? 1 : 0;
1452 case SYS_kaio
: /* kaio() */
1453 subcode
= arg0
& ~AIO_POLL_BIT
;
1455 case SYS_door
: /* doors */
1457 subcode
= Lsp
->pr_sysarg
[5];
1459 case SYS_lwp_create
: /* lwp_create() */
1460 subcode
= /* 0 for parent, 1 for child */
1461 (Lsp
->pr_why
== PR_SYSEXIT
&& Lsp
->pr_errno
== 0 &&
1462 Lsp
->pr_rval1
== 0);
1464 case SYS_forksys
: /* forksys */
1466 if (Lsp
->pr_why
== PR_SYSEXIT
&& Lsp
->pr_errno
== 0 &&
1467 pri
->Rval2
!= 0) /* this is the child */
1470 case SYS_msgsys
: /* msgsys() */
1471 case SYS_semsys
: /* semsys() */
1472 case SYS_shmsys
: /* shmsys() */
1473 case SYS_pgrpsys
: /* pgrpsys() */
1474 case SYS_sysfs
: /* sysfs() */
1475 case SYS_sigpending
: /* sigpending()/sigfillset() */
1476 case SYS_context
: /* [get|set]context() */
1477 case SYS_hrtsys
: /* hrtsys() */
1478 case SYS_corectl
: /* corectl() */
1479 case SYS_pset
: /* pset() */
1480 case SYS_tasksys
: /* tasks */
1481 case SYS_privsys
: /* privileges */
1482 case SYS_exacctsys
: /* exacct */
1483 case SYS_lwp_park
: /* lwp_park */
1484 case SYS_lwp_rwlock_sys
: /* lwp_rwlock_*() */
1485 case SYS_sendfilev
: /* sendfilev */
1486 case SYS_lgrpsys
: /* lgrpsys */
1487 case SYS_rusagesys
: /* rusagesys */
1488 case SYS_ucredsys
: /* ucredsys */
1489 case SYS_zone
: /* zone */
1490 case SYS_labelsys
: /* labelsys */
1491 case SYS_rctlsys
: /* rctlsys */
1492 case SYS_sidsys
: /* sidsys */
1493 case SYS_utimesys
: /* utimesys */
1494 case SYS_sockconfig
: /* sockconfig */
1497 case SYS_fcntl
: /* fcntl() */
1499 switch (Lsp
->pr_sysarg
[1]) {
1500 default: subcode
= 0; break;
1503 case F_GETXFL
: subcode
= 1; break;
1504 case F_SETFL
: subcode
= 2; break;
1508 case SYS_port
: /* portfs */
1509 subcode
= arg0
& PORT_CODE_MASK
;
1518 * Return the maximum number of system calls, counting
1519 * all system calls with subcodes as separate calls.
1524 return (PRMAXSYS
+ 1
1554 + NLWPCREATECODE
- 1
1556 + NEXACCTSYSCODE
- 1
1558 + NLWPRWLOCKCODE
- 1
1559 + NSENDFILESYSCODE
- 1
1561 + NRUSAGESYSCODE
- 1
1572 + NSOCKCONFIGCODE
- 1);
1576 * Return the number of subcodes for the specified system call number.
1579 nsubcodes(int syscall
)
1583 return (NACCESSCODE
);
1585 return (NCHMODCODE
);
1587 return (NCHOWNCODE
);
1589 return (NMKDIRCODE
);
1591 return (NMKMODCODE
);
1593 return (NRENAMECODE
);
1595 return (NLINKATCODE
);
1597 return (NUNLINKCODE
);
1599 return (NSYMLINKCODE
);
1600 case SYS_readlinkat
:
1601 return (NREADLINKCODE
);
1605 return (NSTAT64CODE
);
1607 return (NOPENATCODE
);
1609 return (NOPENAT64CODE
);
1613 return (NOPEN64CODE
);
1626 case SYS_sigpending
:
1640 case SYS_lwp_create
:
1641 return (NLWPCREATECODE
);
1643 return (NTASKSYSCODE
);
1645 return (NEXACCTSYSCODE
);
1647 return (NPRIVSYSCODE
);
1649 return (NLWPPARKCODE
);
1650 case SYS_lwp_rwlock_sys
:
1651 return (NLWPRWLOCKCODE
);
1653 return (NSENDFILESYSCODE
);
1655 return (NLGRPSYSCODE
);
1657 return (NRUSAGESYSCODE
);
1659 return (NFCNTLCODE
);
1661 return (NUCREDSYSCODE
);
1667 return (NLABELCODE
);
1673 return (NSIDSYSCODE
);
1675 return (NUTIMESYSCODE
);
1676 case SYS_sockconfig
:
1677 return (NSOCKCONFIGCODE
);
1685 /* Socket address families (and protocol families) */
1686 const char * const afcodes
[] = {
1703 "APPLETALK", /* 16 */
1721 #if MAX_AFCODES != 33
1722 #error Need to update address-family table
1726 const char * const socktype_codes
[] = { /* cf socket.h */
1728 "SOCK_DGRAM", /* 1 */
1729 "SOCK_STREAM", /* 2 */
1733 "SOCK_SEQPACKET" /* 6 */
1735 #if MAX_SOCKTYPES != 7
1736 #error Need to update socket-type table