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