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