Print this page
6227 truss(1M) is not showing TCP_KEEPIDLE, TCP_KEEPCNT, and TCP_KEEPINTVL TCP options. Hex values are shown instead.
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Richard PALO <richard@netbsd.org>
Reviewed by: Toomas Soome <tsoome@me.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/truss/print.c
+++ new/usr/src/cmd/truss/print.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 #define _SYSCALL32 /* make 32-bit compat headers visible */
33 33
34 34 #include <stdio.h>
35 35 #include <stdlib.h>
36 36 #include <unistd.h>
37 37 #include <string.h>
38 38 #include <signal.h>
39 39 #include <termio.h>
40 40 #include <stddef.h>
41 41 #include <limits.h>
42 42 #include <fcntl.h>
43 43 #include <ctype.h>
44 44 #include <sys/types.h>
45 45 #include <sys/mman.h>
46 46 #include <sys/resource.h>
47 47 #include <sys/ulimit.h>
48 48 #include <sys/utsname.h>
49 49 #include <sys/kstat.h>
50 50 #include <sys/modctl.h>
51 51 #include <sys/acl.h>
52 52 #include <stropts.h>
53 53 #include <sys/isa_defs.h>
54 54 #include <sys/systeminfo.h>
55 55 #include <sys/cladm.h>
56 56 #include <sys/lwp.h>
57 57 #include <bsm/audit.h>
58 58 #include <libproc.h>
59 59 #include <priv.h>
60 60 #include <sys/aio.h>
61 61 #include <sys/aiocb.h>
62 62 #include <sys/corectl.h>
63 63 #include <sys/cpc_impl.h>
64 64 #include <sys/priocntl.h>
65 65 #include <sys/tspriocntl.h>
66 66 #include <sys/iapriocntl.h>
67 67 #include <sys/rtpriocntl.h>
68 68 #include <sys/fsspriocntl.h>
69 69 #include <sys/fxpriocntl.h>
70 70 #include <netdb.h>
71 71 #include <nss_dbdefs.h>
72 72 #include <sys/socketvar.h>
73 73 #include <netinet/in.h>
74 74 #include <netinet/tcp.h>
75 75 #include <netinet/udp.h>
76 76 #include <netinet/sctp.h>
77 77 #include <net/route.h>
78 78 #include <sys/utrap.h>
79 79 #include <sys/lgrp_user.h>
80 80 #include <sys/door.h>
81 81 #include <sys/tsol/tndb.h>
82 82 #include <sys/rctl.h>
83 83 #include <sys/rctl_impl.h>
84 84 #include <sys/fork.h>
85 85 #include <sys/task.h>
86 86 #include <sys/random.h>
87 87 #include "ramdata.h"
88 88 #include "print.h"
89 89 #include "proto.h"
90 90 #include "systable.h"
91 91
92 92 void grow(private_t *, int nbyte);
93 93
94 94 #define GROW(nb) if (pri->sys_leng + (nb) >= pri->sys_ssize) grow(pri, (nb))
95 95
96 96
97 97 /*ARGSUSED*/
98 98 void
99 99 prt_nov(private_t *pri, int raw, long val) /* print nothing */
100 100 {
101 101 }
102 102
103 103 /*ARGSUSED*/
104 104 void
105 105 prt_dec(private_t *pri, int raw, long val) /* print as decimal */
106 106 {
107 107 GROW(24);
108 108 if (data_model == PR_MODEL_ILP32)
109 109 pri->sys_leng += sprintf(pri->sys_string + pri->sys_leng,
110 110 "%d", (int)val);
111 111 else
112 112 pri->sys_leng += sprintf(pri->sys_string + pri->sys_leng,
113 113 "%ld", val);
114 114 }
115 115
116 116 /*ARGSUSED*/
117 117 void
118 118 prt_uns(private_t *pri, int raw, long val) /* print as unsigned decimal */
119 119 {
120 120 GROW(24);
121 121 if (data_model == PR_MODEL_ILP32)
122 122 pri->sys_leng += sprintf(pri->sys_string + pri->sys_leng,
123 123 "%u", (int)val);
124 124 else
125 125 pri->sys_leng += sprintf(pri->sys_string + pri->sys_leng,
126 126 "%lu", val);
127 127 }
128 128
129 129 /* print as unsigned decimal, except for -1 */
130 130 void
131 131 prt_un1(private_t *pri, int raw, long val)
132 132 {
133 133 if ((int)val == -1)
134 134 prt_dec(pri, raw, val);
135 135 else
136 136 prt_uns(pri, raw, val);
137 137 }
138 138
139 139 /*ARGSUSED*/
140 140 void
141 141 prt_oct(private_t *pri, int raw, long val) /* print as octal */
142 142 {
143 143 GROW(24);
144 144 if (data_model == PR_MODEL_ILP32)
145 145 pri->sys_leng += sprintf(pri->sys_string + pri->sys_leng,
146 146 "%#o", (int)val);
147 147 else
148 148 pri->sys_leng += sprintf(pri->sys_string + pri->sys_leng,
149 149 "%#lo", val);
150 150 }
151 151
152 152 /*ARGSUSED*/
153 153 void
154 154 prt_hex(private_t *pri, int raw, long val) /* print as hexadecimal */
155 155 {
156 156 GROW(20);
157 157 if (data_model == PR_MODEL_ILP32)
158 158 pri->sys_leng += sprintf(pri->sys_string + pri->sys_leng,
159 159 "0x%.8X", (int)val);
160 160 else
161 161 pri->sys_leng += sprintf(pri->sys_string + pri->sys_leng,
162 162 "0x%.8lX", val);
163 163 }
164 164
165 165 /* print as hexadecimal (half size) */
166 166 /*ARGSUSED*/
167 167 void
168 168 prt_hhx(private_t *pri, int raw, long val)
169 169 {
170 170 GROW(20);
171 171 if (data_model == PR_MODEL_ILP32)
172 172 pri->sys_leng += sprintf(pri->sys_string + pri->sys_leng,
173 173 "0x%.4X", (int)val);
174 174 else
175 175 pri->sys_leng += sprintf(pri->sys_string + pri->sys_leng,
176 176 "0x%.4lX", val);
177 177 }
178 178
179 179 /* print as decimal if small, else hexadecimal */
180 180 /*ARGSUSED*/
181 181 void
182 182 prt_dex(private_t *pri, int raw, long val)
183 183 {
184 184 if (val & 0xff000000)
185 185 prt_hex(pri, 0, val);
186 186 else
187 187 prt_dec(pri, 0, val);
188 188 }
189 189
190 190 /* print long long offset */
191 191 /*ARGSUSED*/
192 192 void
193 193 prt_llo(private_t *pri, int raw, long val1, long val2)
194 194 {
195 195 int hival;
196 196 int loval;
197 197
198 198 #ifdef _LONG_LONG_LTOH
199 199 hival = (int)val2;
200 200 loval = (int)val1;
201 201 #else
202 202 hival = (int)val1;
203 203 loval = (int)val2;
204 204 #endif
205 205
206 206 if (hival == 0) {
207 207 prt_dex(pri, 0, loval);
208 208 } else {
209 209 GROW(18);
210 210 pri->sys_leng +=
211 211 sprintf(pri->sys_string + pri->sys_leng, "0x%.8X%.8X",
212 212 hival, loval);
213 213 }
214 214 }
215 215
216 216 void
217 217 escape_string(private_t *pri, const char *s)
218 218 {
219 219 /*
220 220 * We want to avoid outputting unprintable characters that may
221 221 * destroy the user's terminal. So we do one pass to find any
222 222 * unprintable characters, size the array appropriately, and
223 223 * then walk each character by hand. Those that are unprintable
224 224 * are replaced by a hex escape (\xNN). We also escape quotes for
225 225 * completeness.
226 226 */
227 227 int i, unprintable, quotes;
228 228 size_t len = strlen(s);
229 229 for (i = 0, unprintable = 0, quotes = 0; i < len; i++) {
230 230 if (!isprint(s[i]))
231 231 unprintable++;
232 232 if (s[i] == '"')
233 233 quotes++;
234 234 }
235 235
236 236 GROW(len + 3 * unprintable + quotes + 2);
237 237
238 238 pri->sys_string[pri->sys_leng++] = '"';
239 239 for (i = 0; i < len; i++) {
240 240 if (s[i] == '"')
241 241 pri->sys_string[pri->sys_leng++] = '\\';
242 242
243 243 if (isprint(s[i])) {
244 244 pri->sys_string[pri->sys_leng++] = s[i];
245 245 } else {
246 246 pri->sys_leng += sprintf(pri->sys_string +
247 247 pri->sys_leng, "\\x%02x", (uint8_t)s[i]);
248 248 }
249 249 }
250 250 pri->sys_string[pri->sys_leng++] = '"';
251 251 }
252 252
253 253 void
254 254 prt_stg(private_t *pri, int raw, long val) /* print as string */
255 255 {
256 256 char *s = raw? NULL : fetchstring(pri, (long)val, PATH_MAX);
257 257
258 258 if (s == NULL)
259 259 prt_hex(pri, 0, val);
260 260 else
261 261 escape_string(pri, s);
262 262 }
263 263
264 264 /* print as string returned from syscall */
265 265 void
266 266 prt_rst(private_t *pri, int raw, long val)
267 267 {
268 268 char *s = (raw || pri->Errno)? NULL :
269 269 fetchstring(pri, (long)val, PATH_MAX);
270 270
271 271 if (s == NULL)
272 272 prt_hex(pri, 0, val);
273 273 else {
274 274 GROW((int)strlen(s) + 2);
275 275 pri->sys_leng += snprintf(pri->sys_string + pri->sys_leng,
276 276 pri->sys_ssize - pri->sys_leng, "\"%s\"", s);
277 277 }
278 278 }
279 279
280 280 /* print contents of readlink() buffer */
281 281 void
282 282 prt_rlk(private_t *pri, int raw, long val)
283 283 {
284 284 char *s = (raw || pri->Errno || pri->Rval1 <= 0)? NULL :
285 285 fetchstring(pri, (long)val,
286 286 (pri->Rval1 > PATH_MAX)? PATH_MAX : (int)pri->Rval1);
287 287
288 288 if (s == NULL)
289 289 prt_hex(pri, 0, val);
290 290 else {
291 291 GROW((int)strlen(s) + 2);
292 292 pri->sys_leng += snprintf(pri->sys_string + pri->sys_leng,
293 293 pri->sys_ssize - pri->sys_leng, "\"%s\"", s);
294 294 }
295 295 }
296 296
297 297 void
298 298 prt_ioc(private_t *pri, int raw, long val) /* print ioctl code */
299 299 {
300 300 const char *s = raw? NULL : ioctlname(pri, (int)val);
301 301
302 302 if (s == NULL)
303 303 prt_hex(pri, 0, val);
304 304 else
305 305 outstring(pri, s);
306 306 }
307 307
308 308 void
309 309 prt_ioa(private_t *pri, int raw, long val) /* print ioctl argument */
310 310 {
311 311 const char *s;
312 312
313 313 /* cheating -- look at the ioctl() code */
314 314 switch (pri->sys_args[1]) {
315 315
316 316 /* kstat ioctl()s */
317 317 case KSTAT_IOC_READ:
318 318 case KSTAT_IOC_WRITE:
319 319 #ifdef _LP64
320 320 if (data_model == PR_MODEL_ILP32)
321 321 prt_stg(pri, raw,
322 322 val + offsetof(kstat32_t, ks_name[0]));
323 323 else
324 324 #endif
325 325 prt_stg(pri, raw,
326 326 val + offsetof(kstat_t, ks_name[0]));
327 327 break;
328 328
329 329 /* streams ioctl()s */
330 330 case I_LOOK:
331 331 prt_rst(pri, raw, val);
332 332 break;
333 333 case I_PUSH:
334 334 case I_FIND:
335 335 prt_stg(pri, raw, val);
336 336 break;
337 337 case I_LINK:
338 338 case I_UNLINK:
339 339 case I_SENDFD:
340 340 prt_dec(pri, 0, val);
341 341 break;
342 342 case I_SRDOPT:
343 343 if (raw || (s = strrdopt(val)) == NULL)
344 344 prt_dec(pri, 0, val);
345 345 else
346 346 outstring(pri, s);
347 347 break;
348 348 case I_SETSIG:
349 349 if (raw || (s = strevents(pri, val)) == NULL)
350 350 prt_hex(pri, 0, val);
351 351 else
352 352 outstring(pri, s);
353 353 break;
354 354 case I_FLUSH:
355 355 if (raw || (s = strflush(val)) == NULL)
356 356 prt_dec(pri, 0, val);
357 357 else
358 358 outstring(pri, s);
359 359 break;
360 360
361 361 /* tty ioctl()s */
362 362 case TCSBRK:
363 363 case TCXONC:
364 364 case TCFLSH:
365 365 case TCDSET:
366 366 prt_dec(pri, 0, val);
367 367 break;
368 368
369 369 default:
370 370 prt_hex(pri, 0, val);
371 371 break;
372 372 }
373 373 }
374 374
375 375 void
376 376 prt_pip(private_t *pri, int raw, long val) /* print pipe code */
377 377 {
378 378 const char *s = NULL;
379 379
380 380 if (!raw) {
381 381 switch (val) {
382 382 case O_CLOEXEC:
383 383 s = "O_CLOEXEC";
384 384 break;
385 385 case O_NONBLOCK:
386 386 s = "O_NONBLOCK";
387 387 break;
388 388 case O_CLOEXEC|O_NONBLOCK:
389 389 s = "O_CLOEXEC|O_NONBLOCK";
390 390 break;
391 391 }
392 392 }
393 393
394 394 if (s == NULL)
395 395 prt_dex(pri, 0, val);
396 396 else
397 397 outstring(pri, s);
398 398 }
399 399
400 400 void
401 401 prt_pfd(private_t *pri, int raw, long val) /* print pipe code */
402 402 {
403 403 int fds[2];
404 404 char str[32];
405 405
406 406 /* the fds only have meaning if the return value is 0 */
407 407 if (!raw &&
408 408 pri->Rval1 >= 0 &&
409 409 Pread(Proc, fds, sizeof (fds), (long)val) == sizeof (fds)) {
410 410 (void) snprintf(str, sizeof (str), "[%d,%d]", fds[0], fds[1]);
411 411 outstring(pri, str);
412 412 } else {
413 413 prt_hex(pri, 0, val);
414 414 }
415 415 }
416 416
417 417 void
418 418 prt_fcn(private_t *pri, int raw, long val) /* print fcntl code */
419 419 {
420 420 const char *s = raw? NULL : fcntlname(val);
421 421
422 422 if (s == NULL)
423 423 prt_dec(pri, 0, val);
424 424 else
425 425 outstring(pri, s);
426 426 }
427 427
428 428 void
429 429 prt_s86(private_t *pri, int raw, long val) /* print sysi86 code */
430 430 {
431 431
432 432 const char *s = raw? NULL : si86name(val);
433 433
434 434 if (s == NULL)
435 435 prt_dec(pri, 0, val);
436 436 else
437 437 outstring(pri, s);
438 438 }
439 439
440 440 void
441 441 prt_uts(private_t *pri, int raw, long val) /* print utssys code */
442 442 {
443 443 const char *s = raw? NULL : utscode(val);
444 444
445 445 if (s == NULL)
446 446 prt_dec(pri, 0, val);
447 447 else
448 448 outstring(pri, s);
449 449 }
450 450
451 451 void
452 452 prt_msc(private_t *pri, int raw, long val) /* print msgsys command */
453 453 {
454 454 const char *s = raw? NULL : msgcmd(val);
455 455
456 456 if (s == NULL)
457 457 prt_dec(pri, 0, val);
458 458 else
459 459 outstring(pri, s);
460 460 }
461 461
462 462 void
463 463 prt_msf(private_t *pri, int raw, long val) /* print msgsys flags */
464 464 {
465 465 const char *s = raw? NULL : msgflags(pri, (int)val);
466 466
467 467 if (s == NULL)
468 468 prt_oct(pri, 0, val);
469 469 else
470 470 outstring(pri, s);
471 471 }
472 472
473 473 void
474 474 prt_smc(private_t *pri, int raw, long val) /* print semsys command */
475 475 {
476 476 const char *s = raw? NULL : semcmd(val);
477 477
478 478 if (s == NULL)
479 479 prt_dec(pri, 0, val);
480 480 else
481 481 outstring(pri, s);
482 482 }
483 483
484 484 void
485 485 prt_sef(private_t *pri, int raw, long val) /* print semsys flags */
486 486 {
487 487 const char *s = raw? NULL : semflags(pri, (int)val);
488 488
489 489 if (s == NULL)
490 490 prt_oct(pri, 0, val);
491 491 else
492 492 outstring(pri, s);
493 493 }
494 494
495 495 void
496 496 prt_shc(private_t *pri, int raw, long val) /* print shmsys command */
497 497 {
498 498 const char *s = raw? NULL : shmcmd(val);
499 499
500 500 if (s == NULL)
501 501 prt_dec(pri, 0, val);
502 502 else
503 503 outstring(pri, s);
504 504 }
505 505
506 506 void
507 507 prt_shf(private_t *pri, int raw, long val) /* print shmsys flags */
508 508 {
509 509 const char *s = raw? NULL : shmflags(pri, (int)val);
510 510
511 511 if (s == NULL)
512 512 prt_oct(pri, 0, val);
513 513 else
514 514 outstring(pri, s);
515 515 }
516 516
517 517 void
518 518 prt_sfs(private_t *pri, int raw, long val) /* print sysfs code */
519 519 {
520 520 const char *s = raw? NULL : sfsname(val);
521 521
522 522 if (s == NULL)
523 523 prt_dec(pri, 0, val);
524 524 else
525 525 outstring(pri, s);
526 526 }
527 527
528 528 void
529 529 prt_opn(private_t *pri, int raw, long val) /* print open code */
530 530 {
531 531 const char *s = raw? NULL : openarg(pri, val);
532 532
533 533 if (s == NULL)
534 534 prt_oct(pri, 0, val);
535 535 else
536 536 outstring(pri, s);
537 537 }
538 538
539 539 void
540 540 prt_sig(private_t *pri, int raw, long val) /* print signal name */
541 541 {
542 542 const char *s = raw? NULL : signame(pri, (int)val);
543 543
544 544 if (s == NULL)
545 545 prt_hex(pri, 0, val);
546 546 else
547 547 outstring(pri, s);
548 548 }
549 549
550 550 void
551 551 prt_smf(private_t *pri, int raw, long val) /* print streams message flags */
552 552 {
553 553 switch (val) {
554 554 case 0:
555 555 prt_dec(pri, 0, val);
556 556 break;
557 557 case RS_HIPRI:
558 558 if (raw)
559 559 prt_hhx(pri, 0, val);
560 560 else
561 561 outstring(pri, "RS_HIPRI");
562 562 break;
563 563 default:
564 564 prt_hhx(pri, 0, val);
565 565 break;
566 566 }
567 567 }
568 568
569 569 void
570 570 prt_mtf(private_t *pri, int raw, long val) /* print mount flags */
571 571 {
572 572 const char *s = raw? NULL : mountflags(pri, val);
573 573
574 574 if (s == NULL)
575 575 prt_hex(pri, 0, val);
576 576 else
577 577 outstring(pri, s);
578 578 }
579 579
580 580 void
581 581 prt_mft(private_t *pri, int raw, long val) /* print mount file system type */
582 582 {
583 583 if (val >= 0 && val < 256)
584 584 prt_dec(pri, 0, val);
585 585 else if (raw)
586 586 prt_hex(pri, 0, val);
587 587 else
588 588 prt_stg(pri, raw, val);
589 589 }
590 590
591 591 #define ISREAD(code) \
592 592 ((code) == SYS_read || (code) == SYS_pread || (code) == SYS_pread64 || \
593 593 (code) == SYS_recv || (code) == SYS_recvfrom)
594 594 #define ISWRITE(code) \
595 595 ((code) == SYS_write || (code) == SYS_pwrite || \
596 596 (code) == SYS_pwrite64 || (code) == SYS_send || (code) == SYS_sendto)
597 597
598 598 /* print contents of read() or write() I/O buffer */
599 599 void
600 600 prt_iob(private_t *pri, int raw, long val)
601 601 {
602 602 const lwpstatus_t *Lsp = pri->lwpstat;
603 603 int syscall = Lsp->pr_what;
604 604 int fdp1 = pri->sys_args[0] + 1;
605 605 ssize_t nbyte = ISWRITE(syscall)? pri->sys_args[2] :
606 606 (pri->Errno? 0 : pri->Rval1);
607 607 int elsewhere = FALSE; /* TRUE iff dumped elsewhere */
608 608 char buffer[IOBSIZE];
609 609
610 610 pri->iob_buf[0] = '\0';
611 611
612 612 if (Lsp->pr_why == PR_SYSEXIT && nbyte > IOBSIZE) {
613 613 if (ISREAD(syscall))
614 614 elsewhere = prismember(&readfd, fdp1);
615 615 else
616 616 elsewhere = prismember(&writefd, fdp1);
617 617 }
618 618
619 619 if (nbyte <= 0 || elsewhere)
620 620 prt_hex(pri, 0, val);
621 621 else {
622 622 int nb = nbyte > IOBSIZE? IOBSIZE : (int)nbyte;
623 623
624 624 if (Pread(Proc, buffer, (size_t)nb, (long)val) != nb)
625 625 prt_hex(pri, 0, val);
626 626 else {
627 627 pri->iob_buf[0] = '"';
628 628 showbytes(buffer, nb, pri->iob_buf + 1);
629 629 (void) strlcat(pri->iob_buf,
630 630 (nb == nbyte)?
631 631 (const char *)"\"" : (const char *)"\"..",
632 632 sizeof (pri->iob_buf));
633 633 if (raw)
634 634 prt_hex(pri, 0, val);
635 635 else
636 636 outstring(pri, pri->iob_buf);
637 637 }
638 638 }
639 639 }
640 640 #undef ISREAD
641 641 #undef ISWRITE
642 642
643 643 void
644 644 prt_idt(private_t *pri, int raw, long val) /* print idtype_t, waitid() arg */
645 645 {
646 646 const char *s = raw? NULL : idtype_enum(pri, val);
647 647
648 648 if (s == NULL)
649 649 prt_dec(pri, 0, val);
650 650 else
651 651 outstring(pri, s);
652 652 }
653 653
654 654 void
655 655 prt_wop(private_t *pri, int raw, long val) /* print waitid() options */
656 656 {
657 657 const char *s = raw? NULL : woptions(pri, (int)val);
658 658
659 659 if (s == NULL)
660 660 prt_oct(pri, 0, val);
661 661 else
662 662 outstring(pri, s);
663 663 }
664 664
665 665 void
666 666 prt_whn(private_t *pri, int raw, long val) /* print lseek() whence argument */
667 667 {
668 668 const char *s = raw? NULL : whencearg(val);
669 669
670 670 if (s == NULL)
671 671 prt_dec(pri, 0, val);
672 672 else
673 673 outstring(pri, s);
674 674 }
675 675
676 676 /*ARGSUSED*/
677 677 void
678 678 prt_spm(private_t *pri, int raw, long val) /* print sigprocmask argument */
679 679 {
680 680 const char *s = NULL;
681 681
682 682 if (!raw) {
683 683 switch (val) {
684 684 case SIG_BLOCK: s = "SIG_BLOCK"; break;
685 685 case SIG_UNBLOCK: s = "SIG_UNBLOCK"; break;
686 686 case SIG_SETMASK: s = "SIG_SETMASK"; break;
687 687 }
688 688 }
689 689
690 690 if (s == NULL)
691 691 prt_dec(pri, 0, val);
692 692 else
693 693 outstring(pri, s);
694 694 }
695 695
696 696 const char *
697 697 mmap_protect(private_t *pri, long arg)
698 698 {
699 699 char *str = pri->code_buf;
700 700
701 701 if (arg & ~(PROT_READ|PROT_WRITE|PROT_EXEC))
702 702 return ((char *)NULL);
703 703
704 704 if (arg == PROT_NONE)
705 705 return ("PROT_NONE");
706 706
707 707 *str = '\0';
708 708 if (arg & PROT_READ)
709 709 (void) strlcat(str, "|PROT_READ", sizeof (pri->code_buf));
710 710 if (arg & PROT_WRITE)
711 711 (void) strlcat(str, "|PROT_WRITE", sizeof (pri->code_buf));
712 712 if (arg & PROT_EXEC)
713 713 (void) strlcat(str, "|PROT_EXEC", sizeof (pri->code_buf));
714 714 return ((const char *)(str + 1));
715 715 }
716 716
717 717 const char *
718 718 mmap_type(private_t *pri, long arg)
719 719 {
720 720 char *str = pri->code_buf;
721 721 size_t used;
722 722
723 723 #define CBSIZE sizeof (pri->code_buf)
724 724 switch (arg & MAP_TYPE) {
725 725 case MAP_SHARED:
726 726 used = strlcpy(str, "MAP_SHARED", CBSIZE);
727 727 break;
728 728 case MAP_PRIVATE:
729 729 used = strlcpy(str, "MAP_PRIVATE", CBSIZE);
730 730 break;
731 731 default:
732 732 used = snprintf(str, CBSIZE, "%ld", arg&MAP_TYPE);
733 733 break;
734 734 }
735 735
736 736 arg &= ~(_MAP_NEW|MAP_TYPE);
737 737
738 738 if (arg & ~(MAP_FIXED|MAP_RENAME|MAP_NORESERVE|MAP_ANON|MAP_ALIGN|
739 739 MAP_TEXT|MAP_INITDATA|MAP_32BIT))
740 740 (void) snprintf(str + used, sizeof (pri->code_buf) - used,
741 741 "|0x%lX", arg);
742 742 else {
743 743 if (arg & MAP_FIXED)
744 744 (void) strlcat(str, "|MAP_FIXED", CBSIZE);
745 745 if (arg & MAP_RENAME)
746 746 (void) strlcat(str, "|MAP_RENAME", CBSIZE);
747 747 if (arg & MAP_NORESERVE)
748 748 (void) strlcat(str, "|MAP_NORESERVE", CBSIZE);
749 749 if (arg & MAP_ANON)
750 750 (void) strlcat(str, "|MAP_ANON", CBSIZE);
751 751 if (arg & MAP_ALIGN)
752 752 (void) strlcat(str, "|MAP_ALIGN", CBSIZE);
753 753 if (arg & MAP_TEXT)
754 754 (void) strlcat(str, "|MAP_TEXT", CBSIZE);
755 755 if (arg & MAP_INITDATA)
756 756 (void) strlcat(str, "|MAP_INITDATA", CBSIZE);
757 757 if (arg & MAP_32BIT)
758 758 (void) strlcat(str, "|MAP_32BIT", CBSIZE);
759 759 }
760 760
761 761 return ((const char *)str);
762 762 #undef CBSIZE
763 763 }
764 764
765 765 void
766 766 prt_mpr(private_t *pri, int raw, long val) /* print mmap()/mprotect() flags */
767 767 {
768 768 const char *s = raw? NULL : mmap_protect(pri, val);
769 769
770 770 if (s == NULL)
771 771 prt_hhx(pri, 0, val);
772 772 else
773 773 outstring(pri, s);
774 774 }
775 775
776 776 void
777 777 prt_mty(private_t *pri, int raw, long val) /* print mmap() mapping type flags */
778 778 {
779 779 const char *s = raw? NULL : mmap_type(pri, val);
780 780
781 781 if (s == NULL)
782 782 prt_hhx(pri, 0, val);
783 783 else
784 784 outstring(pri, s);
785 785 }
786 786
787 787 void
788 788 prt_mob(private_t *pri, int raw, long val) /* print mmapobj() flags */
789 789 {
790 790 if (val == 0)
791 791 prt_dec(pri, 0, val);
792 792 else if (raw || (val & ~(MMOBJ_PADDING|MMOBJ_INTERPRET)) != 0)
793 793 prt_hhx(pri, 0, val);
794 794 else {
795 795 #define CBSIZE sizeof (pri->code_buf)
796 796 char *s = pri->code_buf;
797 797
798 798 *s = '\0';
799 799 if (val & MMOBJ_PADDING)
800 800 (void) strlcat(s, "|MMOBJ_PADDING", CBSIZE);
801 801 if (val & MMOBJ_INTERPRET)
802 802 (void) strlcat(s, "|MMOBJ_INTERPRET", CBSIZE);
803 803 outstring(pri, s + 1);
804 804 #undef CBSIZE
805 805 }
806 806 }
807 807
808 808 /*ARGSUSED*/
809 809 void
810 810 prt_mcf(private_t *pri, int raw, long val) /* print memcntl() function */
811 811 {
812 812 const char *s = NULL;
813 813
814 814 if (!raw) {
815 815 switch (val) {
816 816 case MC_SYNC: s = "MC_SYNC"; break;
817 817 case MC_LOCK: s = "MC_LOCK"; break;
818 818 case MC_UNLOCK: s = "MC_UNLOCK"; break;
819 819 case MC_ADVISE: s = "MC_ADVISE"; break;
820 820 case MC_LOCKAS: s = "MC_LOCKAS"; break;
821 821 case MC_UNLOCKAS: s = "MC_UNLOCKAS"; break;
822 822 case MC_HAT_ADVISE: s = "MC_HAT_ADVISE"; break;
823 823 }
824 824 }
825 825
826 826 if (s == NULL)
827 827 prt_dec(pri, 0, val);
828 828 else
829 829 outstring(pri, s);
830 830 }
831 831
832 832 void
833 833 prt_mad(private_t *pri, int raw, long val) /* print madvise() argument */
834 834 {
835 835 const char *s = NULL;
836 836
837 837 if (!raw) {
838 838 switch (val) {
839 839 case MADV_NORMAL: s = "MADV_NORMAL"; break;
840 840 case MADV_RANDOM: s = "MADV_RANDOM"; break;
841 841 case MADV_SEQUENTIAL: s = "MADV_SEQUENTIAL"; break;
842 842 case MADV_WILLNEED: s = "MADV_WILLNEED"; break;
843 843 case MADV_DONTNEED: s = "MADV_DONTNEED"; break;
844 844 case MADV_FREE: s = "MADV_FREE"; break;
845 845 case MADV_ACCESS_DEFAULT: s = "MADV_ACCESS_DEFAULT"; break;
846 846 case MADV_ACCESS_LWP: s = "MADV_ACCESS_LWP"; break;
847 847 case MADV_ACCESS_MANY: s = "MADV_ACCESS_MANY"; break;
848 848 }
849 849 }
850 850
851 851 if (s == NULL)
852 852 prt_dec(pri, 0, val);
853 853 else
854 854 outstring(pri, s);
855 855 }
856 856
857 857 void
858 858 prt_mc4(private_t *pri, int raw, long val) /* print memcntl() (4th) argument */
859 859 {
860 860 if (val == 0)
861 861 prt_dec(pri, 0, val);
862 862 else if (raw)
863 863 prt_hhx(pri, 0, val);
864 864 else {
865 865 char *s = NULL;
866 866
867 867 #define CBSIZE sizeof (pri->code_buf)
868 868 /* cheating -- look at memcntl func */
869 869 switch (pri->sys_args[2]) {
870 870 case MC_ADVISE:
871 871 prt_mad(pri, 0, val);
872 872 return;
873 873
874 874 case MC_SYNC:
875 875 if ((val & ~(MS_SYNC|MS_ASYNC|MS_INVALIDATE)) == 0) {
876 876 *(s = pri->code_buf) = '\0';
877 877 if (val & MS_SYNC)
878 878 (void) strlcat(s, "|MS_SYNC", CBSIZE);
879 879 if (val & MS_ASYNC)
880 880 (void) strlcat(s, "|MS_ASYNC", CBSIZE);
881 881 if (val & MS_INVALIDATE)
882 882 (void) strlcat(s, "|MS_INVALIDATE",
883 883 CBSIZE);
884 884 }
885 885 break;
886 886
887 887 case MC_LOCKAS:
888 888 case MC_UNLOCKAS:
889 889 if ((val & ~(MCL_CURRENT|MCL_FUTURE)) == 0) {
890 890 *(s = pri->code_buf) = '\0';
891 891 if (val & MCL_CURRENT)
892 892 (void) strlcat(s, "|MCL_CURRENT",
893 893 CBSIZE);
894 894 if (val & MCL_FUTURE)
895 895 (void) strlcat(s, "|MCL_FUTURE",
896 896 CBSIZE);
897 897 }
898 898 break;
899 899 }
900 900 #undef CBSIZE
901 901
902 902 if (s == NULL || *s == '\0')
903 903 prt_hhx(pri, 0, val);
904 904 else
905 905 outstring(pri, ++s);
906 906 }
907 907 }
908 908
909 909 void
910 910 prt_mc5(private_t *pri, int raw, long val) /* print memcntl() (5th) argument */
911 911 {
912 912 char *s;
913 913
914 914 #define CBSIZE sizeof (pri->code_buf)
915 915 if (val == 0)
916 916 prt_dec(pri, 0, val);
917 917 else if (raw || (val & ~VALID_ATTR))
918 918 prt_hhx(pri, 0, val);
919 919 else {
920 920 s = pri->code_buf;
921 921 *s = '\0';
922 922 if (val & SHARED)
923 923 (void) strlcat(s, "|SHARED", CBSIZE);
924 924 if (val & PRIVATE)
925 925 (void) strlcat(s, "|PRIVATE", CBSIZE);
926 926 if (val & PROT_READ)
927 927 (void) strlcat(s, "|PROT_READ", CBSIZE);
928 928 if (val & PROT_WRITE)
929 929 (void) strlcat(s, "|PROT_WRITE", CBSIZE);
930 930 if (val & PROT_EXEC)
931 931 (void) strlcat(s, "|PROT_EXEC", CBSIZE);
932 932 if (*s == '\0')
933 933 prt_hhx(pri, 0, val);
934 934 else
935 935 outstring(pri, ++s);
936 936 }
937 937 #undef CBSIZE
938 938 }
939 939
940 940 void
941 941 prt_ulm(private_t *pri, int raw, long val) /* print ulimit() argument */
942 942 {
943 943 const char *s = NULL;
944 944
945 945 if (!raw) {
946 946 switch (val) {
947 947 case UL_GFILLIM: s = "UL_GFILLIM"; break;
948 948 case UL_SFILLIM: s = "UL_SFILLIM"; break;
949 949 case UL_GMEMLIM: s = "UL_GMEMLIM"; break;
950 950 case UL_GDESLIM: s = "UL_GDESLIM"; break;
951 951 }
952 952 }
953 953
954 954 if (s == NULL)
955 955 prt_dec(pri, 0, val);
956 956 else
957 957 outstring(pri, s);
958 958 }
959 959
960 960 void
961 961 prt_rlm(private_t *pri, int raw, long val) /* print get/setrlimit() argument */
962 962 {
963 963 const char *s = NULL;
964 964
965 965 if (!raw) {
966 966 switch (val) {
967 967 case RLIMIT_CPU: s = "RLIMIT_CPU"; break;
968 968 case RLIMIT_FSIZE: s = "RLIMIT_FSIZE"; break;
969 969 case RLIMIT_DATA: s = "RLIMIT_DATA"; break;
970 970 case RLIMIT_STACK: s = "RLIMIT_STACK"; break;
971 971 case RLIMIT_CORE: s = "RLIMIT_CORE"; break;
972 972 case RLIMIT_NOFILE: s = "RLIMIT_NOFILE"; break;
973 973 case RLIMIT_VMEM: s = "RLIMIT_VMEM"; break;
974 974 }
975 975 }
976 976
977 977 if (s == NULL)
978 978 prt_dec(pri, 0, val);
979 979 else
980 980 outstring(pri, s);
981 981 }
982 982
983 983 void
984 984 prt_cnf(private_t *pri, int raw, long val) /* print sysconfig code */
985 985 {
986 986 const char *s = raw? NULL : sconfname(val);
987 987
988 988 if (s == NULL)
989 989 prt_dec(pri, 0, val);
990 990 else
991 991 outstring(pri, s);
992 992 }
993 993
994 994 void
995 995 prt_inf(private_t *pri, int raw, long val) /* print sysinfo code */
996 996 {
997 997 const char *s = NULL;
998 998
999 999 if (!raw) {
1000 1000 switch (val) {
1001 1001 case SI_SYSNAME: s = "SI_SYSNAME"; break;
1002 1002 case SI_HOSTNAME: s = "SI_HOSTNAME"; break;
1003 1003 case SI_RELEASE: s = "SI_RELEASE"; break;
1004 1004 case SI_VERSION: s = "SI_VERSION"; break;
1005 1005 case SI_MACHINE: s = "SI_MACHINE"; break;
1006 1006 case SI_ARCHITECTURE: s = "SI_ARCHITECTURE"; break;
1007 1007 case SI_ARCHITECTURE_32:s = "SI_ARCHITECTURE_32"; break;
1008 1008 case SI_ARCHITECTURE_64:s = "SI_ARCHITECTURE_64"; break;
1009 1009 case SI_ARCHITECTURE_K: s = "SI_ARCHITECTURE_K"; break;
1010 1010 case SI_HW_SERIAL: s = "SI_HW_SERIAL"; break;
1011 1011 case SI_HW_PROVIDER: s = "SI_HW_PROVIDER"; break;
1012 1012 case SI_SRPC_DOMAIN: s = "SI_SRPC_DOMAIN"; break;
1013 1013 case SI_SET_HOSTNAME: s = "SI_SET_HOSTNAME"; break;
1014 1014 case SI_SET_SRPC_DOMAIN: s = "SI_SET_SRPC_DOMAIN"; break;
1015 1015 case SI_PLATFORM: s = "SI_PLATFORM"; break;
1016 1016 case SI_ISALIST: s = "SI_ISALIST"; break;
1017 1017 case SI_DHCP_CACHE: s = "SI_DHCP_CACHE"; break;
1018 1018 }
1019 1019 }
1020 1020
1021 1021 if (s == NULL)
1022 1022 prt_dec(pri, 0, val);
1023 1023 else
1024 1024 outstring(pri, s);
1025 1025 }
1026 1026
1027 1027 void
1028 1028 prt_ptc(private_t *pri, int raw, long val) /* print pathconf code */
1029 1029 {
1030 1030 const char *s = raw? NULL : pathconfname(val);
1031 1031
1032 1032 if (s == NULL)
1033 1033 prt_dec(pri, 0, val);
1034 1034 else
1035 1035 outstring(pri, s);
1036 1036 }
1037 1037
1038 1038 void
1039 1039 prt_fui(private_t *pri, int raw, long val) /* print fusers() input argument */
1040 1040 {
1041 1041 const char *s = raw? NULL : fuiname(val);
1042 1042
1043 1043 if (s == NULL)
1044 1044 prt_hhx(pri, 0, val);
1045 1045 else
1046 1046 outstring(pri, s);
1047 1047 }
1048 1048
1049 1049 void
1050 1050 prt_lwf(private_t *pri, int raw, long val) /* print lwp_create() flags */
1051 1051 {
1052 1052 char *s;
1053 1053
1054 1054 if (val == 0)
1055 1055 prt_dec(pri, 0, val);
1056 1056 else if (raw ||
1057 1057 (val & ~(LWP_DAEMON|LWP_DETACHED|LWP_SUSPENDED)))
1058 1058 prt_hhx(pri, 0, val);
1059 1059 else {
1060 1060 #define CBSIZE sizeof (pri->code_buf)
1061 1061 s = pri->code_buf;
1062 1062 *s = '\0';
1063 1063 if (val & LWP_DAEMON)
1064 1064 (void) strlcat(s, "|LWP_DAEMON", CBSIZE);
1065 1065 if (val & LWP_DETACHED)
1066 1066 (void) strlcat(s, "|LWP_DETACHED", CBSIZE);
1067 1067 if (val & LWP_SUSPENDED)
1068 1068 (void) strlcat(s, "|LWP_SUSPENDED", CBSIZE);
1069 1069 outstring(pri, ++s);
1070 1070 #undef CBSIZE
1071 1071 }
1072 1072 }
1073 1073
1074 1074 void
1075 1075 prt_itm(private_t *pri, int raw, long val) /* print [get|set]itimer() arg */
1076 1076 {
1077 1077 const char *s = NULL;
1078 1078
1079 1079 if (!raw) {
1080 1080 switch (val) {
1081 1081 case ITIMER_REAL: s = "ITIMER_REAL"; break;
1082 1082 case ITIMER_VIRTUAL: s = "ITIMER_VIRTUAL"; break;
1083 1083 case ITIMER_PROF: s = "ITIMER_PROF"; break;
1084 1084 #ifdef ITIMER_REALPROF
1085 1085 case ITIMER_REALPROF: s = "ITIMER_REALPROF"; break;
1086 1086 #endif
1087 1087 }
1088 1088 }
1089 1089
1090 1090 if (s == NULL)
1091 1091 prt_dec(pri, 0, val);
1092 1092 else
1093 1093 outstring(pri, s);
1094 1094 }
1095 1095
1096 1096 void
1097 1097 prt_mod(private_t *pri, int raw, long val) /* print modctl() code */
1098 1098 {
1099 1099 const char *s = NULL;
1100 1100
1101 1101 if (!raw) {
1102 1102 switch (val) {
1103 1103 case MODLOAD: s = "MODLOAD"; break;
1104 1104 case MODUNLOAD: s = "MODUNLOAD"; break;
1105 1105 case MODINFO: s = "MODINFO"; break;
1106 1106 case MODRESERVED: s = "MODRESERVED"; break;
1107 1107 case MODSETMINIROOT: s = "MODSETMINIROOT"; break;
1108 1108 case MODADDMAJBIND: s = "MODADDMAJBIND"; break;
1109 1109 case MODGETPATH: s = "MODGETPATH"; break;
1110 1110 case MODGETPATHLEN: s = "MODGETPATHLEN"; break;
1111 1111 case MODREADSYSBIND: s = "MODREADSYSBIND"; break;
1112 1112 case MODGETMAJBIND: s = "MODGETMAJBIND"; break;
1113 1113 case MODGETNAME: s = "MODGETNAME"; break;
1114 1114 case MODSIZEOF_DEVID: s = "MODSIZEOF_DEVID"; break;
1115 1115 case MODGETDEVID: s = "MODGETDEVID"; break;
1116 1116 case MODSIZEOF_MINORNAME: s = "MODSIZEOF_MINORNAME"; break;
1117 1117 case MODGETMINORNAME: s = "MODGETMINORNAME"; break;
1118 1118 case MODGETFBNAME: s = "MODGETFBNAME"; break;
1119 1119 case MODEVENTS: s = "MODEVENTS"; break;
1120 1120 case MODREREADDACF: s = "MODREREADDACF"; break;
1121 1121 case MODLOADDRVCONF: s = "MODLOADDRVCONF"; break;
1122 1122 case MODUNLOADDRVCONF: s = "MODUNLOADDRVCONF"; break;
1123 1123 case MODREMMAJBIND: s = "MODREMMAJBIND"; break;
1124 1124 case MODDEVT2INSTANCE: s = "MODDEVT2INSTANCE"; break;
1125 1125 case MODGETDEVFSPATH_LEN: s = "MODGETDEVFSPATH_LEN"; break;
1126 1126 case MODGETDEVFSPATH: s = "MODGETDEVFSPATH"; break;
1127 1127 case MODDEVID2PATHS: s = "MODDEVID2PATHS"; break;
1128 1128 case MODSETDEVPOLICY: s = "MODSETDEVPOLICY"; break;
1129 1129 case MODGETDEVPOLICY: s = "MODGETDEVPOLICY"; break;
1130 1130 case MODALLOCPRIV: s = "MODALLOCPRIV"; break;
1131 1131 case MODGETDEVPOLICYBYNAME:
1132 1132 s = "MODGETDEVPOLICYBYNAME"; break;
1133 1133 case MODLOADMINORPERM: s = "MODLOADMINORPERM"; break;
1134 1134 case MODADDMINORPERM: s = "MODADDMINORPERM"; break;
1135 1135 case MODREMMINORPERM: s = "MODREMMINORPERM"; break;
1136 1136 case MODREMDRVCLEANUP: s = "MODREMDRVCLEANUP"; break;
1137 1137 case MODDEVEXISTS: s = "MODDEVEXISTS"; break;
1138 1138 case MODDEVREADDIR: s = "MODDEVREADDIR"; break;
1139 1139 case MODDEVEMPTYDIR: s = "MODDEVEMPTYDIR"; break;
1140 1140 case MODDEVNAME: s = "MODDEVNAME"; break;
1141 1141 case MODGETDEVFSPATH_MI_LEN:
1142 1142 s = "MODGETDEVFSPATH_MI_LEN"; break;
1143 1143 case MODGETDEVFSPATH_MI:
1144 1144 s = "MODGETDEVFSPATH_MI"; break;
1145 1145 case MODREMDRVALIAS: s = "MODREMDRVALIAS"; break;
1146 1146 case MODHPOPS: s = "MODHPOPS"; break;
1147 1147 }
1148 1148 }
1149 1149
1150 1150 if (s == NULL)
1151 1151 prt_dec(pri, 0, val);
1152 1152 else
1153 1153 outstring(pri, s);
1154 1154 }
1155 1155
1156 1156 void
1157 1157 prt_acl(private_t *pri, int raw, long val) /* print acl() code */
1158 1158 {
1159 1159 const char *s = NULL;
1160 1160
1161 1161 if (!raw) {
1162 1162 switch (val) {
1163 1163 case GETACL: s = "GETACL"; break;
1164 1164 case SETACL: s = "SETACL"; break;
1165 1165 case GETACLCNT: s = "GETACLCNT"; break;
1166 1166 case ACE_GETACL: s = "ACE_GETACL"; break;
1167 1167 case ACE_SETACL: s = "ACE_SETACL"; break;
1168 1168 case ACE_GETACLCNT: s = "ACE_GETACLCNT"; break;
1169 1169 }
1170 1170 }
1171 1171
1172 1172 if (s == NULL)
1173 1173 prt_dec(pri, 0, val);
1174 1174 else
1175 1175 outstring(pri, s);
1176 1176 }
1177 1177
1178 1178 void
1179 1179 prt_aio(private_t *pri, int raw, long val) /* print kaio() code */
1180 1180 {
1181 1181 const char *s = NULL;
1182 1182 char buf[32];
1183 1183
1184 1184 if (!raw) {
1185 1185 switch (val & ~AIO_POLL_BIT) {
1186 1186 case AIOREAD: s = "AIOREAD"; break;
1187 1187 case AIOWRITE: s = "AIOWRITE"; break;
1188 1188 case AIOWAIT: s = "AIOWAIT"; break;
1189 1189 case AIOCANCEL: s = "AIOCANCEL"; break;
1190 1190 case AIONOTIFY: s = "AIONOTIFY"; break;
1191 1191 case AIOINIT: s = "AIOINIT"; break;
1192 1192 case AIOSTART: s = "AIOSTART"; break;
1193 1193 case AIOLIO: s = "AIOLIO"; break;
1194 1194 case AIOSUSPEND: s = "AIOSUSPEND"; break;
1195 1195 case AIOERROR: s = "AIOERROR"; break;
1196 1196 case AIOLIOWAIT: s = "AIOLIOWAIT"; break;
1197 1197 case AIOAREAD: s = "AIOAREAD"; break;
1198 1198 case AIOAWRITE: s = "AIOAWRITE"; break;
1199 1199 /*
1200 1200 * We have to hardcode the values for the 64-bit versions of
1201 1201 * these calls, because <sys/aio.h> defines them to be identical
1202 1202 * when compiled 64-bit. If our target is 32-bit, we still need
1203 1203 * to decode them correctly.
1204 1204 */
1205 1205 case 13: s = "AIOLIO64"; break;
1206 1206 case 14: s = "AIOSUSPEND64"; break;
1207 1207 case 15: s = "AUIOERROR64"; break;
1208 1208 case 16: s = "AIOLIOWAIT64"; break;
1209 1209 case 17: s = "AIOAREAD64"; break;
1210 1210 case 18: s = "AIOAWRITE64"; break;
1211 1211 case 19: s = "AIOCANCEL64"; break;
1212 1212
1213 1213 /*
1214 1214 * AIOFSYNC doesn't correspond to a syscall.
1215 1215 */
1216 1216 case AIOWAITN: s = "AIOWAITN"; break;
1217 1217 }
1218 1218 if (s != NULL && (val & AIO_POLL_BIT)) {
1219 1219 (void) strlcpy(buf, s, sizeof (buf));
1220 1220 (void) strlcat(buf, "|AIO_POLL_BIT", sizeof (buf));
1221 1221 s = (const char *)buf;
1222 1222 }
1223 1223 }
1224 1224
1225 1225 if (s == NULL)
1226 1226 prt_dec(pri, 0, val);
1227 1227 else
1228 1228 outstring(pri, s);
1229 1229 }
1230 1230
1231 1231 void
1232 1232 prt_aud(private_t *pri, int raw, long val) /* print auditsys() code */
1233 1233 {
1234 1234 const char *s = NULL;
1235 1235
1236 1236 if (!raw) {
1237 1237 switch (val) {
1238 1238 case BSM_GETAUID: s = "BSM_GETAUID"; break;
1239 1239 case BSM_SETAUID: s = "BSM_SETAUID"; break;
1240 1240 case BSM_GETAUDIT: s = "BSM_GETAUDIT"; break;
1241 1241 case BSM_SETAUDIT: s = "BSM_SETAUDIT"; break;
1242 1242 case BSM_AUDIT: s = "BSM_AUDIT"; break;
1243 1243 case BSM_AUDITCTL: s = "BSM_AUDITCTL"; break;
1244 1244 case BSM_GETAUDIT_ADDR: s = "BSM_GETAUDIT_ADDR"; break;
1245 1245 case BSM_SETAUDIT_ADDR: s = "BSM_SETAUDIT_ADDR"; break;
1246 1246 }
1247 1247 }
1248 1248
1249 1249 if (s == NULL)
1250 1250 prt_dec(pri, 0, val);
1251 1251 else
1252 1252 outstring(pri, s);
1253 1253 }
1254 1254
1255 1255 void
1256 1256 prt_cor(private_t *pri, int raw, long val) /* print corectl() subcode */
1257 1257 {
1258 1258 const char *s = NULL;
1259 1259
1260 1260 if (!raw) {
1261 1261 switch (val) {
1262 1262 case CC_SET_OPTIONS:
1263 1263 s = "CC_SET_OPTIONS"; break;
1264 1264 case CC_GET_OPTIONS:
1265 1265 s = "CC_GET_OPTIONS"; break;
1266 1266 case CC_SET_GLOBAL_PATH:
1267 1267 s = "CC_SET_GLOBAL_PATH"; break;
1268 1268 case CC_GET_GLOBAL_PATH:
1269 1269 s = "CC_GET_GLOBAL_PATH"; break;
1270 1270 case CC_SET_PROCESS_PATH:
1271 1271 s = "CC_SET_PROCESS_PATH"; break;
1272 1272 case CC_GET_PROCESS_PATH:
1273 1273 s = "CC_GET_PROCESS_PATH"; break;
1274 1274 case CC_SET_GLOBAL_CONTENT:
1275 1275 s = "CC_SET_GLOBAL_CONTENT"; break;
1276 1276 case CC_GET_GLOBAL_CONTENT:
1277 1277 s = "CC_GET_GLOBAL_CONTENT"; break;
1278 1278 case CC_SET_PROCESS_CONTENT:
1279 1279 s = "CC_SET_PROCESS_CONTENT"; break;
1280 1280 case CC_GET_PROCESS_CONTENT:
1281 1281 s = "CC_GET_PROCESS_CONTENT"; break;
1282 1282 case CC_SET_DEFAULT_PATH:
1283 1283 s = "CC_SET_DEFAULT_PATH"; break;
1284 1284 case CC_GET_DEFAULT_PATH:
1285 1285 s = "CC_GET_DEFAULT_PATH"; break;
1286 1286 case CC_SET_DEFAULT_CONTENT:
1287 1287 s = "CC_SET_DEFAULT_CONTENT"; break;
1288 1288 case CC_GET_DEFAULT_CONTENT:
1289 1289 s = "CC_GET_DEFAULT_CONTENT"; break;
1290 1290 }
1291 1291 }
1292 1292
1293 1293 if (s == NULL)
1294 1294 prt_dec(pri, 0, val);
1295 1295 else
1296 1296 outstring(pri, s);
1297 1297 }
1298 1298
1299 1299 void
1300 1300 prt_cco(private_t *pri, int raw, long val) /* print corectl() options */
1301 1301 {
1302 1302 char *s;
1303 1303
1304 1304 if (val == 0)
1305 1305 prt_dec(pri, 0, val);
1306 1306 else if (raw || (val & ~CC_OPTIONS))
1307 1307 prt_hhx(pri, 0, val);
1308 1308 else {
1309 1309 #define CBSIZE sizeof (pri->code_buf)
1310 1310 s = pri->code_buf;
1311 1311 *s = '\0';
1312 1312 if (val & CC_GLOBAL_PATH)
1313 1313 (void) strlcat(s, "|CC_GLOBAL_PATH", CBSIZE);
1314 1314 if (val & CC_PROCESS_PATH)
1315 1315 (void) strlcat(s, "|CC_PROCESS_PATH", CBSIZE);
1316 1316 if (val & CC_GLOBAL_SETID)
1317 1317 (void) strlcat(s, "|CC_GLOBAL_SETID", CBSIZE);
1318 1318 if (val & CC_PROCESS_SETID)
1319 1319 (void) strlcat(s, "|CC_PROCESS_SETID", CBSIZE);
1320 1320 if (val & CC_GLOBAL_LOG)
1321 1321 (void) strlcat(s, "|CC_GLOBAL_LOG", CBSIZE);
1322 1322 if (*s == '\0')
1323 1323 prt_hhx(pri, 0, val);
1324 1324 else
1325 1325 outstring(pri, ++s);
1326 1326 #undef CBSIZE
1327 1327 }
1328 1328 }
1329 1329
1330 1330 void
1331 1331 prt_ccc(private_t *pri, int raw, long val) /* print corectl() content */
1332 1332 {
1333 1333 core_content_t ccc;
1334 1334
1335 1335 if (Pread(Proc, &ccc, sizeof (ccc), val) != sizeof (ccc))
1336 1336 prt_hex(pri, 0, val);
1337 1337 else if (!raw && proc_content2str(ccc, pri->code_buf,
1338 1338 sizeof (pri->code_buf)) >= 0)
1339 1339 outstring(pri, pri->code_buf);
1340 1340 else
1341 1341 prt_hhx(pri, 0, (long)ccc);
1342 1342 }
1343 1343
1344 1344 void
1345 1345 prt_rcc(private_t *pri, int raw, long val) /* print corectl() ret. cont. */
1346 1346 {
1347 1347 core_content_t ccc;
1348 1348
1349 1349 if (pri->Errno || Pread(Proc, &ccc, sizeof (ccc), val) != sizeof (ccc))
1350 1350 prt_hex(pri, 0, val);
1351 1351 else if (!raw && proc_content2str(ccc, pri->code_buf,
1352 1352 sizeof (pri->code_buf)) >= 0)
1353 1353 outstring(pri, pri->code_buf);
1354 1354 else
1355 1355 prt_hhx(pri, 0, (long)ccc);
1356 1356 }
1357 1357
1358 1358 void
1359 1359 prt_cpc(private_t *pri, int raw, long val) /* print cpc() subcode */
1360 1360 {
1361 1361 const char *s = NULL;
1362 1362
1363 1363 if (!raw) {
1364 1364 switch (val) {
1365 1365 case CPC_BIND: s = "CPC_BIND"; break;
1366 1366 case CPC_SAMPLE: s = "CPC_SAMPLE"; break;
1367 1367 case CPC_INVALIDATE: s = "CPC_INVALIDATE"; break;
1368 1368 case CPC_RELE: s = "CPC_RELE"; break;
1369 1369 case CPC_EVLIST_SIZE: s = "CPC_EVLIST_SIZE"; break;
1370 1370 case CPC_LIST_EVENTS: s = "CPC_LIST_EVENTS"; break;
1371 1371 case CPC_ATTRLIST_SIZE: s = "CPC_ATTRLIST_SIZE"; break;
1372 1372 case CPC_LIST_ATTRS: s = "CPC_LIST_ATTRS"; break;
1373 1373 case CPC_IMPL_NAME: s = "CPC_IMPL_NAME"; break;
1374 1374 case CPC_CPUREF: s = "CPC_CPUREF"; break;
1375 1375 case CPC_USR_EVENTS: s = "CPC_USR_EVENTS"; break;
1376 1376 case CPC_SYS_EVENTS: s = "CPC_SYS_EVENTS"; break;
1377 1377 case CPC_NPIC: s = "CPC_NPIC"; break;
1378 1378 case CPC_CAPS: s = "CPC_CAPS"; break;
1379 1379 case CPC_ENABLE: s = "CPC_ENABLE"; break;
1380 1380 case CPC_DISABLE: s = "CPC_DISABLE"; break;
1381 1381 }
1382 1382 }
1383 1383
1384 1384 if (s == NULL)
1385 1385 prt_dec(pri, 0, val);
1386 1386 else
1387 1387 outstring(pri, s);
1388 1388 }
1389 1389
1390 1390 void
1391 1391 outstring(private_t *pri, const char *s)
1392 1392 {
1393 1393 int len = strlen(s);
1394 1394
1395 1395 GROW(len);
1396 1396 (void) strcpy(pri->sys_string + pri->sys_leng, s);
1397 1397 pri->sys_leng += len;
1398 1398 }
1399 1399
1400 1400 void
1401 1401 grow(private_t *pri, int nbyte) /* reallocate format buffer if necessary */
1402 1402 {
1403 1403 while (pri->sys_leng + nbyte >= pri->sys_ssize)
1404 1404 pri->sys_string = my_realloc(pri->sys_string,
1405 1405 pri->sys_ssize *= 2, "format buffer");
1406 1406 }
1407 1407
1408 1408 void
1409 1409 prt_clc(private_t *pri, int raw, long val)
1410 1410 {
1411 1411 const char *s = NULL;
1412 1412
1413 1413 if (!raw) {
1414 1414 switch (val) {
1415 1415 case CL_INITIALIZE: s = "CL_INITIALIZE"; break;
1416 1416 case CL_CONFIG: s = "CL_CONFIG"; break;
1417 1417 }
1418 1418 }
1419 1419
1420 1420 if (s == NULL)
1421 1421 prt_dec(pri, 0, val);
1422 1422 else
1423 1423 outstring(pri, s);
1424 1424 }
1425 1425
1426 1426 void
1427 1427 prt_clf(private_t *pri, int raw, long val)
1428 1428 {
1429 1429 const char *s = NULL;
1430 1430
1431 1431 if (!raw) {
1432 1432 switch (pri->sys_args[0]) {
1433 1433 case CL_CONFIG:
1434 1434 switch (pri->sys_args[1]) {
1435 1435 case CL_NODEID:
1436 1436 s = "CL_NODEID"; break;
1437 1437 case CL_HIGHEST_NODEID:
1438 1438 s = "CL_HIGHEST_NODEID"; break;
1439 1439 }
1440 1440 break;
1441 1441 case CL_INITIALIZE:
1442 1442 switch (pri->sys_args[1]) {
1443 1443 case CL_GET_BOOTFLAG:
1444 1444 s = "CL_GET_BOOTFLAG"; break;
1445 1445 }
1446 1446 break;
1447 1447 }
1448 1448 }
1449 1449
1450 1450 if (s == NULL)
1451 1451 prt_dec(pri, 0, val);
1452 1452 else
1453 1453 outstring(pri, s);
1454 1454 }
1455 1455
1456 1456 void
1457 1457 prt_sqc(private_t *pri, int raw, long val) /* print sigqueue() si_code */
1458 1458 {
1459 1459 const char *s = NULL;
1460 1460
1461 1461 if (!raw) {
1462 1462 switch ((int)val) {
1463 1463 case SI_QUEUE: s = "SI_QUEUE"; break;
1464 1464 case SI_TIMER: s = "SI_TIMER"; break;
1465 1465 case SI_ASYNCIO: s = "SI_ASYNCIO"; break;
1466 1466 case SI_MESGQ: s = "SI_MESGQ"; break;
1467 1467 }
1468 1468 }
1469 1469
1470 1470 if (s == NULL)
1471 1471 prt_dec(pri, 0, val);
1472 1472 else
1473 1473 outstring(pri, s);
1474 1474 }
1475 1475
1476 1476 /*
1477 1477 * print priocntlsys() (key, value) pair key.
1478 1478 */
1479 1479 void
1480 1480 print_pck(private_t *pri, int raw, long val)
1481 1481 {
1482 1482 const char *s = NULL;
1483 1483 char clname[PC_CLNMSZ];
1484 1484
1485 1485 if ((pri->sys_args[2] != PC_GETXPARMS &&
1486 1486 pri->sys_args[2] != PC_SETXPARMS) || val == 0 || raw) {
1487 1487 prt_dec(pri, 0, val);
1488 1488 return;
1489 1489 }
1490 1490
1491 1491 if (pri->sys_args[3] == NULL) {
1492 1492 if (val == PC_KY_CLNAME) {
1493 1493 s = "PC_KY_CLNAME";
1494 1494 outstring(pri, s);
1495 1495 } else
1496 1496 prt_dec(pri, 0, val);
1497 1497 return;
1498 1498 }
1499 1499
1500 1500 if (Pread(Proc, &clname, PC_CLNMSZ, pri->sys_args[3]) != PC_CLNMSZ) {
1501 1501 prt_dec(pri, 0, val);
1502 1502 return;
1503 1503 }
1504 1504
1505 1505 if (strcmp(clname, "TS") == 0) {
1506 1506 switch (val) {
1507 1507 case TS_KY_UPRILIM: s = "TS_KY_UPRILIM"; break;
1508 1508 case TS_KY_UPRI: s = "TS_KY_UPRI"; break;
1509 1509 default: break;
1510 1510 }
1511 1511 } else if (strcmp(clname, "IA") == 0) {
1512 1512 switch (val) {
1513 1513 case IA_KY_UPRILIM: s = "IA_KY_UPRILIM"; break;
1514 1514 case IA_KY_UPRI: s = "IA_KY_UPRI"; break;
1515 1515 case IA_KY_MODE: s = "IA_KY_MODE"; break;
1516 1516 default: break;
1517 1517 }
1518 1518 } else if (strcmp(clname, "RT") == 0) {
1519 1519 switch (val) {
1520 1520 case RT_KY_PRI: s = "RT_KY_PRI"; break;
1521 1521 case RT_KY_TQSECS: s = "RT_KY_TQSECS"; break;
1522 1522 case RT_KY_TQNSECS: s = "RT_KY_TQNSECS"; break;
1523 1523 case RT_KY_TQSIG: s = "RT_KY_TQSIG"; break;
1524 1524 default: break;
1525 1525 }
1526 1526 } else if (strcmp(clname, "FSS") == 0) {
1527 1527 switch (val) {
1528 1528 case FSS_KY_UPRILIM: s = "FSS_KY_UPRILIM"; break;
1529 1529 case FSS_KY_UPRI: s = "FSS_KY_UPRI"; break;
1530 1530 default: break;
1531 1531 }
1532 1532 } else if (strcmp(clname, "FX") == 0) {
1533 1533 switch (val) {
1534 1534 case FX_KY_UPRILIM: s = "FX_KY_UPRILIM"; break;
1535 1535 case FX_KY_UPRI: s = "FX_KY_UPRI"; break;
1536 1536 case FX_KY_TQSECS: s = "FX_KY_TQSECS"; break;
1537 1537 case FX_KY_TQNSECS: s = "FX_KY_TQNSECS"; break;
1538 1538 default: break;
1539 1539 }
1540 1540 }
1541 1541
1542 1542 if (s == NULL)
1543 1543 prt_dec(pri, 0, val);
1544 1544 else
1545 1545 outstring(pri, s);
1546 1546 }
1547 1547
1548 1548 /*
1549 1549 * print priocntlsys() fourth argument.
1550 1550 */
1551 1551 /*ARGSUSED*/
1552 1552 void
1553 1553 prt_pc4(private_t *pri, int raw, long val)
1554 1554 {
1555 1555 /* look at pricntlsys function */
1556 1556 if ((pri->sys_args[2] != PC_GETXPARMS &&
1557 1557 pri->sys_args[2] != PC_SETXPARMS))
1558 1558 prt_hex(pri, 0, val);
1559 1559 else if (val)
1560 1560 prt_stg(pri, 0, val);
1561 1561 else
1562 1562 prt_dec(pri, 0, val);
1563 1563 }
1564 1564
1565 1565 /*
1566 1566 * print priocntlsys() (key, value) pairs (5th argument).
1567 1567 */
1568 1568 /*ARGSUSED*/
1569 1569 void
1570 1570 prt_pc5(private_t *pri, int raw, long val)
1571 1571 {
1572 1572 pc_vaparms_t prms;
1573 1573 pc_vaparm_t *vpp = &prms.pc_parms[0];
1574 1574 uint_t cnt;
1575 1575
1576 1576
1577 1577 /* look at pricntlsys function */
1578 1578 if ((pri->sys_args[2] != PC_GETXPARMS &&
1579 1579 pri->sys_args[2] != PC_SETXPARMS) || val == 0) {
1580 1580 prt_dec(pri, 0, 0);
1581 1581 return;
1582 1582 }
1583 1583
1584 1584 if (Pread(Proc, &prms, sizeof (prms), val) != sizeof (prms)) {
1585 1585 prt_hex(pri, 0, val);
1586 1586 return;
1587 1587 }
1588 1588
1589 1589 if ((cnt = prms.pc_vaparmscnt) > PC_VAPARMCNT)
1590 1590 return;
1591 1591
1592 1592 for (; cnt--; vpp++) {
1593 1593 print_pck(pri, 0, vpp->pc_key);
1594 1594 outstring(pri, ", ");
1595 1595 prt_hex(pri, 0, (long)vpp->pc_parm);
1596 1596 outstring(pri, ", ");
1597 1597 }
1598 1598
1599 1599 prt_dec(pri, 0, PC_KY_NULL);
1600 1600 }
1601 1601
1602 1602 /*
1603 1603 * Print processor set id, including logical expansion of "special" ids.
1604 1604 */
1605 1605 void
1606 1606 prt_pst(private_t *pri, int raw, long val)
1607 1607 {
1608 1608 const char *s = NULL;
1609 1609
1610 1610 if (!raw) {
1611 1611 switch ((psetid_t)val) {
1612 1612 case PS_NONE: s = "PS_NONE"; break;
1613 1613 case PS_QUERY: s = "PS_QUERY"; break;
1614 1614 case PS_MYID: s = "PS_MYID"; break;
1615 1615 }
1616 1616 }
1617 1617
1618 1618 if (s == NULL)
1619 1619 prt_dec(pri, 0, val);
1620 1620 else
1621 1621 outstring(pri, s);
1622 1622 }
1623 1623
1624 1624 /*
1625 1625 * Print meminfo() argument.
1626 1626 */
1627 1627 /*ARGSUSED*/
1628 1628 void
1629 1629 prt_mif(private_t *pri, int raw, long val)
1630 1630 {
1631 1631 struct meminfo minfo;
1632 1632
1633 1633 #ifdef _LP64
1634 1634 if (data_model == PR_MODEL_ILP32) {
1635 1635 struct meminfo32 minfo32;
1636 1636
1637 1637 if (Pread(Proc, &minfo32, sizeof (struct meminfo32), val) !=
1638 1638 sizeof (struct meminfo32)) {
1639 1639 prt_dec(pri, 0, pri->sys_args[1]); /* addr_count */
1640 1640 outstring(pri, ", ");
1641 1641 prt_hex(pri, 0, val);
1642 1642 return;
1643 1643 }
1644 1644 /*
1645 1645 * arrange the arguments in the order that user calls with
1646 1646 */
1647 1647 prt_hex(pri, 0, minfo32.mi_inaddr);
1648 1648 outstring(pri, ", ");
1649 1649 prt_dec(pri, 0, pri->sys_args[1]); /* addr_count */
1650 1650 outstring(pri, ", ");
1651 1651 prt_hex(pri, 0, minfo32.mi_info_req);
1652 1652 outstring(pri, ", ");
1653 1653 prt_dec(pri, 0, minfo32.mi_info_count);
1654 1654 outstring(pri, ", ");
1655 1655 prt_hex(pri, 0, minfo32.mi_outdata);
1656 1656 outstring(pri, ", ");
1657 1657 prt_hex(pri, 0, minfo32.mi_validity);
1658 1658 return;
1659 1659 }
1660 1660 #endif
1661 1661 if (Pread(Proc, &minfo, sizeof (struct meminfo), val) !=
1662 1662 sizeof (struct meminfo)) {
1663 1663 prt_dec(pri, 0, pri->sys_args[1]); /* addr_count */
1664 1664 outstring(pri, ", ");
1665 1665 prt_hex(pri, 0, val);
1666 1666 return;
1667 1667 }
1668 1668 /*
1669 1669 * arrange the arguments in the order that user calls with
1670 1670 */
1671 1671 prt_hex(pri, 0, (long)minfo.mi_inaddr);
1672 1672 outstring(pri, ", ");
1673 1673 prt_dec(pri, 0, pri->sys_args[1]); /* addr_count */
1674 1674 outstring(pri, ", ");
1675 1675 prt_hex(pri, 0, (long)minfo.mi_info_req);
1676 1676 outstring(pri, ", ");
1677 1677 prt_dec(pri, 0, minfo.mi_info_count);
1678 1678 outstring(pri, ", ");
1679 1679 prt_hex(pri, 0, (long)minfo.mi_outdata);
1680 1680 outstring(pri, ", ");
1681 1681 prt_hex(pri, 0, (long)minfo.mi_validity);
1682 1682 }
1683 1683
1684 1684
1685 1685 /*
1686 1686 * Print so_socket() 1st argument.
1687 1687 */
1688 1688 /*ARGSUSED*/
1689 1689 void
1690 1690 prt_pfm(private_t *pri, int raw, long val)
1691 1691 {
1692 1692 /* Protocol Families have same names as Address Families */
1693 1693 if ((ulong_t)val < MAX_AFCODES) {
1694 1694 outstring(pri, "PF_");
1695 1695 outstring(pri, afcodes[val]);
1696 1696 } else {
1697 1697 prt_dec(pri, 0, val);
1698 1698 }
1699 1699 }
1700 1700
1701 1701 /*
1702 1702 * Print sockconfig() subcode.
1703 1703 */
1704 1704 /*ARGSUSED*/
1705 1705 void
1706 1706 prt_skc(private_t *pri, int raw, long val)
1707 1707 {
1708 1708 const char *s = NULL;
1709 1709
1710 1710 if (!raw) {
1711 1711 switch (val) {
1712 1712 case SOCKCONFIG_ADD_SOCK:
1713 1713 s = "SOCKCONFIG_ADD_SOCK"; break;
1714 1714 case SOCKCONFIG_REMOVE_SOCK:
1715 1715 s = "SOCKCONFIG_REMOVE_SOCK"; break;
1716 1716 case SOCKCONFIG_ADD_FILTER:
1717 1717 s = "SOCKCONFIG_ADD_FILTER"; break;
1718 1718 case SOCKCONFIG_REMOVE_FILTER:
1719 1719 s = "SOCKCONFIG_REMOVE_FILTER"; break;
1720 1720 }
1721 1721 }
1722 1722 if (s == NULL)
1723 1723 prt_dec(pri, 0, val);
1724 1724 else
1725 1725 outstring(pri, s);
1726 1726 }
1727 1727 /*
1728 1728 * Print so_socket() 2nd argument.
1729 1729 */
1730 1730 /*ARGSUSED*/
1731 1731 void
1732 1732 prt_skt(private_t *pri, int raw, long val)
1733 1733 {
1734 1734 const char *s;
1735 1735 long type = val & SOCK_TYPE_MASK;
1736 1736
1737 1737 if ((ulong_t)type <= MAX_SOCKTYPES &&
1738 1738 (s = socktype_codes[type]) != NULL) {
1739 1739 outstring(pri, s);
1740 1740 if ((val & SOCK_CLOEXEC) != 0) {
1741 1741 outstring(pri, "|SOCK_CLOEXEC");
1742 1742 }
1743 1743 } else {
1744 1744 prt_dec(pri, 0, val);
1745 1745 }
1746 1746 }
1747 1747
1748 1748
1749 1749 /*
1750 1750 * Print so_socket() 3rd argument.
1751 1751 */
1752 1752 /*ARGSUSED*/
1753 1753 void
1754 1754 prt_skp(private_t *pri, int raw, long val)
1755 1755 {
1756 1756 const char *s;
1757 1757
1758 1758 /* cheating -- look at the protocol-family */
1759 1759 switch (pri->sys_args[0]) {
1760 1760 case PF_INET6:
1761 1761 case PF_INET:
1762 1762 case PF_NCA: if ((s = ipprotos((int)val)) != NULL) {
1763 1763 outstring(pri, s);
1764 1764 break;
1765 1765 }
1766 1766 /* FALLTHROUGH */
1767 1767 default: prt_dec(pri, 0, val);
1768 1768 break;
1769 1769 }
1770 1770 }
1771 1771
1772 1772
1773 1773 /*
1774 1774 * Print so_socket() 5th argument.
1775 1775 */
1776 1776 /*ARGSUSED*/
1777 1777 void
1778 1778 prt_skv(private_t *pri, int raw, long val)
1779 1779 {
1780 1780 switch (val) {
1781 1781 case SOV_STREAM: outstring(pri, "SOV_STREAM"); break;
1782 1782 case SOV_DEFAULT: outstring(pri, "SOV_DEFAULT"); break;
1783 1783 case SOV_SOCKSTREAM: outstring(pri, "SOV_SOCKSTREAM"); break;
1784 1784 case SOV_SOCKBSD: outstring(pri, "SOV_SOCKBSD"); break;
1785 1785 case SOV_XPG4_2: outstring(pri, "SOV_XPG4_2"); break;
1786 1786 default: prt_dec(pri, 0, val); break;
1787 1787 }
1788 1788 }
1789 1789
1790 1790 /*
1791 1791 * Print accept4() flags argument.
1792 1792 */
1793 1793 void
1794 1794 prt_acf(private_t *pri, int raw, long val)
1795 1795 {
1796 1796 int first = 1;
1797 1797 if (raw || !val ||
1798 1798 (val & ~(SOCK_CLOEXEC|SOCK_NDELAY|SOCK_NONBLOCK))) {
1799 1799 prt_dex(pri, 0, val);
1800 1800 return;
1801 1801 }
1802 1802
1803 1803 if (val & SOCK_CLOEXEC) {
1804 1804 outstring(pri, "|SOCK_CLOEXEC" + first);
1805 1805 first = 0;
1806 1806 }
1807 1807 if (val & SOCK_NDELAY) {
1808 1808 outstring(pri, "|SOCK_NDELAY" + first);
1809 1809 first = 0;
1810 1810 }
1811 1811 if (val & SOCK_NONBLOCK) {
1812 1812 outstring(pri, "|SOCK_NONBLOCK" + first);
1813 1813 }
1814 1814 }
1815 1815
1816 1816
1817 1817 /*
1818 1818 * Print setsockopt()/getsockopt() 2nd argument.
1819 1819 */
1820 1820 /*ARGSUSED*/
1821 1821 void
1822 1822 prt_sol(private_t *pri, int raw, long val)
1823 1823 {
1824 1824 if (val == SOL_SOCKET) {
1825 1825 outstring(pri, "SOL_SOCKET");
1826 1826 } else if (val == SOL_ROUTE) {
1827 1827 outstring(pri, "SOL_ROUTE");
1828 1828 } else {
1829 1829 const struct protoent *p;
1830 1830 struct protoent res;
1831 1831 char buf[NSS_BUFLEN_PROTOCOLS];
1832 1832
1833 1833 if ((p = getprotobynumber_r(val, &res,
1834 1834 (char *)buf, sizeof (buf))) != NULL)
1835 1835 outstring(pri, p->p_name);
1836 1836 else
1837 1837 prt_dec(pri, 0, val);
1838 1838 }
1839 1839 }
1840 1840
1841 1841
1842 1842 const char *
1843 1843 sol_optname(private_t *pri, long val)
1844 1844 {
1845 1845 #define CBSIZE sizeof (pri->code_buf)
1846 1846 if (val >= SO_SNDBUF) {
1847 1847 switch (val) {
1848 1848 case SO_SNDBUF: return ("SO_SNDBUF");
1849 1849 case SO_RCVBUF: return ("SO_RCVBUF");
1850 1850 case SO_SNDLOWAT: return ("SO_SNDLOWAT");
1851 1851 case SO_RCVLOWAT: return ("SO_RCVLOWAT");
1852 1852 case SO_SNDTIMEO: return ("SO_SNDTIMEO");
1853 1853 case SO_RCVTIMEO: return ("SO_RCVTIMEO");
1854 1854 case SO_ERROR: return ("SO_ERROR");
1855 1855 case SO_TYPE: return ("SO_TYPE");
1856 1856 case SO_PROTOTYPE: return ("SO_PROTOTYPE");
1857 1857 case SO_ANON_MLP: return ("SO_ANON_MLP");
1858 1858 case SO_MAC_EXEMPT: return ("SO_MAC_EXEMPT");
1859 1859 case SO_ALLZONES: return ("SO_ALLZONES");
1860 1860 case SO_MAC_IMPLICIT: return ("SO_MAC_IMPLICIT");
1861 1861 case SO_VRRP: return ("SO_VRRP");
1862 1862 case SO_EXCLBIND: return ("SO_EXCLBIND");
1863 1863 case SO_DOMAIN: return ("SO_DOMAIN");
1864 1864
1865 1865 default: (void) snprintf(pri->code_buf, CBSIZE,
1866 1866 "0x%lx", val);
1867 1867 return (pri->code_buf);
1868 1868 }
1869 1869 } else {
1870 1870 char *s = pri->code_buf;
1871 1871 size_t used = 1;
1872 1872 long val2;
1873 1873
1874 1874 *s = '\0';
1875 1875 val2 = val & ~(SO_DEBUG|SO_ACCEPTCONN|SO_REUSEADDR|SO_KEEPALIVE|
1876 1876 SO_DONTROUTE|SO_BROADCAST|SO_USELOOPBACK|SO_LINGER|
1877 1877 SO_OOBINLINE|SO_DGRAM_ERRIND|SO_RECVUCRED);
1878 1878 if (val2)
1879 1879 used = snprintf(s, CBSIZE, "|0x%lx", val2);
1880 1880 if (val & SO_DEBUG)
1881 1881 used = strlcat(s, "|SO_DEBUG", CBSIZE);
1882 1882 if (val & SO_ACCEPTCONN)
1883 1883 used = strlcat(s, "|SO_ACCEPTCONN", CBSIZE);
1884 1884 if (val & SO_REUSEADDR)
1885 1885 used = strlcat(s, "|SO_REUSEADDR", CBSIZE);
1886 1886 if (val & SO_KEEPALIVE)
1887 1887 used = strlcat(s, "|SO_KEEPALIVE", CBSIZE);
1888 1888 if (val & SO_DONTROUTE)
1889 1889 used = strlcat(s, "|SO_DONTROUTE", CBSIZE);
1890 1890 if (val & SO_BROADCAST)
1891 1891 used = strlcat(s, "|SO_BROADCAST", CBSIZE);
1892 1892 if (val & SO_USELOOPBACK)
1893 1893 used = strlcat(s, "|SO_USELOOPBACK", CBSIZE);
1894 1894 if (val & SO_LINGER)
1895 1895 used = strlcat(s, "|SO_LINGER", CBSIZE);
1896 1896 if (val & SO_OOBINLINE)
1897 1897 used = strlcat(s, "|SO_OOBINLINE", CBSIZE);
1898 1898 if (val & SO_DGRAM_ERRIND)
1899 1899 used = strlcat(s, "|SO_DGRAM_ERRIND", CBSIZE);
1900 1900 if (val & SO_RECVUCRED)
1901 1901 used = strlcat(s, "|SO_RECVUCRED", CBSIZE);
1902 1902 if (used >= CBSIZE || val == 0)
1903 1903 (void) snprintf(s + 1, CBSIZE-1, "0x%lx", val);
1904 1904 return ((const char *)(s + 1));
1905 1905 }
1906 1906 #undef CBSIZE
1907 1907 }
1908 1908
1909 1909 const char *
1910 1910 route_optname(private_t *pri, long val)
1911 1911 {
1912 1912 switch (val) {
1913 1913 case RT_AWARE:
1914 1914 return ("RT_AWARE");
1915 1915 default:
1916 1916 (void) snprintf(pri->code_buf, sizeof (pri->code_buf),
1917 1917 "0x%lx", val);
1918 1918 return (pri->code_buf);
1919 1919 }
1920 1920 }
1921 1921
1922 1922 const char *
1923 1923 tcp_optname(private_t *pri, long val)
1924 1924 {
1925 1925 switch (val) {
1926 1926 case TCP_NODELAY: return ("TCP_NODELAY");
1927 1927 case TCP_MAXSEG: return ("TCP_MAXSEG");
1928 1928 case TCP_KEEPALIVE: return ("TCP_KEEPALIVE");
1929 1929 case TCP_NOTIFY_THRESHOLD: return ("TCP_NOTIFY_THRESHOLD");
1930 1930 case TCP_ABORT_THRESHOLD: return ("TCP_ABORT_THRESHOLD");
1931 1931 case TCP_CONN_NOTIFY_THRESHOLD: return ("TCP_CONN_NOTIFY_THRESHOLD");
1932 1932 case TCP_CONN_ABORT_THRESHOLD: return ("TCP_CONN_ABORT_THRESHOLD");
1933 1933 case TCP_RECVDSTADDR: return ("TCP_RECVDSTADDR");
1934 1934 case TCP_ANONPRIVBIND: return ("TCP_ANONPRIVBIND");
↓ open down ↓ |
1934 lines elided |
↑ open up ↑ |
1935 1935 case TCP_EXCLBIND: return ("TCP_EXCLBIND");
1936 1936 case TCP_INIT_CWND: return ("TCP_INIT_CWND");
1937 1937 case TCP_KEEPALIVE_THRESHOLD: return ("TCP_KEEPALIVE_THRESHOLD");
1938 1938 case TCP_KEEPALIVE_ABORT_THRESHOLD:
1939 1939 return ("TCP_KEEPALIVE_ABORT_THRESHOLD");
1940 1940 case TCP_CORK: return ("TCP_CORK");
1941 1941 case TCP_RTO_INITIAL: return ("TCP_RTO_INITIAL");
1942 1942 case TCP_RTO_MIN: return ("TCP_RTO_MIN");
1943 1943 case TCP_RTO_MAX: return ("TCP_RTO_MAX");
1944 1944 case TCP_LINGER2: return ("TCP_LINGER2");
1945 + case TCP_KEEPIDLE: return ("TCP_KEEPIDLE");
1946 + case TCP_KEEPCNT: return ("TCP_KEEPCNT");
1947 + case TCP_KEEPINTVL: return ("TCP_KEEPINTVL");
1945 1948
1946 1949 default: (void) snprintf(pri->code_buf,
1947 1950 sizeof (pri->code_buf),
1948 1951 "0x%lx", val);
1949 1952 return (pri->code_buf);
1950 1953 }
1951 1954 }
1952 1955
1953 1956
1954 1957 const char *
1955 1958 sctp_optname(private_t *pri, long val)
1956 1959 {
1957 1960 switch (val) {
1958 1961 case SCTP_RTOINFO: return ("SCTP_RTOINFO");
1959 1962 case SCTP_ASSOCINFO: return ("SCTP_ASSOCINFO");
1960 1963 case SCTP_INITMSG: return ("SCTP_INITMSG");
1961 1964 case SCTP_NODELAY: return ("SCTP_NODELAY");
1962 1965 case SCTP_AUTOCLOSE: return ("SCTP_AUTOCLOSE");
1963 1966 case SCTP_SET_PEER_PRIMARY_ADDR:
1964 1967 return ("SCTP_SET_PEER_PRIMARY_ADDR");
1965 1968 case SCTP_PRIMARY_ADDR: return ("SCTP_PRIMARY_ADDR");
1966 1969 case SCTP_ADAPTATION_LAYER: return ("SCTP_ADAPTATION_LAYER");
1967 1970 case SCTP_DISABLE_FRAGMENTS: return ("SCTP_DISABLE_FRAGMENTS");
1968 1971 case SCTP_PEER_ADDR_PARAMS: return ("SCTP_PEER_ADDR_PARAMS");
1969 1972 case SCTP_DEFAULT_SEND_PARAM: return ("SCTP_DEFAULT_SEND_PARAM");
1970 1973 case SCTP_EVENTS: return ("SCTP_EVENTS");
1971 1974 case SCTP_I_WANT_MAPPED_V4_ADDR:
1972 1975 return ("SCTP_I_WANT_MAPPED_V4_ADDR");
1973 1976 case SCTP_MAXSEG: return ("SCTP_MAXSEG");
1974 1977 case SCTP_STATUS: return ("SCTP_STATUS");
1975 1978 case SCTP_GET_PEER_ADDR_INFO: return ("SCTP_GET_PEER_ADDR_INFO");
1976 1979
1977 1980 case SCTP_ADD_ADDR: return ("SCTP_ADD_ADDR");
1978 1981 case SCTP_REM_ADDR: return ("SCTP_REM_ADDR");
1979 1982
1980 1983 default: (void) snprintf(pri->code_buf,
1981 1984 sizeof (pri->code_buf),
1982 1985 "0x%lx", val);
1983 1986 return (pri->code_buf);
1984 1987 }
1985 1988 }
1986 1989
1987 1990
1988 1991 const char *
1989 1992 udp_optname(private_t *pri, long val)
1990 1993 {
1991 1994 switch (val) {
1992 1995 case UDP_CHECKSUM: return ("UDP_CHECKSUM");
1993 1996 case UDP_ANONPRIVBIND: return ("UDP_ANONPRIVBIND");
1994 1997 case UDP_EXCLBIND: return ("UDP_EXCLBIND");
1995 1998 case UDP_RCVHDR: return ("UDP_RCVHDR");
1996 1999 case UDP_NAT_T_ENDPOINT: return ("UDP_NAT_T_ENDPOINT");
1997 2000
1998 2001 default: (void) snprintf(pri->code_buf,
1999 2002 sizeof (pri->code_buf), "0x%lx",
2000 2003 val);
2001 2004 return (pri->code_buf);
2002 2005 }
2003 2006 }
2004 2007
2005 2008
2006 2009 /*
2007 2010 * Print setsockopt()/getsockopt() 3rd argument.
2008 2011 */
2009 2012 /*ARGSUSED*/
2010 2013 void
2011 2014 prt_son(private_t *pri, int raw, long val)
2012 2015 {
2013 2016 /* cheating -- look at the level */
2014 2017 switch (pri->sys_args[1]) {
2015 2018 case SOL_SOCKET: outstring(pri, sol_optname(pri, val));
2016 2019 break;
2017 2020 case SOL_ROUTE: outstring(pri, route_optname(pri, val));
2018 2021 break;
2019 2022 case IPPROTO_TCP: outstring(pri, tcp_optname(pri, val));
2020 2023 break;
2021 2024 case IPPROTO_UDP: outstring(pri, udp_optname(pri, val));
2022 2025 break;
2023 2026 case IPPROTO_SCTP: outstring(pri, sctp_optname(pri, val));
2024 2027 break;
2025 2028 default: prt_dec(pri, 0, val);
2026 2029 break;
2027 2030 }
2028 2031 }
2029 2032
2030 2033
2031 2034 /*
2032 2035 * Print utrap type
2033 2036 */
2034 2037 /*ARGSUSED*/
2035 2038 void
2036 2039 prt_utt(private_t *pri, int raw, long val)
2037 2040 {
2038 2041 const char *s = NULL;
2039 2042
2040 2043 #ifdef __sparc
2041 2044 if (!raw) {
2042 2045 switch (val) {
2043 2046 case UT_INSTRUCTION_DISABLED:
2044 2047 s = "UT_INSTRUCTION_DISABLED"; break;
2045 2048 case UT_INSTRUCTION_ERROR:
2046 2049 s = "UT_INSTRUCTION_ERROR"; break;
2047 2050 case UT_INSTRUCTION_PROTECTION:
2048 2051 s = "UT_INSTRUCTION_PROTECTION"; break;
2049 2052 case UT_ILLTRAP_INSTRUCTION:
2050 2053 s = "UT_ILLTRAP_INSTRUCTION"; break;
2051 2054 case UT_ILLEGAL_INSTRUCTION:
2052 2055 s = "UT_ILLEGAL_INSTRUCTION"; break;
2053 2056 case UT_PRIVILEGED_OPCODE:
2054 2057 s = "UT_PRIVILEGED_OPCODE"; break;
2055 2058 case UT_FP_DISABLED:
2056 2059 s = "UT_FP_DISABLED"; break;
2057 2060 case UT_FP_EXCEPTION_IEEE_754:
2058 2061 s = "UT_FP_EXCEPTION_IEEE_754"; break;
2059 2062 case UT_FP_EXCEPTION_OTHER:
2060 2063 s = "UT_FP_EXCEPTION_OTHER"; break;
2061 2064 case UT_TAG_OVERFLOW:
2062 2065 s = "UT_TAG_OVERFLOW"; break;
2063 2066 case UT_DIVISION_BY_ZERO:
2064 2067 s = "UT_DIVISION_BY_ZERO"; break;
2065 2068 case UT_DATA_EXCEPTION:
2066 2069 s = "UT_DATA_EXCEPTION"; break;
2067 2070 case UT_DATA_ERROR:
2068 2071 s = "UT_DATA_ERROR"; break;
2069 2072 case UT_DATA_PROTECTION:
2070 2073 s = "UT_DATA_PROTECTION"; break;
2071 2074 case UT_MEM_ADDRESS_NOT_ALIGNED:
2072 2075 s = "UT_MEM_ADDRESS_NOT_ALIGNED"; break;
2073 2076 case UT_PRIVILEGED_ACTION:
2074 2077 s = "UT_PRIVILEGED_ACTION"; break;
2075 2078 case UT_ASYNC_DATA_ERROR:
2076 2079 s = "UT_ASYNC_DATA_ERROR"; break;
2077 2080 case UT_TRAP_INSTRUCTION_16:
2078 2081 s = "UT_TRAP_INSTRUCTION_16"; break;
2079 2082 case UT_TRAP_INSTRUCTION_17:
2080 2083 s = "UT_TRAP_INSTRUCTION_17"; break;
2081 2084 case UT_TRAP_INSTRUCTION_18:
2082 2085 s = "UT_TRAP_INSTRUCTION_18"; break;
2083 2086 case UT_TRAP_INSTRUCTION_19:
2084 2087 s = "UT_TRAP_INSTRUCTION_19"; break;
2085 2088 case UT_TRAP_INSTRUCTION_20:
2086 2089 s = "UT_TRAP_INSTRUCTION_20"; break;
2087 2090 case UT_TRAP_INSTRUCTION_21:
2088 2091 s = "UT_TRAP_INSTRUCTION_21"; break;
2089 2092 case UT_TRAP_INSTRUCTION_22:
2090 2093 s = "UT_TRAP_INSTRUCTION_22"; break;
2091 2094 case UT_TRAP_INSTRUCTION_23:
2092 2095 s = "UT_TRAP_INSTRUCTION_23"; break;
2093 2096 case UT_TRAP_INSTRUCTION_24:
2094 2097 s = "UT_TRAP_INSTRUCTION_24"; break;
2095 2098 case UT_TRAP_INSTRUCTION_25:
2096 2099 s = "UT_TRAP_INSTRUCTION_25"; break;
2097 2100 case UT_TRAP_INSTRUCTION_26:
2098 2101 s = "UT_TRAP_INSTRUCTION_26"; break;
2099 2102 case UT_TRAP_INSTRUCTION_27:
2100 2103 s = "UT_TRAP_INSTRUCTION_27"; break;
2101 2104 case UT_TRAP_INSTRUCTION_28:
2102 2105 s = "UT_TRAP_INSTRUCTION_28"; break;
2103 2106 case UT_TRAP_INSTRUCTION_29:
2104 2107 s = "UT_TRAP_INSTRUCTION_29"; break;
2105 2108 case UT_TRAP_INSTRUCTION_30:
2106 2109 s = "UT_TRAP_INSTRUCTION_30"; break;
2107 2110 case UT_TRAP_INSTRUCTION_31:
2108 2111 s = "UT_TRAP_INSTRUCTION_31"; break;
2109 2112 }
2110 2113 }
2111 2114 #endif /* __sparc */
2112 2115
2113 2116 if (s == NULL)
2114 2117 prt_dec(pri, 0, val);
2115 2118 else
2116 2119 outstring(pri, s);
2117 2120 }
2118 2121
2119 2122
2120 2123 /*
2121 2124 * Print utrap handler
2122 2125 */
2123 2126 void
2124 2127 prt_uth(private_t *pri, int raw, long val)
2125 2128 {
2126 2129 const char *s = NULL;
2127 2130
2128 2131 if (!raw) {
2129 2132 switch (val) {
2130 2133 case (long)UTH_NOCHANGE: s = "UTH_NOCHANGE"; break;
2131 2134 }
2132 2135 }
2133 2136
2134 2137 if (s == NULL)
2135 2138 prt_hex(pri, 0, val);
2136 2139 else
2137 2140 outstring(pri, s);
2138 2141 }
2139 2142
2140 2143 const char *
2141 2144 access_flags(private_t *pri, long arg)
2142 2145 {
2143 2146 #define E_OK 010
2144 2147 char *str = pri->code_buf;
2145 2148
2146 2149 if (arg & ~(R_OK|W_OK|X_OK|E_OK))
2147 2150 return (NULL);
2148 2151
2149 2152 /* NB: F_OK == 0 */
2150 2153 if (arg == F_OK)
2151 2154 return ("F_OK");
2152 2155 if (arg == E_OK)
2153 2156 return ("F_OK|E_OK");
2154 2157
2155 2158 *str = '\0';
2156 2159 if (arg & R_OK)
2157 2160 (void) strlcat(str, "|R_OK", sizeof (pri->code_buf));
2158 2161 if (arg & W_OK)
2159 2162 (void) strlcat(str, "|W_OK", sizeof (pri->code_buf));
2160 2163 if (arg & X_OK)
2161 2164 (void) strlcat(str, "|X_OK", sizeof (pri->code_buf));
2162 2165 if (arg & E_OK)
2163 2166 (void) strlcat(str, "|E_OK", sizeof (pri->code_buf));
2164 2167 return ((const char *)(str + 1));
2165 2168 #undef E_OK
2166 2169 }
2167 2170
2168 2171 /*
2169 2172 * Print access() flags.
2170 2173 */
2171 2174 void
2172 2175 prt_acc(private_t *pri, int raw, long val)
2173 2176 {
2174 2177 const char *s = raw? NULL : access_flags(pri, val);
2175 2178
2176 2179 if (s == NULL)
2177 2180 prt_dex(pri, 0, val);
2178 2181 else
2179 2182 outstring(pri, s);
2180 2183 }
2181 2184
2182 2185 /*
2183 2186 * Print shutdown() "how" (2nd) argument
2184 2187 */
2185 2188 void
2186 2189 prt_sht(private_t *pri, int raw, long val)
2187 2190 {
2188 2191 if (raw) {
2189 2192 prt_dex(pri, 0, val);
2190 2193 return;
2191 2194 }
2192 2195 switch (val) {
2193 2196 case SHUT_RD: outstring(pri, "SHUT_RD"); break;
2194 2197 case SHUT_WR: outstring(pri, "SHUT_WR"); break;
2195 2198 case SHUT_RDWR: outstring(pri, "SHUT_RDWR"); break;
2196 2199 default: prt_dec(pri, 0, val); break;
2197 2200 }
2198 2201 }
2199 2202
2200 2203 /*
2201 2204 * Print fcntl() F_SETFL flags (3rd) argument or fdsync flag (2nd arg)
2202 2205 */
2203 2206 static struct fcntl_flags {
2204 2207 long val;
2205 2208 const char *name;
2206 2209 } fcntl_flags[] = {
2207 2210 #define FC_FL(flag) { (long)flag, "|" # flag }
2208 2211 FC_FL(FREVOKED),
2209 2212 FC_FL(FREAD),
2210 2213 FC_FL(FWRITE),
2211 2214 FC_FL(FNDELAY),
2212 2215 FC_FL(FAPPEND),
2213 2216 FC_FL(FSYNC),
2214 2217 FC_FL(FDSYNC),
2215 2218 FC_FL(FRSYNC),
2216 2219 FC_FL(FOFFMAX),
2217 2220 FC_FL(FNONBLOCK),
2218 2221 FC_FL(FCREAT),
2219 2222 FC_FL(FTRUNC),
2220 2223 FC_FL(FEXCL),
2221 2224 FC_FL(FNOCTTY),
2222 2225 FC_FL(FXATTR),
2223 2226 FC_FL(FASYNC),
2224 2227 FC_FL(FNODSYNC)
2225 2228 #undef FC_FL
2226 2229 };
2227 2230
2228 2231 void
2229 2232 prt_ffg(private_t *pri, int raw, long val)
2230 2233 {
2231 2234 #define CBSIZE sizeof (pri->code_buf)
2232 2235 char *s = pri->code_buf;
2233 2236 size_t used = 1;
2234 2237 struct fcntl_flags *fp;
2235 2238
2236 2239 if (raw) {
2237 2240 (void) snprintf(s, CBSIZE, "0x%lx", val);
2238 2241 outstring(pri, s);
2239 2242 return;
2240 2243 }
2241 2244 if (val == 0) {
2242 2245 outstring(pri, "(no flags)");
2243 2246 return;
2244 2247 }
2245 2248
2246 2249 *s = '\0';
2247 2250 for (fp = fcntl_flags;
2248 2251 fp < &fcntl_flags[sizeof (fcntl_flags) / sizeof (*fp)]; fp++) {
2249 2252 if (val & fp->val) {
2250 2253 used = strlcat(s, fp->name, CBSIZE);
2251 2254 val &= ~fp->val;
2252 2255 }
2253 2256 }
2254 2257
2255 2258 if (val != 0 && used <= CBSIZE)
2256 2259 used += snprintf(s + used, CBSIZE - used, "|0x%lx", val);
2257 2260
2258 2261 if (used >= CBSIZE)
2259 2262 (void) snprintf(s + 1, CBSIZE-1, "0x%lx", val);
2260 2263 outstring(pri, s + 1);
2261 2264 #undef CBSIZE
2262 2265 }
2263 2266
2264 2267 void
2265 2268 prt_prs(private_t *pri, int raw, long val)
2266 2269 {
2267 2270 static size_t setsize;
2268 2271 priv_set_t *set = priv_allocset();
2269 2272
2270 2273 if (setsize == 0) {
2271 2274 const priv_impl_info_t *info = getprivimplinfo();
2272 2275 if (info != NULL)
2273 2276 setsize = info->priv_setsize * sizeof (priv_chunk_t);
2274 2277 }
2275 2278
2276 2279 if (setsize != 0 && !raw && set != NULL &&
2277 2280 Pread(Proc, set, setsize, val) == setsize) {
2278 2281 int i;
2279 2282
2280 2283 outstring(pri, "{");
2281 2284 for (i = 0; i < setsize / sizeof (priv_chunk_t); i++) {
2282 2285 char buf[9]; /* 8 hex digits + '\0' */
2283 2286 (void) snprintf(buf, sizeof (buf), "%08x",
2284 2287 ((priv_chunk_t *)set)[i]);
2285 2288 outstring(pri, buf);
2286 2289 }
2287 2290
2288 2291 outstring(pri, "}");
2289 2292 } else {
2290 2293 prt_hex(pri, 0, val);
2291 2294 }
2292 2295
2293 2296 if (set != NULL)
2294 2297 priv_freeset(set);
2295 2298 }
2296 2299
2297 2300 /*
2298 2301 * Print privilege set operation.
2299 2302 */
2300 2303 void
2301 2304 prt_pro(private_t *pri, int raw, long val)
2302 2305 {
2303 2306 const char *s = NULL;
2304 2307
2305 2308 if (!raw) {
2306 2309 switch ((priv_op_t)val) {
2307 2310 case PRIV_ON: s = "PRIV_ON"; break;
2308 2311 case PRIV_OFF: s = "PRIV_OFF"; break;
2309 2312 case PRIV_SET: s = "PRIV_SET"; break;
2310 2313 }
2311 2314 }
2312 2315
2313 2316 if (s == NULL)
2314 2317 prt_dec(pri, 0, val);
2315 2318 else
2316 2319 outstring(pri, s);
2317 2320 }
2318 2321
2319 2322 /*
2320 2323 * Print privilege set name
2321 2324 */
2322 2325 void
2323 2326 prt_prn(private_t *pri, int raw, long val)
2324 2327 {
2325 2328 const char *s = NULL;
2326 2329
2327 2330 if (!raw)
2328 2331 s = priv_getsetbynum((int)val);
2329 2332
2330 2333 if (s == NULL)
2331 2334 prt_dec(pri, 0, val);
2332 2335 else {
2333 2336 char *dup = strdup(s);
2334 2337 char *q;
2335 2338
2336 2339 /* Do the best we can in this case */
2337 2340 if (dup == NULL) {
2338 2341 outstring(pri, s);
2339 2342 return;
2340 2343 }
2341 2344
2342 2345 outstring(pri, "PRIV_");
2343 2346
2344 2347 q = dup;
2345 2348
2346 2349 while (*q != '\0') {
2347 2350 *q = toupper(*q);
2348 2351 q++;
2349 2352 }
2350 2353 outstring(pri, dup);
2351 2354 free(dup);
2352 2355 }
2353 2356 }
2354 2357
2355 2358 /*
2356 2359 * Print process flag names.
2357 2360 */
2358 2361 void
2359 2362 prt_pfl(private_t *pri, int raw, long val)
2360 2363 {
2361 2364 const char *s = NULL;
2362 2365
2363 2366 if (!raw) {
2364 2367 switch ((int)val) {
2365 2368 case PRIV_DEBUG: s = "PRIV_DEBUG"; break;
2366 2369 case PRIV_AWARE: s = "PRIV_AWARE"; break;
2367 2370 case PRIV_XPOLICY: s = "PRIV_XPOLICY"; break;
2368 2371 case PRIV_AWARE_RESET: s = "PRIV_AWARE_RESET"; break;
2369 2372 case PRIV_PFEXEC: s = "PRIV_PFEXEC"; break;
2370 2373 case NET_MAC_AWARE: s = "NET_MAC_AWARE"; break;
2371 2374 case NET_MAC_AWARE_INHERIT:
2372 2375 s = "NET_MAC_AWARE_INHERIT";
2373 2376 break;
2374 2377 }
2375 2378 }
2376 2379
2377 2380 if (s == NULL)
2378 2381 prt_dec(pri, 0, val);
2379 2382 else
2380 2383 outstring(pri, s);
2381 2384 }
2382 2385
2383 2386 /*
2384 2387 * Print lgrp_affinity_{get,set}() arguments.
2385 2388 */
2386 2389 /*ARGSUSED*/
2387 2390 void
2388 2391 prt_laf(private_t *pri, int raw, long val)
2389 2392 {
2390 2393 lgrp_affinity_args_t laff;
2391 2394
2392 2395 if (Pread(Proc, &laff, sizeof (lgrp_affinity_args_t), val) !=
2393 2396 sizeof (lgrp_affinity_args_t)) {
2394 2397 prt_hex(pri, 0, val);
2395 2398 return;
2396 2399 }
2397 2400 /*
2398 2401 * arrange the arguments in the order that user calls with
2399 2402 */
2400 2403 prt_dec(pri, 0, laff.idtype);
2401 2404 outstring(pri, ", ");
2402 2405 prt_dec(pri, 0, laff.id);
2403 2406 outstring(pri, ", ");
2404 2407 prt_dec(pri, 0, laff.lgrp);
2405 2408 outstring(pri, ", ");
2406 2409 if (pri->sys_args[0] == LGRP_SYS_AFFINITY_SET)
2407 2410 prt_dec(pri, 0, laff.aff);
2408 2411 }
2409 2412
2410 2413 /*
2411 2414 * Print a key_t as IPC_PRIVATE if it is 0.
2412 2415 */
2413 2416 void
2414 2417 prt_key(private_t *pri, int raw, long val)
2415 2418 {
2416 2419 if (!raw && val == 0)
2417 2420 outstring(pri, "IPC_PRIVATE");
2418 2421 else
2419 2422 prt_dec(pri, 0, val);
2420 2423 }
2421 2424
2422 2425
2423 2426 /*
2424 2427 * Print zone_getattr() attribute types.
2425 2428 */
2426 2429 void
2427 2430 prt_zga(private_t *pri, int raw, long val)
2428 2431 {
2429 2432 const char *s = NULL;
2430 2433
2431 2434 if (!raw) {
2432 2435 switch ((int)val) {
2433 2436 case ZONE_ATTR_NAME: s = "ZONE_ATTR_NAME"; break;
2434 2437 case ZONE_ATTR_ROOT: s = "ZONE_ATTR_ROOT"; break;
2435 2438 case ZONE_ATTR_STATUS: s = "ZONE_ATTR_STATUS"; break;
2436 2439 case ZONE_ATTR_PRIVSET: s = "ZONE_ATTR_PRIVSET"; break;
2437 2440 case ZONE_ATTR_UNIQID: s = "ZONE_ATTR_UNIQID"; break;
2438 2441 case ZONE_ATTR_POOLID: s = "ZONE_ATTR_POOLID"; break;
2439 2442 case ZONE_ATTR_INITPID: s = "ZONE_ATTR_INITPID"; break;
2440 2443 case ZONE_ATTR_SLBL: s = "ZONE_ATTR_SLBL"; break;
2441 2444 case ZONE_ATTR_INITNAME: s = "ZONE_ATTR_INITNAME"; break;
2442 2445 case ZONE_ATTR_BOOTARGS: s = "ZONE_ATTR_BOOTARGS"; break;
2443 2446 case ZONE_ATTR_BRAND: s = "ZONE_ATTR_BRAND"; break;
2444 2447 case ZONE_ATTR_FLAGS: s = "ZONE_ATTR_FLAGS"; break;
2445 2448 case ZONE_ATTR_PHYS_MCAP: s = "ZONE_ATTR_PHYS_MCAP"; break;
2446 2449 }
2447 2450 }
2448 2451
2449 2452 if (s == NULL)
2450 2453 prt_dec(pri, 0, val);
2451 2454 else
2452 2455 outstring(pri, s);
2453 2456 }
2454 2457
2455 2458 /*
2456 2459 * Print a file descriptor as AT_FDCWD if necessary
2457 2460 */
2458 2461 void
2459 2462 prt_atc(private_t *pri, int raw, long val)
2460 2463 {
2461 2464 if ((int)val == AT_FDCWD) {
2462 2465 if (raw)
2463 2466 prt_hex(pri, 0, (uint_t)AT_FDCWD);
2464 2467 else
2465 2468 outstring(pri, "AT_FDCWD");
2466 2469 } else {
2467 2470 prt_dec(pri, 0, val);
2468 2471 }
2469 2472 }
2470 2473
2471 2474 /*
2472 2475 * Print Trusted Networking database operation codes (labelsys; tn*)
2473 2476 */
2474 2477 static void
2475 2478 prt_tnd(private_t *pri, int raw, long val)
2476 2479 {
2477 2480 const char *s = NULL;
2478 2481
2479 2482 if (!raw) {
2480 2483 switch ((tsol_dbops_t)val) {
2481 2484 case TNDB_NOOP: s = "TNDB_NOOP"; break;
2482 2485 case TNDB_LOAD: s = "TNDB_LOAD"; break;
2483 2486 case TNDB_DELETE: s = "TNDB_DELETE"; break;
2484 2487 case TNDB_FLUSH: s = "TNDB_FLUSH"; break;
2485 2488 case TNDB_GET: s = "TNDB_GET"; break;
2486 2489 }
2487 2490 }
2488 2491
2489 2492 if (s == NULL)
2490 2493 prt_dec(pri, 0, val);
2491 2494 else
2492 2495 outstring(pri, s);
2493 2496 }
2494 2497
2495 2498 /*
2496 2499 * Print LIO_XX flags
2497 2500 */
2498 2501 void
2499 2502 prt_lio(private_t *pri, int raw, long val)
2500 2503 {
2501 2504 if (raw)
2502 2505 prt_dec(pri, 0, val);
2503 2506 else if (val == LIO_WAIT)
2504 2507 outstring(pri, "LIO_WAIT");
2505 2508 else if (val == LIO_NOWAIT)
2506 2509 outstring(pri, "LIO_NOWAIT");
2507 2510 else
2508 2511 prt_dec(pri, 0, val);
2509 2512 }
2510 2513
2511 2514 const char *
2512 2515 door_flags(private_t *pri, long val)
2513 2516 {
2514 2517 door_attr_t attr = (door_attr_t)val;
2515 2518 char *str = pri->code_buf;
2516 2519
2517 2520 *str = '\0';
2518 2521 #define PROCESS_FLAG(flg) \
2519 2522 if (attr & flg) { \
2520 2523 (void) strlcat(str, "|" #flg, sizeof (pri->code_buf)); \
2521 2524 attr &= ~flg; \
2522 2525 }
2523 2526
2524 2527 PROCESS_FLAG(DOOR_UNREF);
2525 2528 PROCESS_FLAG(DOOR_UNREF_MULTI);
2526 2529 PROCESS_FLAG(DOOR_PRIVATE);
2527 2530 PROCESS_FLAG(DOOR_REFUSE_DESC);
2528 2531 PROCESS_FLAG(DOOR_NO_CANCEL);
2529 2532 PROCESS_FLAG(DOOR_LOCAL);
2530 2533 PROCESS_FLAG(DOOR_REVOKED);
2531 2534 PROCESS_FLAG(DOOR_IS_UNREF);
2532 2535 #undef PROCESS_FLAG
2533 2536
2534 2537 if (attr != 0 || *str == '\0') {
2535 2538 size_t len = strlen(str);
2536 2539 (void) snprintf(str + len, sizeof (pri->code_buf) - len,
2537 2540 "|0x%X", attr);
2538 2541 }
2539 2542
2540 2543 return (str + 1);
2541 2544 }
2542 2545
2543 2546 /*
2544 2547 * Print door_create() flags
2545 2548 */
2546 2549 void
2547 2550 prt_dfl(private_t *pri, int raw, long val)
2548 2551 {
2549 2552 if (raw)
2550 2553 prt_hex(pri, 0, val);
2551 2554 else
2552 2555 outstring(pri, door_flags(pri, val));
2553 2556 }
2554 2557
2555 2558 /*
2556 2559 * Print door_*param() param argument
2557 2560 */
2558 2561 void
2559 2562 prt_dpm(private_t *pri, int raw, long val)
2560 2563 {
2561 2564 if (raw)
2562 2565 prt_hex(pri, 0, val);
2563 2566 else if (val == DOOR_PARAM_DESC_MAX)
2564 2567 outstring(pri, "DOOR_PARAM_DESC_MAX");
2565 2568 else if (val == DOOR_PARAM_DATA_MIN)
2566 2569 outstring(pri, "DOOR_PARAM_DATA_MIN");
2567 2570 else if (val == DOOR_PARAM_DATA_MAX)
2568 2571 outstring(pri, "DOOR_PARAM_DATA_MAX");
2569 2572 else
2570 2573 prt_hex(pri, 0, val);
2571 2574 }
2572 2575
2573 2576 /*
2574 2577 * Print rctlsys subcodes
2575 2578 */
2576 2579 void
2577 2580 prt_rsc(private_t *pri, int raw, long val) /* print utssys code */
2578 2581 {
2579 2582 const char *s = raw? NULL : rctlsyscode(val);
2580 2583
2581 2584 if (s == NULL)
2582 2585 prt_dec(pri, 0, val);
2583 2586 else
2584 2587 outstring(pri, s);
2585 2588 }
2586 2589
2587 2590 /*
2588 2591 * Print getrctl flags
2589 2592 */
2590 2593 void
2591 2594 prt_rgf(private_t *pri, int raw, long val)
2592 2595 {
2593 2596 long action = val & (~RCTLSYS_ACTION_MASK);
2594 2597
2595 2598 if (raw)
2596 2599 prt_hex(pri, 0, val);
2597 2600 else if (action == RCTL_FIRST)
2598 2601 outstring(pri, "RCTL_FIRST");
2599 2602 else if (action == RCTL_NEXT)
2600 2603 outstring(pri, "RCTL_NEXT");
2601 2604 else if (action == RCTL_USAGE)
2602 2605 outstring(pri, "RCTL_USAGE");
2603 2606 else
2604 2607 prt_hex(pri, 0, val);
2605 2608 }
2606 2609
2607 2610 /*
2608 2611 * Print setrctl flags
2609 2612 */
2610 2613 void
2611 2614 prt_rsf(private_t *pri, int raw, long val)
2612 2615 {
2613 2616 long action = val & (~RCTLSYS_ACTION_MASK);
2614 2617 long pval = val & RCTL_LOCAL_ACTION_MASK;
2615 2618 char *s = pri->code_buf;
2616 2619
2617 2620 if (raw) {
2618 2621 prt_hex(pri, 0, val);
2619 2622 return;
2620 2623 } else if (action == RCTL_INSERT)
2621 2624 (void) strcpy(s, "RCTL_INSERT");
2622 2625 else if (action == RCTL_DELETE)
2623 2626 (void) strcpy(s, "RCTL_DELETE");
2624 2627 else if (action == RCTL_REPLACE)
2625 2628 (void) strcpy(s, "RCTL_REPLACE");
2626 2629 else {
2627 2630 prt_hex(pri, 0, val);
2628 2631 return;
2629 2632 }
2630 2633
2631 2634 if (pval & RCTL_USE_RECIPIENT_PID) {
2632 2635 pval ^= RCTL_USE_RECIPIENT_PID;
2633 2636 (void) strlcat(s, "|RCTL_USE_RECIPIENT_PID",
2634 2637 sizeof (pri->code_buf));
2635 2638 }
2636 2639
2637 2640 if ((pval & RCTLSYS_ACTION_MASK) != 0)
2638 2641 prt_hex(pri, 0, val);
2639 2642 else if (*s != '\0')
2640 2643 outstring(pri, s);
2641 2644 else
2642 2645 prt_hex(pri, 0, val);
2643 2646 }
2644 2647
2645 2648 /*
2646 2649 * Print rctlctl flags
2647 2650 */
2648 2651 void
2649 2652 prt_rcf(private_t *pri, int raw, long val)
2650 2653 {
2651 2654 long action = val & (~RCTLSYS_ACTION_MASK);
2652 2655
2653 2656 if (raw)
2654 2657 prt_hex(pri, 0, val);
2655 2658 else if (action == RCTLCTL_GET)
2656 2659 outstring(pri, "RCTLCTL_GET");
2657 2660 else if (action == RCTLCTL_SET)
2658 2661 outstring(pri, "RCTLCTL_SET");
2659 2662 else
2660 2663 prt_hex(pri, 0, val);
2661 2664 }
2662 2665
2663 2666 /*
2664 2667 * Print setprojrctl flags
2665 2668 */
2666 2669 void
2667 2670 prt_spf(private_t *pri, int raw, long val)
2668 2671 {
2669 2672 long action = val & TASK_PROJ_MASK;
2670 2673
2671 2674 if (!raw && (action == TASK_PROJ_PURGE))
2672 2675 outstring(pri, "TASK_PROJ_PURGE");
2673 2676 else
2674 2677 prt_hex(pri, 0, val);
2675 2678 }
2676 2679
2677 2680 /*
2678 2681 * Print forkx() flags
2679 2682 */
2680 2683 void
2681 2684 prt_fxf(private_t *pri, int raw, long val)
2682 2685 {
2683 2686 char *str;
2684 2687
2685 2688 if (val == 0)
2686 2689 outstring(pri, "0");
2687 2690 else if (raw || (val & ~(FORK_NOSIGCHLD | FORK_WAITPID)))
2688 2691 prt_hhx(pri, 0, val);
2689 2692 else {
2690 2693 str = pri->code_buf;
2691 2694 *str = '\0';
2692 2695 if (val & FORK_NOSIGCHLD)
2693 2696 (void) strlcat(str, "|FORK_NOSIGCHLD",
2694 2697 sizeof (pri->code_buf));
2695 2698 if (val & FORK_WAITPID)
2696 2699 (void) strlcat(str, "|FORK_WAITPID",
2697 2700 sizeof (pri->code_buf));
2698 2701 outstring(pri, str + 1);
2699 2702 }
2700 2703 }
2701 2704
2702 2705 /*
2703 2706 * Print faccessat() flag
2704 2707 */
2705 2708 void
2706 2709 prt_fat(private_t *pri, int raw, long val)
2707 2710 {
2708 2711 if (val == 0)
2709 2712 outstring(pri, "0");
2710 2713 else if (!raw && val == AT_EACCESS)
2711 2714 outstring(pri, "AT_EACCESS");
2712 2715 else
2713 2716 prt_hex(pri, 0, val);
2714 2717 }
2715 2718
2716 2719 /*
2717 2720 * Print unlinkat() flag
2718 2721 */
2719 2722 void
2720 2723 prt_uat(private_t *pri, int raw, long val)
2721 2724 {
2722 2725 if (val == 0)
2723 2726 outstring(pri, "0");
2724 2727 else if (!raw && val == AT_REMOVEDIR)
2725 2728 outstring(pri, "AT_REMOVEDIR");
2726 2729 else
2727 2730 prt_hex(pri, 0, val);
2728 2731 }
2729 2732
2730 2733 /*
2731 2734 * Print AT_SYMLINK_NOFOLLOW / AT_SYMLINK_FOLLOW flag
2732 2735 */
2733 2736 void
2734 2737 prt_snf(private_t *pri, int raw, long val)
2735 2738 {
2736 2739 if (val == 0)
2737 2740 outstring(pri, "0");
2738 2741 else if (!raw && val == AT_SYMLINK_NOFOLLOW)
2739 2742 outstring(pri, "AT_SYMLINK_NOFOLLOW");
2740 2743 else if (!raw && val == AT_SYMLINK_FOLLOW)
2741 2744 outstring(pri, "AT_SYMLINK_FOLLOW");
2742 2745 else
2743 2746 prt_hex(pri, 0, val);
2744 2747 }
2745 2748
2746 2749 void
2747 2750 prt_grf(private_t *pri, int raw, long val)
2748 2751 {
2749 2752 int first = 1;
2750 2753
2751 2754 if (raw != 0 || val == 0 ||
2752 2755 (val & ~(GRND_NONBLOCK | GRND_RANDOM)) != 0) {
2753 2756 outstring(pri, "0");
2754 2757 return;
2755 2758 }
2756 2759
2757 2760 if (val & GRND_NONBLOCK) {
2758 2761 outstring(pri, "|GRND_NONBLOCK" + first);
2759 2762 first = 0;
2760 2763 }
2761 2764 if (val & GRND_RANDOM) {
2762 2765 outstring(pri, "|GRND_RANDOM" + first);
2763 2766 first = 0;
2764 2767 }
2765 2768 }
2766 2769
2767 2770 /*
2768 2771 * Array of pointers to print functions, one for each format.
2769 2772 */
2770 2773 void (* const Print[])() = {
2771 2774 prt_nov, /* NOV -- no value */
2772 2775 prt_dec, /* DEC -- print value in decimal */
2773 2776 prt_oct, /* OCT -- print value in octal */
2774 2777 prt_hex, /* HEX -- print value in hexadecimal */
2775 2778 prt_dex, /* DEX -- print value in hexadecimal if big enough */
2776 2779 prt_stg, /* STG -- print value as string */
2777 2780 prt_ioc, /* IOC -- print ioctl code */
2778 2781 prt_fcn, /* FCN -- print fcntl code */
2779 2782 prt_s86, /* S86 -- print sysi86 code */
2780 2783 prt_uts, /* UTS -- print utssys code */
2781 2784 prt_opn, /* OPN -- print open code */
2782 2785 prt_sig, /* SIG -- print signal name plus flags */
2783 2786 prt_uat, /* UAT -- print unlinkat() flag */
2784 2787 prt_msc, /* MSC -- print msgsys command */
2785 2788 prt_msf, /* MSF -- print msgsys flags */
2786 2789 prt_smc, /* SMC -- print semsys command */
2787 2790 prt_sef, /* SEF -- print semsys flags */
2788 2791 prt_shc, /* SHC -- print shmsys command */
2789 2792 prt_shf, /* SHF -- print shmsys flags */
2790 2793 prt_fat, /* FAT -- print faccessat( flag */
2791 2794 prt_sfs, /* SFS -- print sysfs code */
2792 2795 prt_rst, /* RST -- print string returned by syscall */
2793 2796 prt_smf, /* SMF -- print streams message flags */
2794 2797 prt_ioa, /* IOA -- print ioctl argument */
2795 2798 prt_pip, /* PIP -- print pipe flags */
2796 2799 prt_mtf, /* MTF -- print mount flags */
2797 2800 prt_mft, /* MFT -- print mount file system type */
2798 2801 prt_iob, /* IOB -- print contents of I/O buffer */
2799 2802 prt_hhx, /* HHX -- print value in hexadecimal (half size) */
2800 2803 prt_wop, /* WOP -- print waitsys() options */
2801 2804 prt_spm, /* SPM -- print sigprocmask argument */
2802 2805 prt_rlk, /* RLK -- print readlink buffer */
2803 2806 prt_mpr, /* MPR -- print mmap()/mprotect() flags */
2804 2807 prt_mty, /* MTY -- print mmap() mapping type flags */
2805 2808 prt_mcf, /* MCF -- print memcntl() function */
2806 2809 prt_mc4, /* MC4 -- print memcntl() (fourth) argument */
2807 2810 prt_mc5, /* MC5 -- print memcntl() (fifth) argument */
2808 2811 prt_mad, /* MAD -- print madvise() argument */
2809 2812 prt_ulm, /* ULM -- print ulimit() argument */
2810 2813 prt_rlm, /* RLM -- print get/setrlimit() argument */
2811 2814 prt_cnf, /* CNF -- print sysconfig() argument */
2812 2815 prt_inf, /* INF -- print sysinfo() argument */
2813 2816 prt_ptc, /* PTC -- print pathconf/fpathconf() argument */
2814 2817 prt_fui, /* FUI -- print fusers() input argument */
2815 2818 prt_idt, /* IDT -- print idtype_t, waitid() argument */
2816 2819 prt_lwf, /* LWF -- print lwp_create() flags */
2817 2820 prt_itm, /* ITM -- print [get|set]itimer() arg */
2818 2821 prt_llo, /* LLO -- print long long offset arg */
2819 2822 prt_mod, /* MOD -- print modctl() subcode */
2820 2823 prt_whn, /* WHN -- print lseek() whence arguiment */
2821 2824 prt_acl, /* ACL -- print acl() code */
2822 2825 prt_aio, /* AIO -- print kaio() code */
2823 2826 prt_aud, /* AUD -- print auditsys() code */
2824 2827 prt_uns, /* DEC -- print value in unsigned decimal */
2825 2828 prt_clc, /* CLC -- print cladm command argument */
2826 2829 prt_clf, /* CLF -- print cladm flag argument */
2827 2830 prt_cor, /* COR -- print corectl() subcode */
2828 2831 prt_cco, /* CCO -- print corectl() options */
2829 2832 prt_ccc, /* CCC -- print corectl() content */
2830 2833 prt_rcc, /* RCC -- print corectl() returned content */
2831 2834 prt_cpc, /* CPC -- print cpc() subcode */
2832 2835 prt_sqc, /* SQC -- print sigqueue() si_code argument */
2833 2836 prt_pc4, /* PC4 -- print priocntlsys() (fourth) argument */
2834 2837 prt_pc5, /* PC5 -- print priocntlsys() (key, value) pairs */
2835 2838 prt_pst, /* PST -- print processor set id */
2836 2839 prt_mif, /* MIF -- print meminfo() arguments */
2837 2840 prt_pfm, /* PFM -- print so_socket() proto-family (1st) arg */
2838 2841 prt_skt, /* SKT -- print so_socket() socket-type (2nd) arg */
2839 2842 prt_skp, /* SKP -- print so_socket() protocol (3rd) arg */
2840 2843 prt_skv, /* SKV -- print socket version arg */
2841 2844 prt_sol, /* SOL -- print [sg]etsockopt() level (2nd) arg */
2842 2845 prt_son, /* SON -- print [sg]etsockopt() opt-name (3rd) arg */
2843 2846 prt_utt, /* UTT -- print utrap type */
2844 2847 prt_uth, /* UTH -- print utrap handler */
2845 2848 prt_acc, /* ACC -- print access() flags */
2846 2849 prt_sht, /* SHT -- print shutdown() how (2nd) argument */
2847 2850 prt_ffg, /* FFG -- print fcntl() flags (3rd) argument */
2848 2851 prt_prs, /* PRS -- print privilege set */
2849 2852 prt_pro, /* PRO -- print privilege set operation */
2850 2853 prt_prn, /* PRN -- print privilege set name */
2851 2854 prt_pfl, /* PFL -- print privilege/process flag name */
2852 2855 prt_laf, /* LAF -- print lgrp_affinity arguments */
2853 2856 prt_key, /* KEY -- print key_t 0 as IPC_PRIVATE */
2854 2857 prt_zga, /* ZGA -- print zone_getattr attribute types */
2855 2858 prt_atc, /* ATC -- print AT_FDCWD or file descriptor */
2856 2859 prt_lio, /* LIO -- print LIO_XX flags */
2857 2860 prt_dfl, /* DFL -- print door_create() flags */
2858 2861 prt_dpm, /* DPM -- print DOOR_PARAM_XX flags */
2859 2862 prt_tnd, /* TND -- print trusted network data base opcode */
2860 2863 prt_rsc, /* RSC -- print rctlsys() subcodes */
2861 2864 prt_rgf, /* RGF -- print getrctl() flags */
2862 2865 prt_rsf, /* RSF -- print setrctl() flags */
2863 2866 prt_rcf, /* RCF -- print rctlsys_ctl() flags */
2864 2867 prt_fxf, /* FXF -- print forkx() flags */
2865 2868 prt_spf, /* SPF -- print rctlsys_projset() flags */
2866 2869 prt_un1, /* UN1 -- as prt_uns except for -1 */
2867 2870 prt_mob, /* MOB -- print mmapobj() flags */
2868 2871 prt_snf, /* SNF -- print AT_SYMLINK_[NO]FOLLOW flag */
2869 2872 prt_skc, /* SKC -- print sockconfig() subcode */
2870 2873 prt_acf, /* ACF -- print accept4 flags */
2871 2874 prt_pfd, /* PFD -- print pipe fds */
2872 2875 prt_grf, /* GRF -- print getrandom flags */
2873 2876 prt_dec, /* HID -- hidden argument, make this the last one */
2874 2877 };
↓ open down ↓ |
920 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX