10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 51544Seschrock * Common Development and Distribution License (the "License"). 61544Seschrock * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 225895Syz147064 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 270Sstevel@tonic-gate /* All Rights Reserved */ 280Sstevel@tonic-gate 290Sstevel@tonic-gate 300Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 310Sstevel@tonic-gate 320Sstevel@tonic-gate #include <stdio.h> 330Sstevel@tonic-gate #include <stdlib.h> 340Sstevel@tonic-gate #include <unistd.h> 350Sstevel@tonic-gate #include <sys/types.h> 360Sstevel@tonic-gate #include <libproc.h> 370Sstevel@tonic-gate 380Sstevel@tonic-gate #include <ctype.h> 390Sstevel@tonic-gate #include <string.h> 400Sstevel@tonic-gate #include <sys/dlpi.h> 410Sstevel@tonic-gate #include <sys/ipc.h> 420Sstevel@tonic-gate #include <sys/ipc_impl.h> 430Sstevel@tonic-gate #include <sys/msg.h> 440Sstevel@tonic-gate #include <sys/sem.h> 450Sstevel@tonic-gate #include <sys/shm.h> 460Sstevel@tonic-gate #include <sys/fstyp.h> 470Sstevel@tonic-gate #if defined(__i386) || defined(__amd64) 480Sstevel@tonic-gate #include <sys/sysi86.h> 490Sstevel@tonic-gate #endif /* __i386 */ 500Sstevel@tonic-gate #include <sys/unistd.h> 510Sstevel@tonic-gate #include <sys/file.h> 520Sstevel@tonic-gate #include <sys/tiuser.h> 530Sstevel@tonic-gate #include <sys/timod.h> 540Sstevel@tonic-gate #include <sys/stream.h> 550Sstevel@tonic-gate #include <sys/stropts.h> 560Sstevel@tonic-gate #include <sys/termios.h> 570Sstevel@tonic-gate #include <sys/termiox.h> 580Sstevel@tonic-gate #include <sys/jioctl.h> 590Sstevel@tonic-gate #include <sys/filio.h> 600Sstevel@tonic-gate #include <fcntl.h> 610Sstevel@tonic-gate #include <sys/termio.h> 620Sstevel@tonic-gate #include <sys/stermio.h> 630Sstevel@tonic-gate #include <sys/ttold.h> 640Sstevel@tonic-gate #include <sys/lock.h> 650Sstevel@tonic-gate #include <sys/mount.h> 660Sstevel@tonic-gate #include <sys/utssys.h> 670Sstevel@tonic-gate #include <sys/sysconfig.h> 680Sstevel@tonic-gate #include <sys/statvfs.h> 690Sstevel@tonic-gate #include <sys/kstat.h> 700Sstevel@tonic-gate #include <sys/audio.h> 710Sstevel@tonic-gate #include <sys/mixer.h> 720Sstevel@tonic-gate #include <sys/cpc_impl.h> 730Sstevel@tonic-gate #include <sys/devpoll.h> 740Sstevel@tonic-gate #include <sys/strredir.h> 750Sstevel@tonic-gate #include <sys/sockio.h> 760Sstevel@tonic-gate #include <netinet/ip_mroute.h> 770Sstevel@tonic-gate #include <net/if.h> 780Sstevel@tonic-gate #include <net/if_arp.h> 790Sstevel@tonic-gate #include <sys/ptyvar.h> 800Sstevel@tonic-gate #include <sys/des.h> 810Sstevel@tonic-gate #include <sys/prnio.h> 820Sstevel@tonic-gate #include <sys/dtrace.h> 830Sstevel@tonic-gate #include <sys/crypto/ioctladmin.h> 840Sstevel@tonic-gate #include <sys/crypto/ioctl.h> 850Sstevel@tonic-gate #include <sys/kbio.h> 860Sstevel@tonic-gate #include <sys/ptms.h> 870Sstevel@tonic-gate #include <sys/aggr.h> 880Sstevel@tonic-gate #include <sys/dld.h> 89789Sahrens #include <sys/fs/zfs.h> 901400Skrishna #include <inet/kssl/kssl.h> 91*6318Sedp #include <sys/dkio.h> 92*6318Sedp #include <sys/dumpadm.h> 93*6318Sedp #include <sys/mntio.h> 940Sstevel@tonic-gate 950Sstevel@tonic-gate #include "ramdata.h" 960Sstevel@tonic-gate #include "proto.h" 970Sstevel@tonic-gate 980Sstevel@tonic-gate #define FCNTLMIN F_DUPFD 990Sstevel@tonic-gate #define FCNTLMAX 44 /* F_SETLK64_NBMAND */ 1000Sstevel@tonic-gate const char *const FCNTLname[] = { 1010Sstevel@tonic-gate "F_DUPFD", 1020Sstevel@tonic-gate "F_GETFD", 1030Sstevel@tonic-gate "F_SETFD", 1040Sstevel@tonic-gate "F_GETFL", 1050Sstevel@tonic-gate "F_SETFL", 1060Sstevel@tonic-gate "F_O_GETLK", 1070Sstevel@tonic-gate "F_SETLK", 1080Sstevel@tonic-gate "F_SETLKW", 1090Sstevel@tonic-gate "F_CHKFL", 1100Sstevel@tonic-gate "F_DUP2FD", 1110Sstevel@tonic-gate "F_ALLOCSP", 1120Sstevel@tonic-gate "F_FREESP", 1130Sstevel@tonic-gate NULL, /* 12 */ 1140Sstevel@tonic-gate NULL, /* 13 */ 1150Sstevel@tonic-gate "F_GETLK", 1160Sstevel@tonic-gate NULL, /* 15 */ 1170Sstevel@tonic-gate NULL, /* 16 */ 1180Sstevel@tonic-gate NULL, /* 17 */ 1190Sstevel@tonic-gate NULL, /* 18 */ 1200Sstevel@tonic-gate NULL, /* 19 */ 1210Sstevel@tonic-gate NULL, /* 20 */ 1220Sstevel@tonic-gate NULL, /* 21 */ 1230Sstevel@tonic-gate NULL, /* 22 */ 1240Sstevel@tonic-gate "F_GETOWN", 1250Sstevel@tonic-gate "F_SETOWN", 1260Sstevel@tonic-gate "F_REVOKE", 1270Sstevel@tonic-gate "F_HASREMOTELOCKS", 1280Sstevel@tonic-gate "F_FREESP64", 1290Sstevel@tonic-gate NULL, /* 28 */ 1300Sstevel@tonic-gate NULL, /* 29 */ 1310Sstevel@tonic-gate NULL, /* 30 */ 1320Sstevel@tonic-gate NULL, /* 31 */ 1330Sstevel@tonic-gate NULL, /* 32 */ 1340Sstevel@tonic-gate "F_GETLK64", 1350Sstevel@tonic-gate "F_SETLK64", 1360Sstevel@tonic-gate "F_SETLKW64", 1370Sstevel@tonic-gate NULL, /* 36 */ 1380Sstevel@tonic-gate NULL, /* 37 */ 1390Sstevel@tonic-gate NULL, /* 38 */ 1400Sstevel@tonic-gate NULL, /* 39 */ 1410Sstevel@tonic-gate "F_SHARE", 1420Sstevel@tonic-gate "F_UNSHARE", 1430Sstevel@tonic-gate "F_SETLK_NBMAND", 1440Sstevel@tonic-gate "F_SHARE_NBMAND", 1450Sstevel@tonic-gate "F_SETLK64_NBMAND" 1460Sstevel@tonic-gate }; 1470Sstevel@tonic-gate 1480Sstevel@tonic-gate #define SYSFSMIN GETFSIND 1490Sstevel@tonic-gate #define SYSFSMAX GETNFSTYP 1500Sstevel@tonic-gate const char *const SYSFSname[] = { 1510Sstevel@tonic-gate "GETFSIND", 1520Sstevel@tonic-gate "GETFSTYP", 1530Sstevel@tonic-gate "GETNFSTYP" 1540Sstevel@tonic-gate }; 1550Sstevel@tonic-gate 1560Sstevel@tonic-gate #define PLOCKMIN UNLOCK 1570Sstevel@tonic-gate #define PLOCKMAX DATLOCK 1580Sstevel@tonic-gate const char *const PLOCKname[] = { 1590Sstevel@tonic-gate "UNLOCK", 1600Sstevel@tonic-gate "PROCLOCK", 1610Sstevel@tonic-gate "TXTLOCK", 1620Sstevel@tonic-gate NULL, 1630Sstevel@tonic-gate "DATLOCK" 1640Sstevel@tonic-gate }; 1650Sstevel@tonic-gate 1660Sstevel@tonic-gate #define SCONFMIN _CONFIG_NGROUPS 1670Sstevel@tonic-gate #define SCONFMAX _CONFIG_CPUID_MAX 1680Sstevel@tonic-gate const char *const SCONFname[] = { 1690Sstevel@tonic-gate "_CONFIG_NGROUPS", /* 2 */ 1700Sstevel@tonic-gate "_CONFIG_CHILD_MAX", /* 3 */ 1710Sstevel@tonic-gate "_CONFIG_OPEN_FILES", /* 4 */ 1720Sstevel@tonic-gate "_CONFIG_POSIX_VER", /* 5 */ 1730Sstevel@tonic-gate "_CONFIG_PAGESIZE", /* 6 */ 1740Sstevel@tonic-gate "_CONFIG_CLK_TCK", /* 7 */ 1750Sstevel@tonic-gate "_CONFIG_XOPEN_VER", /* 8 */ 1760Sstevel@tonic-gate "_CONFIG_HRESCLK_TCK", /* 9 */ 1770Sstevel@tonic-gate "_CONFIG_PROF_TCK", /* 10 */ 1780Sstevel@tonic-gate "_CONFIG_NPROC_CONF", /* 11 */ 1790Sstevel@tonic-gate "_CONFIG_NPROC_ONLN", /* 12 */ 1800Sstevel@tonic-gate "_CONFIG_AIO_LISTIO_MAX", /* 13 */ 1810Sstevel@tonic-gate "_CONFIG_AIO_MAX", /* 14 */ 1820Sstevel@tonic-gate "_CONFIG_AIO_PRIO_DELTA_MAX", /* 15 */ 1830Sstevel@tonic-gate "_CONFIG_DELAYTIMER_MAX", /* 16 */ 1840Sstevel@tonic-gate "_CONFIG_MQ_OPEN_MAX", /* 17 */ 1850Sstevel@tonic-gate "_CONFIG_MQ_PRIO_MAX", /* 18 */ 1860Sstevel@tonic-gate "_CONFIG_RTSIG_MAX", /* 19 */ 1870Sstevel@tonic-gate "_CONFIG_SEM_NSEMS_MAX", /* 20 */ 1880Sstevel@tonic-gate "_CONFIG_SEM_VALUE_MAX", /* 21 */ 1890Sstevel@tonic-gate "_CONFIG_SIGQUEUE_MAX", /* 22 */ 1900Sstevel@tonic-gate "_CONFIG_SIGRT_MIN", /* 23 */ 1910Sstevel@tonic-gate "_CONFIG_SIGRT_MAX", /* 24 */ 1920Sstevel@tonic-gate "_CONFIG_TIMER_MAX", /* 25 */ 1930Sstevel@tonic-gate "_CONFIG_PHYS_PAGES", /* 26 */ 1940Sstevel@tonic-gate "_CONFIG_AVPHYS_PAGES", /* 27 */ 1950Sstevel@tonic-gate "_CONFIG_COHERENCY", /* 28 */ 1960Sstevel@tonic-gate "_CONFIG_SPLIT_CACHE", /* 29 */ 1970Sstevel@tonic-gate "_CONFIG_ICACHESZ", /* 30 */ 1980Sstevel@tonic-gate "_CONFIG_DCACHESZ", /* 31 */ 1990Sstevel@tonic-gate "_CONFIG_ICACHELINESZ", /* 32 */ 2000Sstevel@tonic-gate "_CONFIG_DCACHELINESZ", /* 33 */ 2010Sstevel@tonic-gate "_CONFIG_ICACHEBLKSZ", /* 34 */ 2020Sstevel@tonic-gate "_CONFIG_DCACHEBLKSZ", /* 35 */ 2030Sstevel@tonic-gate "_CONFIG_DCACHETBLKSZ", /* 36 */ 2040Sstevel@tonic-gate "_CONFIG_ICACHE_ASSOC", /* 37 */ 2050Sstevel@tonic-gate "_CONFIG_DCACHE_ASSOC", /* 38 */ 2060Sstevel@tonic-gate NULL, /* 39 */ 2070Sstevel@tonic-gate NULL, /* 40 */ 2080Sstevel@tonic-gate NULL, /* 41 */ 2090Sstevel@tonic-gate "_CONFIG_MAXPID", /* 42 */ 2100Sstevel@tonic-gate "_CONFIG_STACK_PROT", /* 43 */ 2110Sstevel@tonic-gate "_CONFIG_NPROC_MAX", /* 44 */ 2120Sstevel@tonic-gate "_CONFIG_CPUID_MAX" /* 45 */ 2130Sstevel@tonic-gate }; 2140Sstevel@tonic-gate 2150Sstevel@tonic-gate #define PATHCONFMIN _PC_LINK_MAX 2160Sstevel@tonic-gate #define PATHCONFMAX _PC_CHOWN_RESTRICTED 2170Sstevel@tonic-gate const char *const PATHCONFname[] = { 2180Sstevel@tonic-gate "_PC_LINK_MAX", 2190Sstevel@tonic-gate "_PC_MAX_CANON", 2200Sstevel@tonic-gate "_PC_MAX_INPUT", 2210Sstevel@tonic-gate "_PC_NAME_MAX", 2220Sstevel@tonic-gate "_PC_PATH_MAX", 2230Sstevel@tonic-gate "_PC_PIPE_BUF", 2240Sstevel@tonic-gate "_PC_NO_TRUNC", 2250Sstevel@tonic-gate "_PC_VDISABLE", 2260Sstevel@tonic-gate "_PC_CHOWN_RESTRICTED" 2270Sstevel@tonic-gate }; 2280Sstevel@tonic-gate 2290Sstevel@tonic-gate const struct ioc { 2300Sstevel@tonic-gate uint_t code; 2310Sstevel@tonic-gate const char *name; 2320Sstevel@tonic-gate const char *datastruct; 2330Sstevel@tonic-gate } ioc[] = { 2340Sstevel@tonic-gate { (uint_t)TCGETA, "TCGETA", NULL }, 2350Sstevel@tonic-gate { (uint_t)TCSETA, "TCSETA", NULL }, 2360Sstevel@tonic-gate { (uint_t)TCSETAW, "TCSETAW", NULL }, 2370Sstevel@tonic-gate { (uint_t)TCSETAF, "TCSETAF", NULL }, 2380Sstevel@tonic-gate { (uint_t)TCFLSH, "TCFLSH", NULL }, 2390Sstevel@tonic-gate { (uint_t)TIOCKBON, "TIOCKBON", NULL }, 2400Sstevel@tonic-gate { (uint_t)TIOCKBOF, "TIOCKBOF", NULL }, 2410Sstevel@tonic-gate { (uint_t)KBENABLED, "KBENABLED", NULL }, 2420Sstevel@tonic-gate { (uint_t)TCGETS, "TCGETS", NULL }, 2430Sstevel@tonic-gate { (uint_t)TCSETS, "TCSETS", NULL }, 2440Sstevel@tonic-gate { (uint_t)TCSETSW, "TCSETSW", NULL }, 2450Sstevel@tonic-gate { (uint_t)TCSETSF, "TCSETSF", NULL }, 2460Sstevel@tonic-gate { (uint_t)TCXONC, "TCXONC", NULL }, 2470Sstevel@tonic-gate { (uint_t)TCSBRK, "TCSBRK", NULL }, 2480Sstevel@tonic-gate { (uint_t)TCDSET, "TCDSET", NULL }, 2490Sstevel@tonic-gate { (uint_t)RTS_TOG, "RTS_TOG", NULL }, 2500Sstevel@tonic-gate { (uint_t)TIOCSWINSZ, "TIOCSWINSZ", NULL }, 2510Sstevel@tonic-gate { (uint_t)TIOCGWINSZ, "TIOCGWINSZ", NULL }, 2520Sstevel@tonic-gate { (uint_t)TIOCGETD, "TIOCGETD", NULL }, 2530Sstevel@tonic-gate { (uint_t)TIOCSETD, "TIOCSETD", NULL }, 2540Sstevel@tonic-gate { (uint_t)TIOCHPCL, "TIOCHPCL", NULL }, 2550Sstevel@tonic-gate { (uint_t)TIOCGETP, "TIOCGETP", NULL }, 2560Sstevel@tonic-gate { (uint_t)TIOCSETP, "TIOCSETP", NULL }, 2570Sstevel@tonic-gate { (uint_t)TIOCSETN, "TIOCSETN", NULL }, 2580Sstevel@tonic-gate { (uint_t)TIOCEXCL, "TIOCEXCL", NULL }, 2590Sstevel@tonic-gate { (uint_t)TIOCNXCL, "TIOCNXCL", NULL }, 2600Sstevel@tonic-gate { (uint_t)TIOCFLUSH, "TIOCFLUSH", NULL }, 2610Sstevel@tonic-gate { (uint_t)TIOCSETC, "TIOCSETC", NULL }, 2620Sstevel@tonic-gate { (uint_t)TIOCGETC, "TIOCGETC", NULL }, 2630Sstevel@tonic-gate { (uint_t)TIOCGPGRP, "TIOCGPGRP", NULL }, 2640Sstevel@tonic-gate { (uint_t)TIOCSPGRP, "TIOCSPGRP", NULL }, 2650Sstevel@tonic-gate { (uint_t)TIOCGSID, "TIOCGSID", NULL }, 2660Sstevel@tonic-gate { (uint_t)TIOCSTI, "TIOCSTI", NULL }, 2670Sstevel@tonic-gate { (uint_t)TIOCMSET, "TIOCMSET", NULL }, 2680Sstevel@tonic-gate { (uint_t)TIOCMBIS, "TIOCMBIS", NULL }, 2690Sstevel@tonic-gate { (uint_t)TIOCMBIC, "TIOCMBIC", NULL }, 2700Sstevel@tonic-gate { (uint_t)TIOCMGET, "TIOCMGET", NULL }, 2710Sstevel@tonic-gate { (uint_t)TIOCREMOTE, "TIOCREMOTE", NULL }, 2720Sstevel@tonic-gate { (uint_t)TIOCSIGNAL, "TIOCSIGNAL", NULL }, 2730Sstevel@tonic-gate { (uint_t)TIOCSTART, "TIOCSTART", NULL }, 2740Sstevel@tonic-gate { (uint_t)TIOCSTOP, "TIOCSTOP", NULL }, 2750Sstevel@tonic-gate { (uint_t)TIOCNOTTY, "TIOCNOTTY", NULL }, 2760Sstevel@tonic-gate { (uint_t)TIOCOUTQ, "TIOCOUTQ", NULL }, 2770Sstevel@tonic-gate { (uint_t)TIOCGLTC, "TIOCGLTC", NULL }, 2780Sstevel@tonic-gate { (uint_t)TIOCSLTC, "TIOCSLTC", NULL }, 2790Sstevel@tonic-gate { (uint_t)TIOCCDTR, "TIOCCDTR", NULL }, 2800Sstevel@tonic-gate { (uint_t)TIOCSDTR, "TIOCSDTR", NULL }, 2810Sstevel@tonic-gate { (uint_t)TIOCCBRK, "TIOCCBRK", NULL }, 2820Sstevel@tonic-gate { (uint_t)TIOCSBRK, "TIOCSBRK", NULL }, 2830Sstevel@tonic-gate { (uint_t)TIOCLGET, "TIOCLGET", NULL }, 2840Sstevel@tonic-gate { (uint_t)TIOCLSET, "TIOCLSET", NULL }, 2850Sstevel@tonic-gate { (uint_t)TIOCLBIC, "TIOCLBIC", NULL }, 2860Sstevel@tonic-gate { (uint_t)TIOCLBIS, "TIOCLBIS", NULL }, 2870Sstevel@tonic-gate 2880Sstevel@tonic-gate { (uint_t)TIOCPKT, "TIOCPKT", NULL }, /* ptyvar.h */ 2890Sstevel@tonic-gate { (uint_t)TIOCUCNTL, "TIOCUCNTL", NULL }, 2900Sstevel@tonic-gate { (uint_t)TIOCTCNTL, "TIOCTCNTL", NULL }, 2910Sstevel@tonic-gate { (uint_t)TIOCISPACE, "TIOCISPACE", NULL }, 2920Sstevel@tonic-gate { (uint_t)TIOCISIZE, "TIOCISIZE", NULL }, 2930Sstevel@tonic-gate { (uint_t)TIOCSSIZE, "TIOCSSIZE", "ttysize" }, 2940Sstevel@tonic-gate { (uint_t)TIOCGSIZE, "TIOCGSIZE", "ttysize" }, 2950Sstevel@tonic-gate 2960Sstevel@tonic-gate /* 2973147Sxc151355 * Unfortunately, the DLIOC and LDIOC codes overlap. Since the LDIOC 2980Sstevel@tonic-gate * ioctls (for xenix compatibility) are far less likely to be used, we 2993147Sxc151355 * give preference to DLIOC. 3000Sstevel@tonic-gate */ 3010Sstevel@tonic-gate { (uint_t)DLIOCRAW, "DLIOCRAW", NULL }, 3023147Sxc151355 { (uint_t)DLIOCNATIVE, "DLIOCNATIVE", NULL }, 3030Sstevel@tonic-gate 3040Sstevel@tonic-gate { (uint_t)LDOPEN, "LDOPEN", NULL }, 3050Sstevel@tonic-gate { (uint_t)LDCLOSE, "LDCLOSE", NULL }, 3060Sstevel@tonic-gate { (uint_t)LDCHG, "LDCHG", NULL }, 3070Sstevel@tonic-gate { (uint_t)LDGETT, "LDGETT", NULL }, 3080Sstevel@tonic-gate { (uint_t)LDSETT, "LDSETT", NULL }, 3090Sstevel@tonic-gate { (uint_t)LDSMAP, "LDSMAP", NULL }, 3100Sstevel@tonic-gate { (uint_t)LDGMAP, "LDGMAP", NULL }, 3110Sstevel@tonic-gate { (uint_t)LDNMAP, "LDNMAP", NULL }, 3120Sstevel@tonic-gate { (uint_t)TCGETX, "TCGETX", NULL }, 3130Sstevel@tonic-gate { (uint_t)TCSETX, "TCSETX", NULL }, 3140Sstevel@tonic-gate { (uint_t)TCSETXW, "TCSETXW", NULL }, 3150Sstevel@tonic-gate { (uint_t)TCSETXF, "TCSETXF", NULL }, 3160Sstevel@tonic-gate { (uint_t)FIORDCHK, "FIORDCHK", NULL }, 3170Sstevel@tonic-gate { (uint_t)FIOCLEX, "FIOCLEX", NULL }, 3180Sstevel@tonic-gate { (uint_t)FIONCLEX, "FIONCLEX", NULL }, 3190Sstevel@tonic-gate { (uint_t)FIONREAD, "FIONREAD", NULL }, 3200Sstevel@tonic-gate { (uint_t)FIONBIO, "FIONBIO", NULL }, 3210Sstevel@tonic-gate { (uint_t)FIOASYNC, "FIOASYNC", NULL }, 3220Sstevel@tonic-gate { (uint_t)FIOSETOWN, "FIOSETOWN", NULL }, 3230Sstevel@tonic-gate { (uint_t)FIOGETOWN, "FIOGETOWN", NULL }, 3240Sstevel@tonic-gate #ifdef DIOCGETP 3250Sstevel@tonic-gate { (uint_t)DIOCGETP, "DIOCGETP", NULL }, 3260Sstevel@tonic-gate { (uint_t)DIOCSETP, "DIOCSETP", NULL }, 3270Sstevel@tonic-gate #endif 3280Sstevel@tonic-gate #ifdef DIOCGETC 3290Sstevel@tonic-gate { (uint_t)DIOCGETC, "DIOCGETC", NULL }, 3300Sstevel@tonic-gate { (uint_t)DIOCGETB, "DIOCGETB", NULL }, 3310Sstevel@tonic-gate { (uint_t)DIOCSETE, "DIOCSETE", NULL }, 3320Sstevel@tonic-gate #endif 3330Sstevel@tonic-gate #ifdef IFFORMAT 3340Sstevel@tonic-gate { (uint_t)IFFORMAT, "IFFORMAT", NULL }, 3350Sstevel@tonic-gate { (uint_t)IFBCHECK, "IFBCHECK", NULL }, 3360Sstevel@tonic-gate { (uint_t)IFCONFIRM, "IFCONFIRM", NULL }, 3370Sstevel@tonic-gate #endif 3380Sstevel@tonic-gate #ifdef LIOCGETP 3390Sstevel@tonic-gate { (uint_t)LIOCGETP, "LIOCGETP", NULL }, 3400Sstevel@tonic-gate { (uint_t)LIOCSETP, "LIOCSETP", NULL }, 3410Sstevel@tonic-gate { (uint_t)LIOCGETS, "LIOCGETS", NULL }, 3420Sstevel@tonic-gate { (uint_t)LIOCSETS, "LIOCSETS", NULL }, 3430Sstevel@tonic-gate #endif 3440Sstevel@tonic-gate #ifdef JBOOT 3450Sstevel@tonic-gate { (uint_t)JBOOT, "JBOOT", NULL }, 3460Sstevel@tonic-gate { (uint_t)JTERM, "JTERM", NULL }, 3470Sstevel@tonic-gate { (uint_t)JMPX, "JMPX", NULL }, 3480Sstevel@tonic-gate #ifdef JTIMO 3490Sstevel@tonic-gate { (uint_t)JTIMO, "JTIMO", NULL }, 3500Sstevel@tonic-gate #endif 3510Sstevel@tonic-gate { (uint_t)JWINSIZE, "JWINSIZE", NULL }, 3520Sstevel@tonic-gate { (uint_t)JTIMOM, "JTIMOM", NULL }, 3530Sstevel@tonic-gate { (uint_t)JZOMBOOT, "JZOMBOOT", NULL }, 3540Sstevel@tonic-gate { (uint_t)JAGENT, "JAGENT", NULL }, 3550Sstevel@tonic-gate { (uint_t)JTRUN, "JTRUN", NULL }, 3560Sstevel@tonic-gate { (uint_t)JXTPROTO, "JXTPROTO", NULL }, 3570Sstevel@tonic-gate #endif 3580Sstevel@tonic-gate { (uint_t)KSTAT_IOC_CHAIN_ID, "KSTAT_IOC_CHAIN_ID", NULL }, 3590Sstevel@tonic-gate { (uint_t)KSTAT_IOC_READ, "KSTAT_IOC_READ", NULL }, 3600Sstevel@tonic-gate { (uint_t)KSTAT_IOC_WRITE, "KSTAT_IOC_WRITE", NULL }, 3610Sstevel@tonic-gate { (uint_t)STGET, "STGET", NULL }, 3620Sstevel@tonic-gate { (uint_t)STSET, "STSET", NULL }, 3630Sstevel@tonic-gate { (uint_t)STTHROW, "STTHROW", NULL }, 3640Sstevel@tonic-gate { (uint_t)STWLINE, "STWLINE", NULL }, 3650Sstevel@tonic-gate { (uint_t)STTSV, "STTSV", NULL }, 3660Sstevel@tonic-gate { (uint_t)I_NREAD, "I_NREAD", NULL }, 3670Sstevel@tonic-gate { (uint_t)I_PUSH, "I_PUSH", NULL }, 3680Sstevel@tonic-gate { (uint_t)I_POP, "I_POP", NULL }, 3690Sstevel@tonic-gate { (uint_t)I_LOOK, "I_LOOK", NULL }, 3700Sstevel@tonic-gate { (uint_t)I_FLUSH, "I_FLUSH", NULL }, 3710Sstevel@tonic-gate { (uint_t)I_SRDOPT, "I_SRDOPT", NULL }, 3720Sstevel@tonic-gate { (uint_t)I_GRDOPT, "I_GRDOPT", NULL }, 3730Sstevel@tonic-gate { (uint_t)I_STR, "I_STR", NULL }, 3740Sstevel@tonic-gate { (uint_t)I_SETSIG, "I_SETSIG", NULL }, 3750Sstevel@tonic-gate { (uint_t)I_GETSIG, "I_GETSIG", NULL }, 3760Sstevel@tonic-gate { (uint_t)I_FIND, "I_FIND", NULL }, 3770Sstevel@tonic-gate { (uint_t)I_LINK, "I_LINK", NULL }, 3780Sstevel@tonic-gate { (uint_t)I_UNLINK, "I_UNLINK", NULL }, 3790Sstevel@tonic-gate { (uint_t)I_PEEK, "I_PEEK", NULL }, 3800Sstevel@tonic-gate { (uint_t)I_FDINSERT, "I_FDINSERT", NULL }, 3810Sstevel@tonic-gate { (uint_t)I_SENDFD, "I_SENDFD", NULL }, 3820Sstevel@tonic-gate { (uint_t)I_RECVFD, "I_RECVFD", NULL }, 3830Sstevel@tonic-gate { (uint_t)I_SWROPT, "I_SWROPT", NULL }, 3840Sstevel@tonic-gate { (uint_t)I_GWROPT, "I_GWROPT", NULL }, 3850Sstevel@tonic-gate { (uint_t)I_LIST, "I_LIST", NULL }, 3860Sstevel@tonic-gate { (uint_t)I_PLINK, "I_PLINK", NULL }, 3870Sstevel@tonic-gate { (uint_t)I_PUNLINK, "I_PUNLINK", NULL }, 3880Sstevel@tonic-gate { (uint_t)I_FLUSHBAND, "I_FLUSHBAND", NULL }, 3890Sstevel@tonic-gate { (uint_t)I_CKBAND, "I_CKBAND", NULL }, 3900Sstevel@tonic-gate { (uint_t)I_GETBAND, "I_GETBAND", NULL }, 3910Sstevel@tonic-gate { (uint_t)I_ATMARK, "I_ATMARK", NULL }, 3920Sstevel@tonic-gate { (uint_t)I_SETCLTIME, "I_SETCLTIME", NULL }, 3930Sstevel@tonic-gate { (uint_t)I_GETCLTIME, "I_GETCLTIME", NULL }, 3940Sstevel@tonic-gate { (uint_t)I_CANPUT, "I_CANPUT", NULL }, 3950Sstevel@tonic-gate #ifdef I_ANCHOR 3960Sstevel@tonic-gate { (uint_t)I_ANCHOR, "I_ANCHOR", NULL }, 3970Sstevel@tonic-gate #endif 3980Sstevel@tonic-gate #ifdef TI_GETINFO 3990Sstevel@tonic-gate { (uint_t)TI_GETINFO, "TI_GETINFO", NULL }, 4000Sstevel@tonic-gate { (uint_t)TI_OPTMGMT, "TI_OPTMGMT", NULL }, 4010Sstevel@tonic-gate { (uint_t)TI_BIND, "TI_BIND", NULL }, 4020Sstevel@tonic-gate { (uint_t)TI_UNBIND, "TI_UNBIND", NULL }, 4030Sstevel@tonic-gate #endif 4040Sstevel@tonic-gate #ifdef TI_CAPABILITY 4050Sstevel@tonic-gate { (uint_t)TI_CAPABILITY, "TI_CAPABILITY", NULL }, 4060Sstevel@tonic-gate #endif 4070Sstevel@tonic-gate #ifdef TI_GETMYNAME 4080Sstevel@tonic-gate { (uint_t)TI_GETMYNAME, "TI_GETMYNAME", NULL }, 4090Sstevel@tonic-gate { (uint_t)TI_GETPEERNAME, "TI_GETPEERNAME", NULL }, 4100Sstevel@tonic-gate { (uint_t)TI_SETMYNAME, "TI_SETMYNAME", NULL }, 4110Sstevel@tonic-gate { (uint_t)TI_SETPEERNAME, "TI_SETPEERNAME", NULL }, 4120Sstevel@tonic-gate #endif 4130Sstevel@tonic-gate #ifdef V_PREAD 4140Sstevel@tonic-gate { (uint_t)V_PREAD, "V_PREAD", NULL }, 4150Sstevel@tonic-gate { (uint_t)V_PWRITE, "V_PWRITE", NULL }, 4160Sstevel@tonic-gate { (uint_t)V_PDREAD, "V_PDREAD", NULL }, 4170Sstevel@tonic-gate { (uint_t)V_PDWRITE, "V_PDWRITE", NULL }, 4180Sstevel@tonic-gate #if !defined(__i386) && !defined(__amd64) 4190Sstevel@tonic-gate { (uint_t)V_GETSSZ, "V_GETSSZ", NULL }, 4200Sstevel@tonic-gate #endif /* !__i386 */ 4210Sstevel@tonic-gate #endif 4220Sstevel@tonic-gate /* audio */ 4230Sstevel@tonic-gate { (uint_t)AUDIO_GETINFO, "AUDIO_GETINFO", NULL }, 4240Sstevel@tonic-gate { (uint_t)AUDIO_SETINFO, "AUDIO_SETINFO", NULL }, 4250Sstevel@tonic-gate { (uint_t)AUDIO_DRAIN, "AUDIO_DRAIN", NULL }, 4260Sstevel@tonic-gate { (uint_t)AUDIO_GETDEV, "AUDIO_GETDEV", NULL }, 4270Sstevel@tonic-gate { (uint_t)AUDIO_DIAG_LOOPBACK, "AUDIO_DIAG_LOOPBACK", NULL }, 4280Sstevel@tonic-gate { (uint_t)AUDIO_GET_CH_NUMBER, "AUDIO_GET_CH_NUMBER", NULL }, 4290Sstevel@tonic-gate { (uint_t)AUDIO_GET_CH_TYPE, "AUDIO_GET_CH_TYPE", NULL }, 4300Sstevel@tonic-gate { (uint_t)AUDIO_GET_NUM_CHS, "AUDIO_GET_NUM_CHS", NULL }, 4310Sstevel@tonic-gate { (uint_t)AUDIO_GET_AD_DEV, "AUDIO_GET_AD_DEV", NULL }, 4320Sstevel@tonic-gate { (uint_t)AUDIO_GET_APM_DEV, "AUDIO_GET_APM_DEV", NULL }, 4330Sstevel@tonic-gate { (uint_t)AUDIO_GET_AS_DEV, "AUDIO_GET_AS_DEV", NULL }, 4340Sstevel@tonic-gate { (uint_t)AUDIO_MIXER_MULTIPLE_OPEN, "AUDIO_MIXER_MULTIPLE_OPEN", 4350Sstevel@tonic-gate NULL }, 4360Sstevel@tonic-gate { (uint_t)AUDIO_MIXER_SINGLE_OPEN, "AUDIO_MIXER_SINGLE_OPEN", 4370Sstevel@tonic-gate NULL }, 4380Sstevel@tonic-gate { (uint_t)AUDIO_MIXER_GET_SAMPLE_RATES, "AUDIO_MIXER_GET_SAMPLE_RATES", 4390Sstevel@tonic-gate NULL }, 4400Sstevel@tonic-gate { (uint_t)AUDIO_MIXERCTL_GETINFO, "AUDIO_MIXERCTL_GETINFO", 4410Sstevel@tonic-gate NULL }, 4420Sstevel@tonic-gate { (uint_t)AUDIO_MIXERCTL_SETINFO, "AUDIO_MIXERCTL_SETINFO", 4430Sstevel@tonic-gate NULL }, 4440Sstevel@tonic-gate { (uint_t)AUDIO_MIXERCTL_GET_CHINFO, "AUDIO_MIXERCTL_GET_CHINFO", 4450Sstevel@tonic-gate NULL }, 4460Sstevel@tonic-gate { (uint_t)AUDIO_MIXERCTL_SET_CHINFO, "AUDIO_MIXERCTL_SET_CHINFO", 4470Sstevel@tonic-gate NULL }, 4480Sstevel@tonic-gate { (uint_t)AUDIO_MIXERCTL_GET_MODE, "AUDIO_MIXERCTL_GET_MODE", 4490Sstevel@tonic-gate NULL }, 4500Sstevel@tonic-gate { (uint_t)AUDIO_MIXERCTL_SET_MODE, "AUDIO_MIXERCTL_SET_MODE", 4510Sstevel@tonic-gate NULL }, 4520Sstevel@tonic-gate /* STREAMS redirection ioctls */ 4530Sstevel@tonic-gate { (uint_t)SRIOCSREDIR, "SRIOCSREDIR", NULL }, 4540Sstevel@tonic-gate { (uint_t)SRIOCISREDIR, "SRIOCISREDIR", NULL }, 4550Sstevel@tonic-gate { (uint_t)CPCIO_BIND, "CPCIO_BIND", NULL }, 4560Sstevel@tonic-gate { (uint_t)CPCIO_SAMPLE, "CPCIO_SAMPLE", NULL }, 4570Sstevel@tonic-gate { (uint_t)CPCIO_RELE, "CPCIO_RELE", NULL }, 4580Sstevel@tonic-gate /* /dev/poll ioctl() control codes */ 4590Sstevel@tonic-gate { (uint_t)DP_POLL, "DP_POLL", NULL }, 4600Sstevel@tonic-gate { (uint_t)DP_ISPOLLED, "DP_ISPOLLED", NULL }, 4610Sstevel@tonic-gate /* the old /proc ioctl() control codes */ 4620Sstevel@tonic-gate #define PIOC ('q'<<8) 4630Sstevel@tonic-gate { (uint_t)(PIOC|1), "PIOCSTATUS", NULL }, 4640Sstevel@tonic-gate { (uint_t)(PIOC|2), "PIOCSTOP", NULL }, 4650Sstevel@tonic-gate { (uint_t)(PIOC|3), "PIOCWSTOP", NULL }, 4660Sstevel@tonic-gate { (uint_t)(PIOC|4), "PIOCRUN", NULL }, 4670Sstevel@tonic-gate { (uint_t)(PIOC|5), "PIOCGTRACE", NULL }, 4680Sstevel@tonic-gate { (uint_t)(PIOC|6), "PIOCSTRACE", NULL }, 4690Sstevel@tonic-gate { (uint_t)(PIOC|7), "PIOCSSIG", NULL }, 4700Sstevel@tonic-gate { (uint_t)(PIOC|8), "PIOCKILL", NULL }, 4710Sstevel@tonic-gate { (uint_t)(PIOC|9), "PIOCUNKILL", NULL }, 4720Sstevel@tonic-gate { (uint_t)(PIOC|10), "PIOCGHOLD", NULL }, 4730Sstevel@tonic-gate { (uint_t)(PIOC|11), "PIOCSHOLD", NULL }, 4740Sstevel@tonic-gate { (uint_t)(PIOC|12), "PIOCMAXSIG", NULL }, 4750Sstevel@tonic-gate { (uint_t)(PIOC|13), "PIOCACTION", NULL }, 4760Sstevel@tonic-gate { (uint_t)(PIOC|14), "PIOCGFAULT", NULL }, 4770Sstevel@tonic-gate { (uint_t)(PIOC|15), "PIOCSFAULT", NULL }, 4780Sstevel@tonic-gate { (uint_t)(PIOC|16), "PIOCCFAULT", NULL }, 4790Sstevel@tonic-gate { (uint_t)(PIOC|17), "PIOCGENTRY", NULL }, 4800Sstevel@tonic-gate { (uint_t)(PIOC|18), "PIOCSENTRY", NULL }, 4810Sstevel@tonic-gate { (uint_t)(PIOC|19), "PIOCGEXIT", NULL }, 4820Sstevel@tonic-gate { (uint_t)(PIOC|20), "PIOCSEXIT", NULL }, 4830Sstevel@tonic-gate { (uint_t)(PIOC|21), "PIOCSFORK", NULL }, 4840Sstevel@tonic-gate { (uint_t)(PIOC|22), "PIOCRFORK", NULL }, 4850Sstevel@tonic-gate { (uint_t)(PIOC|23), "PIOCSRLC", NULL }, 4860Sstevel@tonic-gate { (uint_t)(PIOC|24), "PIOCRRLC", NULL }, 4870Sstevel@tonic-gate { (uint_t)(PIOC|25), "PIOCGREG", NULL }, 4880Sstevel@tonic-gate { (uint_t)(PIOC|26), "PIOCSREG", NULL }, 4890Sstevel@tonic-gate { (uint_t)(PIOC|27), "PIOCGFPREG", NULL }, 4900Sstevel@tonic-gate { (uint_t)(PIOC|28), "PIOCSFPREG", NULL }, 4910Sstevel@tonic-gate { (uint_t)(PIOC|29), "PIOCNICE", NULL }, 4920Sstevel@tonic-gate { (uint_t)(PIOC|30), "PIOCPSINFO", NULL }, 4930Sstevel@tonic-gate { (uint_t)(PIOC|31), "PIOCNMAP", NULL }, 4940Sstevel@tonic-gate { (uint_t)(PIOC|32), "PIOCMAP", NULL }, 4950Sstevel@tonic-gate { (uint_t)(PIOC|33), "PIOCOPENM", NULL }, 4960Sstevel@tonic-gate { (uint_t)(PIOC|34), "PIOCCRED", NULL }, 4970Sstevel@tonic-gate { (uint_t)(PIOC|35), "PIOCGROUPS", NULL }, 4980Sstevel@tonic-gate { (uint_t)(PIOC|36), "PIOCGETPR", NULL }, 4990Sstevel@tonic-gate { (uint_t)(PIOC|37), "PIOCGETU", NULL }, 5000Sstevel@tonic-gate { (uint_t)(PIOC|38), "PIOCSET", NULL }, 5010Sstevel@tonic-gate { (uint_t)(PIOC|39), "PIOCRESET", NULL }, 5020Sstevel@tonic-gate { (uint_t)(PIOC|43), "PIOCUSAGE", NULL }, 5030Sstevel@tonic-gate { (uint_t)(PIOC|44), "PIOCOPENPD", NULL }, 5040Sstevel@tonic-gate { (uint_t)(PIOC|45), "PIOCLWPIDS", NULL }, 5050Sstevel@tonic-gate { (uint_t)(PIOC|46), "PIOCOPENLWP", NULL }, 5060Sstevel@tonic-gate { (uint_t)(PIOC|47), "PIOCLSTATUS", NULL }, 5070Sstevel@tonic-gate { (uint_t)(PIOC|48), "PIOCLUSAGE", NULL }, 5080Sstevel@tonic-gate { (uint_t)(PIOC|49), "PIOCNAUXV", NULL }, 5090Sstevel@tonic-gate { (uint_t)(PIOC|50), "PIOCAUXV", NULL }, 5100Sstevel@tonic-gate { (uint_t)(PIOC|51), "PIOCGXREGSIZE", NULL }, 5110Sstevel@tonic-gate { (uint_t)(PIOC|52), "PIOCGXREG", NULL }, 5120Sstevel@tonic-gate { (uint_t)(PIOC|53), "PIOCSXREG", NULL }, 5130Sstevel@tonic-gate { (uint_t)(PIOC|101), "PIOCGWIN", NULL }, 5140Sstevel@tonic-gate { (uint_t)(PIOC|103), "PIOCNLDT", NULL }, 5150Sstevel@tonic-gate { (uint_t)(PIOC|104), "PIOCLDT", NULL }, 5160Sstevel@tonic-gate 5170Sstevel@tonic-gate /* ioctl's applicable on sockets */ 5180Sstevel@tonic-gate { (uint_t)SIOCSHIWAT, "SIOCSHIWAT", NULL }, 5190Sstevel@tonic-gate { (uint_t)SIOCGHIWAT, "SIOCGHIWAT", NULL }, 5200Sstevel@tonic-gate { (uint_t)SIOCSLOWAT, "SIOCSLOWAT", NULL }, 5210Sstevel@tonic-gate { (uint_t)SIOCGLOWAT, "SIOCGLOWAT", NULL }, 5220Sstevel@tonic-gate { (uint_t)SIOCATMARK, "SIOCATMARK", NULL }, 5230Sstevel@tonic-gate { (uint_t)SIOCSPGRP, "SIOCSPGRP", NULL }, 5240Sstevel@tonic-gate { (uint_t)SIOCGPGRP, "SIOCGPGRP", NULL }, 5250Sstevel@tonic-gate { (uint_t)SIOCADDRT, "SIOCADDRT", "rtentry" }, 5260Sstevel@tonic-gate { (uint_t)SIOCDELRT, "SIOCDELRT", "rtentry" }, 5270Sstevel@tonic-gate { (uint_t)SIOCGETVIFCNT, "SIOCGETVIFCNT", "sioc_vif_req" }, 5280Sstevel@tonic-gate { (uint_t)SIOCGETSGCNT, "SIOCGETSGCNT", "sioc_sg_req" }, 5290Sstevel@tonic-gate { (uint_t)SIOCGETLSGCNT, "SIOCGETLSGCNT", "sioc_lsg_req" }, 5300Sstevel@tonic-gate { (uint_t)SIOCSIFADDR, "SIOCSIFADDR", "ifreq" }, 5310Sstevel@tonic-gate { (uint_t)SIOCGIFADDR, "SIOCGIFADDR", "ifreq" }, 5320Sstevel@tonic-gate { (uint_t)SIOCSIFDSTADDR, "SIOCSIFDSTADDR", "ifreq" }, 5330Sstevel@tonic-gate { (uint_t)SIOCGIFDSTADDR, "SIOCGIFDSTADDR", "ifreq" }, 5340Sstevel@tonic-gate { (uint_t)SIOCSIFFLAGS, "SIOCSIFFLAGS", "ifreq" }, 5350Sstevel@tonic-gate { (uint_t)SIOCGIFFLAGS, "SIOCGIFFLAGS", "ifreq" }, 5360Sstevel@tonic-gate { (uint_t)SIOCSIFMEM, "SIOCSIFMEM", "ifreq" }, 5370Sstevel@tonic-gate { (uint_t)SIOCGIFMEM, "SIOCGIFMEM", "ifreq" }, 5380Sstevel@tonic-gate { (uint_t)SIOCGIFCONF, "SIOCGIFCONF", "ifconf" }, 5390Sstevel@tonic-gate { (uint_t)SIOCSIFMTU, "SIOCSIFMTU", "ifreq" }, 5400Sstevel@tonic-gate { (uint_t)SIOCGIFMTU, "SIOCGIFMTU", "ifreq" }, 5410Sstevel@tonic-gate { (uint_t)SIOCGIFBRDADDR, "SIOCGIFBRDADDR", "ifreq" }, 5420Sstevel@tonic-gate { (uint_t)SIOCSIFBRDADDR, "SIOCSIFBRDADDR", "ifreq" }, 5430Sstevel@tonic-gate { (uint_t)SIOCGIFNETMASK, "SIOCGIFNETMASK", "ifreq" }, 5440Sstevel@tonic-gate { (uint_t)SIOCSIFNETMASK, "SIOCSIFNETMASK", "ifreq" }, 5450Sstevel@tonic-gate { (uint_t)SIOCGIFMETRIC, "SIOCGIFMETRIC", "ifreq" }, 5460Sstevel@tonic-gate { (uint_t)SIOCSIFMETRIC, "SIOCSIFMETRIC", "ifreq" }, 5470Sstevel@tonic-gate { (uint_t)SIOCSARP, "SIOCSARP", "arpreq" }, 5480Sstevel@tonic-gate { (uint_t)SIOCGARP, "SIOCGARP", "arpreq" }, 5490Sstevel@tonic-gate { (uint_t)SIOCDARP, "SIOCDARP", "arpreq" }, 5500Sstevel@tonic-gate { (uint_t)SIOCUPPER, "SIOCUPPER", "ifreq" }, 5510Sstevel@tonic-gate { (uint_t)SIOCLOWER, "SIOCLOWER", "ifreq" }, 5520Sstevel@tonic-gate { (uint_t)SIOCSETSYNC, "SIOCSETSYNC", "ifreq" }, 5530Sstevel@tonic-gate { (uint_t)SIOCGETSYNC, "SIOCGETSYNC", "ifreq" }, 5540Sstevel@tonic-gate { (uint_t)SIOCSSDSTATS, "SIOCSSDSTATS", "ifreq" }, 5550Sstevel@tonic-gate { (uint_t)SIOCSSESTATS, "SIOCSSESTATS", "ifreq" }, 5560Sstevel@tonic-gate { (uint_t)SIOCSPROMISC, "SIOCSPROMISC", NULL }, 5570Sstevel@tonic-gate { (uint_t)SIOCADDMULTI, "SIOCADDMULTI", "ifreq" }, 5580Sstevel@tonic-gate { (uint_t)SIOCDELMULTI, "SIOCDELMULTI", "ifreq" }, 5590Sstevel@tonic-gate { (uint_t)SIOCGETNAME, "SIOCGETNAME", "sockaddr" }, 5600Sstevel@tonic-gate { (uint_t)SIOCGETPEER, "SIOCGETPEER", "sockaddr" }, 5610Sstevel@tonic-gate { (uint_t)IF_UNITSEL, "IF_UNITSEL", NULL }, 5620Sstevel@tonic-gate { (uint_t)SIOCXPROTO, "SIOCXPROTO", NULL }, 5630Sstevel@tonic-gate { (uint_t)SIOCIFDETACH, "SIOCIFDETACH", "ifreq" }, 5640Sstevel@tonic-gate { (uint_t)SIOCGENPSTATS, "SIOCGENPSTATS", "ifreq" }, 5650Sstevel@tonic-gate { (uint_t)SIOCX25XMT, "SIOCX25XMT", "ifreq" }, 5660Sstevel@tonic-gate { (uint_t)SIOCX25RCV, "SIOCX25RCV", "ifreq" }, 5670Sstevel@tonic-gate { (uint_t)SIOCX25TBL, "SIOCX25TBL", "ifreq" }, 5680Sstevel@tonic-gate { (uint_t)SIOCSLGETREQ, "SIOCSLGETREQ", "ifreq" }, 5690Sstevel@tonic-gate { (uint_t)SIOCSLSTAT, "SIOCSLSTAT", "ifreq" }, 5700Sstevel@tonic-gate { (uint_t)SIOCSIFNAME, "SIOCSIFNAME", "ifreq" }, 5710Sstevel@tonic-gate { (uint_t)SIOCGENADDR, "SIOCGENADDR", "ifreq" }, 5720Sstevel@tonic-gate { (uint_t)SIOCGIFNUM, "SIOCGIFNUM", NULL }, 5730Sstevel@tonic-gate { (uint_t)SIOCGIFMUXID, "SIOCGIFMUXID", "ifreq" }, 5740Sstevel@tonic-gate { (uint_t)SIOCSIFMUXID, "SIOCSIFMUXID", "ifreq" }, 5750Sstevel@tonic-gate { (uint_t)SIOCGIFINDEX, "SIOCGIFINDEX", "ifreq" }, 5760Sstevel@tonic-gate { (uint_t)SIOCSIFINDEX, "SIOCSIFINDEX", "ifreq" }, 5770Sstevel@tonic-gate { (uint_t)SIOCLIFREMOVEIF, "SIOCLIFREMOVEIF", "lifreq" }, 5780Sstevel@tonic-gate { (uint_t)SIOCLIFADDIF, "SIOCLIFADDIF", "lifreq" }, 5790Sstevel@tonic-gate { (uint_t)SIOCSLIFADDR, "SIOCSLIFADDR", "lifreq" }, 5800Sstevel@tonic-gate { (uint_t)SIOCGLIFADDR, "SIOCGLIFADDR", "lifreq" }, 5810Sstevel@tonic-gate { (uint_t)SIOCSLIFDSTADDR, "SIOCSLIFDSTADDR", "lifreq" }, 5820Sstevel@tonic-gate { (uint_t)SIOCGLIFDSTADDR, "SIOCGLIFDSTADDR", "lifreq" }, 5830Sstevel@tonic-gate { (uint_t)SIOCSLIFFLAGS, "SIOCSLIFFLAGS", "lifreq" }, 5840Sstevel@tonic-gate { (uint_t)SIOCGLIFFLAGS, "SIOCGLIFFLAGS", "lifreq" }, 5850Sstevel@tonic-gate { (uint_t)SIOCGLIFCONF, "SIOCGLIFCONF", "lifconf" }, 5860Sstevel@tonic-gate { (uint_t)SIOCSLIFMTU, "SIOCSLIFMTU", "lifreq" }, 5870Sstevel@tonic-gate { (uint_t)SIOCGLIFMTU, "SIOCGLIFMTU", "lifreq" }, 5880Sstevel@tonic-gate { (uint_t)SIOCGLIFBRDADDR, "SIOCGLIFBRDADDR", "lifreq" }, 5890Sstevel@tonic-gate { (uint_t)SIOCSLIFBRDADDR, "SIOCSLIFBRDADDR", "lifreq" }, 5900Sstevel@tonic-gate { (uint_t)SIOCGLIFNETMASK, "SIOCGLIFNETMASK", "lifreq" }, 5910Sstevel@tonic-gate { (uint_t)SIOCSLIFNETMASK, "SIOCSLIFNETMASK", "lifreq" }, 5920Sstevel@tonic-gate { (uint_t)SIOCGLIFMETRIC, "SIOCGLIFMETRIC", "lifreq" }, 5930Sstevel@tonic-gate { (uint_t)SIOCSLIFMETRIC, "SIOCSLIFMETRIC", "lifreq" }, 5940Sstevel@tonic-gate { (uint_t)SIOCSLIFNAME, "SIOCSLIFNAME", "lifreq" }, 5950Sstevel@tonic-gate { (uint_t)SIOCGLIFNUM, "SIOCGLIFNUM", "lifnum" }, 5960Sstevel@tonic-gate { (uint_t)SIOCGLIFMUXID, "SIOCGLIFMUXID", "lifreq" }, 5970Sstevel@tonic-gate { (uint_t)SIOCSLIFMUXID, "SIOCSLIFMUXID", "lifreq" }, 5980Sstevel@tonic-gate { (uint_t)SIOCGLIFINDEX, "SIOCGLIFINDEX", "lifreq" }, 5990Sstevel@tonic-gate { (uint_t)SIOCSLIFINDEX, "SIOCSLIFINDEX", "lifreq" }, 6000Sstevel@tonic-gate { (uint_t)SIOCSLIFTOKEN, "SIOCSLIFTOKEN", "lifreq" }, 6010Sstevel@tonic-gate { (uint_t)SIOCGLIFTOKEN, "SIOCGLIFTOKEN", "lifreq" }, 6020Sstevel@tonic-gate { (uint_t)SIOCSLIFSUBNET, "SIOCSLIFSUBNET", "lifreq" }, 6030Sstevel@tonic-gate { (uint_t)SIOCGLIFSUBNET, "SIOCGLIFSUBNET", "lifreq" }, 6040Sstevel@tonic-gate { (uint_t)SIOCSLIFLNKINFO, "SIOCSLIFLNKINFO", "lifreq" }, 6050Sstevel@tonic-gate { (uint_t)SIOCGLIFLNKINFO, "SIOCGLIFLNKINFO", "lifreq" }, 6060Sstevel@tonic-gate { (uint_t)SIOCLIFDELND, "SIOCLIFDELND", "lifreq" }, 6070Sstevel@tonic-gate { (uint_t)SIOCLIFGETND, "SIOCLIFGETND", "lifreq" }, 6080Sstevel@tonic-gate { (uint_t)SIOCLIFSETND, "SIOCLIFSETND", "lifreq" }, 6090Sstevel@tonic-gate { (uint_t)SIOCTMYADDR, "SIOCTMYADDR", "sioc_addrreq" }, 6100Sstevel@tonic-gate { (uint_t)SIOCTONLINK, "SIOCTONLINK", "sioc_addrreq" }, 6110Sstevel@tonic-gate { (uint_t)SIOCTMYSITE, "SIOCTMYSITE", "sioc_addrreq" }, 6120Sstevel@tonic-gate { (uint_t)SIOCGTUNPARAM, "SIOCGTUNPARAM", "iftun_req" }, 6130Sstevel@tonic-gate { (uint_t)SIOCSTUNPARAM, "SIOCSTUNPARAM", "iftun_req" }, 6140Sstevel@tonic-gate { (uint_t)SIOCFIPSECONFIG, "SIOCFIPSECONFIG", NULL }, 6150Sstevel@tonic-gate { (uint_t)SIOCSIPSECONFIG, "SIOCSIPSECONFIG", NULL }, 6160Sstevel@tonic-gate { (uint_t)SIOCDIPSECONFIG, "SIOCDIPSECONFIG", NULL }, 6170Sstevel@tonic-gate { (uint_t)SIOCLIPSECONFIG, "SIOCLIPSECONFIG", NULL }, 6180Sstevel@tonic-gate { (uint_t)SIOCLIFFAILOVER, "SIOCLIFFAILOVER", "lifreq" }, 6190Sstevel@tonic-gate { (uint_t)SIOCLIFFAILBACK, "SIOCLIFFAILBACK", "lifreq" }, 6201013Sethindra { (uint_t)SIOCSIPMPFAILBACK, "SIOCSIPMPFAILBACK", NULL }, 6210Sstevel@tonic-gate { (uint_t)SIOCSLIFGROUPNAME, "SIOCSLIFGROUPNAME", "lifreq" }, 6220Sstevel@tonic-gate { (uint_t)SIOCGLIFGROUPNAME, "SIOCGLIFGROUPNAME", "lifreq" }, 6230Sstevel@tonic-gate { (uint_t)SIOCGLIFOINDEX, "SIOCGLIFOINDEX", "lifreq" }, 6240Sstevel@tonic-gate { (uint_t)SIOCSLIFOINDEX, "SIOCSLIFOINDEX", "lifreq" }, 6250Sstevel@tonic-gate { (uint_t)SIOCGDSTINFO, "SIOCGDSTINFO", NULL }, 6260Sstevel@tonic-gate { (uint_t)SIOCGIP6ADDRPOLICY, "SIOCGIP6ADDRPOLICY", NULL }, 6270Sstevel@tonic-gate { (uint_t)SIOCSIP6ADDRPOLICY, "SIOCSIP6ADDRPOLICY", NULL }, 6280Sstevel@tonic-gate { (uint_t)SIOCSXARP, "SIOCSXARP", "xarpreq" }, 6290Sstevel@tonic-gate { (uint_t)SIOCGXARP, "SIOCGXARP", "xarpreq" }, 6300Sstevel@tonic-gate { (uint_t)SIOCDXARP, "SIOCDXARP", "xarpreq" }, 6310Sstevel@tonic-gate { (uint_t)SIOCGLIFZONE, "SIOCGLIFZONE", "lifreq" }, 6320Sstevel@tonic-gate { (uint_t)SIOCSLIFZONE, "SIOCSLIFZONE", "lifreq" }, 6330Sstevel@tonic-gate { (uint_t)SIOCSCTPSOPT, "SIOCSCTPSOPT", NULL }, 6340Sstevel@tonic-gate { (uint_t)SIOCSCTPGOPT, "SIOCSCTPGOPT", NULL }, 6350Sstevel@tonic-gate { (uint_t)SIOCSCTPPEELOFF, "SIOPCSCTPPEELOFF", "int" }, 6360Sstevel@tonic-gate { (uint_t)SIOCGLIFUSESRC, "SIOCGLIFUSESRC", "lifreq" }, 6370Sstevel@tonic-gate { (uint_t)SIOCSLIFUSESRC, "SIOCSLIFUSESRC", "lifreq" }, 6380Sstevel@tonic-gate { (uint_t)SIOCGLIFSRCOF, "SIOCGLIFSRCOF", "lifsrcof" }, 6390Sstevel@tonic-gate { (uint_t)SIOCGMSFILTER, "SIOCGMSFILTER", "group_filter" }, 6400Sstevel@tonic-gate { (uint_t)SIOCSMSFILTER, "SIOCSMSFILTER", "group_filter" }, 6410Sstevel@tonic-gate { (uint_t)SIOCGIPMSFILTER, "SIOCGIPMSFILTER", "ip_msfilter" }, 6420Sstevel@tonic-gate { (uint_t)SIOCSIPMSFILTER, "SIOCSIPMSFILTER", "ip_msfilter" }, 6430Sstevel@tonic-gate 6440Sstevel@tonic-gate /* DES encryption */ 6450Sstevel@tonic-gate { (uint_t)DESIOCBLOCK, "DESIOCBLOCK", "desparams" }, 6460Sstevel@tonic-gate { (uint_t)DESIOCQUICK, "DESIOCQUICK", "desparams" }, 6470Sstevel@tonic-gate 6480Sstevel@tonic-gate /* Printing system */ 6490Sstevel@tonic-gate { (uint_t)PRNIOC_GET_IFCAP, "PRNIOC_GET_IFCAP", NULL }, 6500Sstevel@tonic-gate { (uint_t)PRNIOC_SET_IFCAP, "PRNIOC_SET_IFCAP", NULL }, 6510Sstevel@tonic-gate { (uint_t)PRNIOC_GET_IFINFO, "PRNIOC_GET_IFINFO", 6520Sstevel@tonic-gate "prn_interface_info" }, 6530Sstevel@tonic-gate { (uint_t)PRNIOC_GET_STATUS, "PRNIOC_GET_STATUS", NULL }, 6540Sstevel@tonic-gate { (uint_t)PRNIOC_GET_1284_DEVID, "PRNIOC_GET_1284_DEVID", 6550Sstevel@tonic-gate "prn_1284_device_id" }, 6560Sstevel@tonic-gate { (uint_t)PRNIOC_GET_1284_STATUS, 6570Sstevel@tonic-gate "PRNIOC_GET_IFCANIOC_GET_1284_STATUS", NULL }, 6580Sstevel@tonic-gate { (uint_t)PRNIOC_GET_TIMEOUTS, "PRNIOC_GET_TIMEOUTS", 6590Sstevel@tonic-gate "prn_timeouts" }, 6600Sstevel@tonic-gate { (uint_t)PRNIOC_SET_TIMEOUTS, "PRNIOC_SET_TIMEOUTS", 6610Sstevel@tonic-gate "prn_timeouts" }, 6620Sstevel@tonic-gate { (uint_t)PRNIOC_RESET, "PRNIOC_RESET", NULL }, 6630Sstevel@tonic-gate 6640Sstevel@tonic-gate /* DTrace */ 6650Sstevel@tonic-gate { (uint_t)DTRACEIOC_PROVIDER, "DTRACEIOC_PROVIDER", NULL }, 6660Sstevel@tonic-gate { (uint_t)DTRACEIOC_PROBES, "DTRACEIOC_PROBES", NULL }, 6670Sstevel@tonic-gate { (uint_t)DTRACEIOC_BUFSNAP, "DTRACEIOC_BUFSNAP", NULL }, 6680Sstevel@tonic-gate { (uint_t)DTRACEIOC_PROBEMATCH, "DTRACEIOC_PROBEMATCH", NULL }, 6690Sstevel@tonic-gate { (uint_t)DTRACEIOC_ENABLE, "DTRACEIOC_ENABLE", NULL }, 6700Sstevel@tonic-gate { (uint_t)DTRACEIOC_AGGSNAP, "DTRACEIOC_AGGSNAP", NULL }, 6710Sstevel@tonic-gate { (uint_t)DTRACEIOC_EPROBE, "DTRACEIOC_EPROBE", NULL }, 6720Sstevel@tonic-gate { (uint_t)DTRACEIOC_PROBEARG, "DTRACEIOC_PROBEARG", NULL }, 6730Sstevel@tonic-gate { (uint_t)DTRACEIOC_CONF, "DTRACEIOC_CONF", NULL }, 6740Sstevel@tonic-gate { (uint_t)DTRACEIOC_STATUS, "DTRACEIOC_STATUS", NULL }, 6750Sstevel@tonic-gate { (uint_t)DTRACEIOC_GO, "DTRACEIOC_GO", NULL }, 6760Sstevel@tonic-gate { (uint_t)DTRACEIOC_STOP, "DTRACEIOC_STOP", NULL }, 6770Sstevel@tonic-gate { (uint_t)DTRACEIOC_AGGDESC, "DTRACEIOC_AGGDESC", NULL }, 6780Sstevel@tonic-gate { (uint_t)DTRACEIOC_FORMAT, "DTRACEIOC_FORMAT", NULL }, 6790Sstevel@tonic-gate { (uint_t)DTRACEIOC_DOFGET, "DTRACEIOC_DOFGET", NULL }, 6800Sstevel@tonic-gate { (uint_t)DTRACEIOC_REPLICATE, "DTRACEIOC_REPLICATE", NULL }, 6810Sstevel@tonic-gate 6820Sstevel@tonic-gate { (uint_t)DTRACEHIOC_ADD, "DTRACEHIOC_ADD", NULL }, 6830Sstevel@tonic-gate { (uint_t)DTRACEHIOC_REMOVE, "DTRACEHIOC_REMOVE", NULL }, 6840Sstevel@tonic-gate { (uint_t)DTRACEHIOC_ADDDOF, "DTRACEHIOC_ADDDOF", NULL }, 6850Sstevel@tonic-gate 6860Sstevel@tonic-gate /* /dev/cryptoadm ioctl() control codes */ 6870Sstevel@tonic-gate { (uint_t)CRYPTO_GET_VERSION, "CRYPTO_GET_VERSION", NULL }, 6880Sstevel@tonic-gate { (uint_t)CRYPTO_GET_DEV_LIST, "CRYPTO_GET_DEV_LIST", NULL }, 6890Sstevel@tonic-gate { (uint_t)CRYPTO_GET_SOFT_LIST, "CRYPTO_GET_SOFT_LIST", NULL }, 6900Sstevel@tonic-gate { (uint_t)CRYPTO_GET_DEV_INFO, "CRYPTO_GET_DEV_INFO", NULL }, 6910Sstevel@tonic-gate { (uint_t)CRYPTO_GET_SOFT_INFO, "CRYPTO_GET_SOFT_INFO", NULL }, 6920Sstevel@tonic-gate { (uint_t)CRYPTO_LOAD_DEV_DISABLED, "CRYPTO_LOAD_DEV_DISABLED", 6930Sstevel@tonic-gate NULL }, 6940Sstevel@tonic-gate { (uint_t)CRYPTO_LOAD_SOFT_DISABLED, "CRYPTO_LOAD_SOFT_DISABLED", 6950Sstevel@tonic-gate NULL }, 6960Sstevel@tonic-gate { (uint_t)CRYPTO_UNLOAD_SOFT_MODULE, "CRYPTO_UNLOAD_SOFT_MODULE", 6970Sstevel@tonic-gate NULL }, 6980Sstevel@tonic-gate { (uint_t)CRYPTO_LOAD_SOFT_CONFIG, "CRYPTO_LOAD_SOFT_CONFIG", 6990Sstevel@tonic-gate NULL }, 7000Sstevel@tonic-gate { (uint_t)CRYPTO_POOL_CREATE, "CRYPTO_POOL_CREATE", NULL }, 7010Sstevel@tonic-gate { (uint_t)CRYPTO_POOL_WAIT, "CRYPTO_POOL_WAIT", NULL }, 7020Sstevel@tonic-gate { (uint_t)CRYPTO_POOL_RUN, "CRYPTO_POOL_RUN", NULL }, 7030Sstevel@tonic-gate { (uint_t)CRYPTO_LOAD_DOOR, "CRYPTO_LOAD_DOOR", NULL }, 7040Sstevel@tonic-gate 7050Sstevel@tonic-gate /* /dev/crypto ioctl() control codes */ 7060Sstevel@tonic-gate { (uint_t)CRYPTO_GET_FUNCTION_LIST, "CRYPTO_GET_FUNCTION_LIST", 7070Sstevel@tonic-gate NULL }, 7080Sstevel@tonic-gate { (uint_t)CRYPTO_GET_MECHANISM_NUMBER, "CRYPTO_GET_MECHANISM_NUMBER", 7090Sstevel@tonic-gate NULL }, 7100Sstevel@tonic-gate { (uint_t)CRYPTO_OPEN_SESSION, "CRYPTO_OPEN_SESSION", NULL }, 7110Sstevel@tonic-gate { (uint_t)CRYPTO_CLOSE_SESSION, "CRYPTO_CLOSE_SESSION", NULL }, 7120Sstevel@tonic-gate { (uint_t)CRYPTO_CLOSE_ALL_SESSIONS, "CRYPTO_CLOSE_ALL_SESSIONS", 7130Sstevel@tonic-gate NULL }, 7140Sstevel@tonic-gate { (uint_t)CRYPTO_LOGIN, "CRYPTO_LOGIN", NULL }, 7150Sstevel@tonic-gate { (uint_t)CRYPTO_LOGOUT, "CRYPTO_LOGOUT", NULL }, 7160Sstevel@tonic-gate { (uint_t)CRYPTO_ENCRYPT, "CRYPTO_ENCRYPT", NULL }, 7170Sstevel@tonic-gate { (uint_t)CRYPTO_ENCRYPT_INIT, "CRYPTO_ENCRYPT_INIT", NULL }, 7180Sstevel@tonic-gate { (uint_t)CRYPTO_ENCRYPT_UPDATE, "CRYPTO_ENCRYPT_UPDATE", 7190Sstevel@tonic-gate NULL }, 7200Sstevel@tonic-gate { (uint_t)CRYPTO_ENCRYPT_FINAL, "CRYPTO_ENCRYPT_FINAL", NULL }, 7210Sstevel@tonic-gate { (uint_t)CRYPTO_DECRYPT, "CRYPTO_DECRYPT", NULL }, 7220Sstevel@tonic-gate { (uint_t)CRYPTO_DECRYPT_INIT, "CRYPTO_DECRYPT_INIT", NULL }, 7230Sstevel@tonic-gate { (uint_t)CRYPTO_DECRYPT_UPDATE, "CRYPTO_DECRYPT_UPDATE", 7240Sstevel@tonic-gate NULL }, 7250Sstevel@tonic-gate { (uint_t)CRYPTO_DECRYPT_FINAL, "CRYPTO_DECRYPT_FINAL", NULL }, 7260Sstevel@tonic-gate { (uint_t)CRYPTO_DIGEST, "CRYPTO_DIGEST", NULL }, 7270Sstevel@tonic-gate { (uint_t)CRYPTO_DIGEST_INIT, "CRYPTO_DIGEST_INIT", NULL }, 7280Sstevel@tonic-gate { (uint_t)CRYPTO_DIGEST_UPDATE, "CRYPTO_DIGEST_UPDATE", NULL }, 7290Sstevel@tonic-gate { (uint_t)CRYPTO_DIGEST_KEY, "CRYPTO_DIGEST_KEY", NULL }, 7300Sstevel@tonic-gate { (uint_t)CRYPTO_DIGEST_FINAL, "CRYPTO_DIGEST_FINAL", NULL }, 7310Sstevel@tonic-gate { (uint_t)CRYPTO_MAC, "CRYPTO_MAC", NULL }, 7320Sstevel@tonic-gate { (uint_t)CRYPTO_MAC_INIT, "CRYPTO_MAC_INIT", NULL }, 7330Sstevel@tonic-gate { (uint_t)CRYPTO_MAC_UPDATE, "CRYPTO_MAC_UPDATE", NULL }, 7340Sstevel@tonic-gate { (uint_t)CRYPTO_MAC_FINAL, "CRYPTO_MAC_FINAL", NULL }, 7350Sstevel@tonic-gate { (uint_t)CRYPTO_SIGN, "CRYPTO_SIGN", NULL }, 7360Sstevel@tonic-gate { (uint_t)CRYPTO_SIGN_INIT, "CRYPTO_SIGN_INIT", NULL }, 7370Sstevel@tonic-gate { (uint_t)CRYPTO_SIGN_UPDATE, "CRYPTO_SIGN_UPDATE", NULL }, 7380Sstevel@tonic-gate { (uint_t)CRYPTO_SIGN_FINAL, "CRYPTO_SIGN_FINAL", NULL }, 7390Sstevel@tonic-gate { (uint_t)CRYPTO_SIGN_RECOVER_INIT, "CRYPTO_SIGN_RECOVER_INIT", 7400Sstevel@tonic-gate NULL }, 7410Sstevel@tonic-gate { (uint_t)CRYPTO_SIGN_RECOVER, "CRYPTO_SIGN_RECOVER", NULL }, 7420Sstevel@tonic-gate { (uint_t)CRYPTO_VERIFY, "CRYPTO_VERIFY", NULL }, 7430Sstevel@tonic-gate { (uint_t)CRYPTO_VERIFY_INIT, "CRYPTO_VERIFY_INIT", NULL }, 7440Sstevel@tonic-gate { (uint_t)CRYPTO_VERIFY_UPDATE, "CRYPTO_VERIFY_UPDATE", NULL }, 7450Sstevel@tonic-gate { (uint_t)CRYPTO_VERIFY_FINAL, "CRYPTO_VERIFY_FINAL", NULL }, 7460Sstevel@tonic-gate { (uint_t)CRYPTO_VERIFY_RECOVER_INIT, "CRYPTO_VERIFY_RECOVER_INIT", 7470Sstevel@tonic-gate NULL }, 7480Sstevel@tonic-gate { (uint_t)CRYPTO_VERIFY_RECOVER, "CRYPTO_VERIFY_RECOVER", 7490Sstevel@tonic-gate NULL }, 7500Sstevel@tonic-gate { (uint_t)CRYPTO_DIGEST_ENCRYPT_UPDATE, "CRYPTO_DIGEST_ENCRYPT_UPDATE", 7510Sstevel@tonic-gate NULL }, 7520Sstevel@tonic-gate { (uint_t)CRYPTO_DECRYPT_DIGEST_UPDATE, "CRYPTO_DECRYPT_DIGEST_UPDATE", 7530Sstevel@tonic-gate NULL }, 7540Sstevel@tonic-gate { (uint_t)CRYPTO_SIGN_ENCRYPT_UPDATE, "CRYPTO_SIGN_ENCRYPT_UPDATE", 7550Sstevel@tonic-gate NULL }, 7560Sstevel@tonic-gate { (uint_t)CRYPTO_DECRYPT_VERIFY_UPDATE, "CRYPTO_DECRYPT_VERIFY_UPDATE", 7570Sstevel@tonic-gate NULL }, 7580Sstevel@tonic-gate { (uint_t)CRYPTO_SEED_RANDOM, "CRYPTO_SEED_RANDOM", NULL }, 7590Sstevel@tonic-gate { (uint_t)CRYPTO_GENERATE_RANDOM, "CRYPTO_GENERATE_RANDOM", 7600Sstevel@tonic-gate NULL }, 7610Sstevel@tonic-gate { (uint_t)CRYPTO_OBJECT_CREATE, "CRYPTO_OBJECT_CREATE", NULL }, 7620Sstevel@tonic-gate { (uint_t)CRYPTO_OBJECT_COPY, "CRYPTO_OBJECT_COPY", NULL }, 7630Sstevel@tonic-gate { (uint_t)CRYPTO_OBJECT_DESTROY, "CRYPTO_OBJECT_DESTROY", 7640Sstevel@tonic-gate NULL }, 7650Sstevel@tonic-gate { (uint_t)CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE, 7660Sstevel@tonic-gate "CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE", NULL }, 7670Sstevel@tonic-gate { (uint_t)CRYPTO_OBJECT_GET_SIZE, "CRYPTO_OBJECT_GET_SIZE", NULL }, 7680Sstevel@tonic-gate { (uint_t)CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE, 7690Sstevel@tonic-gate "CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE", NULL }, 7700Sstevel@tonic-gate { (uint_t)CRYPTO_OBJECT_FIND_INIT, "CRYPTO_OBJECT_FIND_INIT", 7710Sstevel@tonic-gate NULL }, 7720Sstevel@tonic-gate { (uint_t)CRYPTO_OBJECT_FIND_UPDATE, "CRYPTO_OBJECT_FIND_UPDATE", 7730Sstevel@tonic-gate NULL }, 7740Sstevel@tonic-gate { (uint_t)CRYPTO_OBJECT_FIND_FINAL, "CRYPTO_OBJECT_FIND_FINAL", 7750Sstevel@tonic-gate NULL }, 7760Sstevel@tonic-gate { (uint_t)CRYPTO_GENERATE_KEY, "CRYPTO_GENERATE_KEY", NULL }, 7770Sstevel@tonic-gate { (uint_t)CRYPTO_GENERATE_KEY_PAIR, "CRYPTO_GENERATE_KEY_PAIR", 7780Sstevel@tonic-gate NULL }, 7790Sstevel@tonic-gate { (uint_t)CRYPTO_WRAP_KEY, "CRYPTO_WRAP_KEY", NULL }, 7800Sstevel@tonic-gate { (uint_t)CRYPTO_UNWRAP_KEY, "CRYPTO_UNWRAP_KEY", NULL }, 7810Sstevel@tonic-gate { (uint_t)CRYPTO_DERIVE_KEY, "CRYPTO_DERIVE_KEY", NULL }, 7820Sstevel@tonic-gate { (uint_t)CRYPTO_GET_PROVIDER_LIST, "CRYPTO_GET_PROVIDER_LIST", 7830Sstevel@tonic-gate NULL }, 7840Sstevel@tonic-gate { (uint_t)CRYPTO_GET_PROVIDER_INFO, "CRYPTO_GET_PROVIDER_INFO", 7850Sstevel@tonic-gate NULL }, 7860Sstevel@tonic-gate { (uint_t)CRYPTO_GET_PROVIDER_MECHANISMS, 7870Sstevel@tonic-gate "CRYPTO_GET_PROVIDER_MECHANISMS", NULL }, 7880Sstevel@tonic-gate { (uint_t)CRYPTO_GET_PROVIDER_MECHANISM_INFO, 7890Sstevel@tonic-gate "CRYPTO_GET_PROVIDER_MECHANISM_INFO", NULL }, 7900Sstevel@tonic-gate { (uint_t)CRYPTO_INIT_TOKEN, "CRYPTO_INIT_TOKEN", NULL }, 7910Sstevel@tonic-gate { (uint_t)CRYPTO_INIT_PIN, "CRYPTO_INIT_PIN", NULL }, 7920Sstevel@tonic-gate { (uint_t)CRYPTO_SET_PIN, "CRYPTO_SET_PIN", NULL }, 7934219Smcpowers { (uint_t)CRYPTO_NOSTORE_GENERATE_KEY, 7944219Smcpowers "CRYPTO_NOSTORE_GENERATE_KEY", NULL }, 7954219Smcpowers { (uint_t)CRYPTO_NOSTORE_GENERATE_KEY_PAIR, 7964219Smcpowers "CRYPTO_NOSTORE_GENERATE_KEY_PAIR", NULL }, 7974219Smcpowers { (uint_t)CRYPTO_NOSTORE_DERIVE_KEY, 7984219Smcpowers "CRYPTO_NOSTORE_DERIVE_KEY", NULL }, 7990Sstevel@tonic-gate 8000Sstevel@tonic-gate /* kbio ioctls */ 8010Sstevel@tonic-gate { (uint_t)KIOCTRANS, "KIOCTRANS", NULL }, 8020Sstevel@tonic-gate { (uint_t)KIOCGTRANS, "KIOCGTRANS", NULL }, 8030Sstevel@tonic-gate { (uint_t)KIOCTRANSABLE, "KIOCTRANSABLE", NULL }, 8040Sstevel@tonic-gate { (uint_t)KIOCGTRANSABLE, "KIOCGTRANSABLE", NULL }, 8050Sstevel@tonic-gate { (uint_t)KIOCSETKEY, "KIOCSETKEY", NULL }, 8060Sstevel@tonic-gate { (uint_t)KIOCGETKEY, "KIOCGETKEY", NULL }, 8070Sstevel@tonic-gate { (uint_t)KIOCCMD, "KIOCCMD", NULL }, 8080Sstevel@tonic-gate { (uint_t)KIOCTYPE, "KIOCTYPE", NULL }, 8090Sstevel@tonic-gate { (uint_t)KIOCSDIRECT, "KIOCSDIRECT", NULL }, 8100Sstevel@tonic-gate { (uint_t)KIOCGDIRECT, "KIOCGDIRECT", NULL }, 8110Sstevel@tonic-gate { (uint_t)KIOCSKEY, "KIOCSKEY", NULL }, 8120Sstevel@tonic-gate { (uint_t)KIOCGKEY, "KIOCGKEY", NULL }, 8130Sstevel@tonic-gate { (uint_t)KIOCSLED, "KIOCSLED", NULL }, 8140Sstevel@tonic-gate { (uint_t)KIOCGLED, "KIOCGLED", NULL }, 8150Sstevel@tonic-gate { (uint_t)KIOCSCOMPAT, "KIOCSCOMPAT", NULL }, 8160Sstevel@tonic-gate { (uint_t)KIOCGCOMPAT, "KIOCGCOMPAT", NULL }, 8170Sstevel@tonic-gate { (uint_t)KIOCSLAYOUT, "KIOCSLAYOUT", NULL }, 8180Sstevel@tonic-gate { (uint_t)KIOCLAYOUT, "KIOCLAYOUT", NULL }, 8190Sstevel@tonic-gate { (uint_t)KIOCSKABORTEN, "KIOCSKABORTEN", NULL }, 8200Sstevel@tonic-gate { (uint_t)KIOCGRPTDELAY, "KIOCGRPTDELAY", NULL }, 8210Sstevel@tonic-gate { (uint_t)KIOCSRPTDELAY, "KIOCSRPTDELAY", NULL }, 8220Sstevel@tonic-gate { (uint_t)KIOCGRPTRATE, "KIOCGRPTRATE", NULL }, 8230Sstevel@tonic-gate { (uint_t)KIOCSRPTRATE, "KIOCSRPTRATE", NULL }, 8243497Srz201010 { (uint_t)KIOCSETFREQ, "KIOCSETFREQ", NULL }, 8255129Smarx { (uint_t)KIOCMKTONE, "KIOCMKTONE", NULL }, 8260Sstevel@tonic-gate 8270Sstevel@tonic-gate /* ptm/pts driver I_STR ioctls */ 8280Sstevel@tonic-gate { (uint_t)ISPTM, "ISPTM", NULL}, 8290Sstevel@tonic-gate { (uint_t)UNLKPT, "UNLKPT", NULL}, 8300Sstevel@tonic-gate { (uint_t)PTSSTTY, "PTSSTTY", NULL}, 8310Sstevel@tonic-gate { (uint_t)ZONEPT, "ZONEPT", NULL}, 8323442Svikram { (uint_t)OWNERPT, "OWNERPT", NULL}, 8330Sstevel@tonic-gate 8340Sstevel@tonic-gate /* aggr link aggregation pseudo driver ioctls */ 8350Sstevel@tonic-gate { (uint_t)LAIOC_CREATE, "LAIOC_CREATE", "laioc_create"}, 8360Sstevel@tonic-gate { (uint_t)LAIOC_DELETE, "LAIOC_DELETE", "laioc_delete"}, 8370Sstevel@tonic-gate { (uint_t)LAIOC_INFO, "LAIOC_INFO", "laioc_info"}, 8380Sstevel@tonic-gate { (uint_t)LAIOC_ADD, "LAIOC_ADD", 8390Sstevel@tonic-gate "laioc_add_rem"}, 8400Sstevel@tonic-gate { (uint_t)LAIOC_REMOVE, "LAIOC_REMOVE", 8410Sstevel@tonic-gate "laioc_add_rem"}, 8420Sstevel@tonic-gate { (uint_t)LAIOC_MODIFY, "LAIOC_MODIFY", "laioc_modify"}, 8430Sstevel@tonic-gate 844269Sericheng /* dld data-link ioctls */ 8455895Syz147064 { (uint_t)DLDIOC_ATTR, "DLDIOC_ATTR", "dld_ioc_attr"}, 8465895Syz147064 { (uint_t)DLDIOC_PHYS_ATTR, "DLDIOC_PHYS_ATTR", 8475895Syz147064 "dld_ioc_phys_attr"}, 8485895Syz147064 { (uint_t)DLDIOC_VLAN_ATTR, "DLDIOC_VLAN_ATTR", 8495895Syz147064 "dld_ioc_vlan_attr"}, 8505895Syz147064 { (uint_t)DLDIOC_CREATE_VLAN, "DLDIOC_CREATE_VLAN", 8515895Syz147064 "dld_ioc_create_vlan"}, 8525895Syz147064 { (uint_t)DLDIOC_DELETE_VLAN, "DLDIOC_DELETE_VLAN", 8535895Syz147064 "dld_ioc_delete_vlan"}, 8545895Syz147064 { (uint_t)DLDIOC_SETAUTOPUSH, "DLDIOC_SETAUTOPUSH", "dld_ioc_ap"}, 8555895Syz147064 { (uint_t)DLDIOC_GETAUTOPUSH, "DLDIOC_GETAUTOPUSH", "dld_ioc_ap"}, 8565895Syz147064 { (uint_t)DLDIOC_CLRAUTOPUSH, "DLDIOC_CLRAUTOPUSH", "dld_ioc_ap"}, 8575895Syz147064 { (uint_t)DLDIOC_DOORSERVER, "DLDIOC_DOORSERVER", "dld_ioc_door"}, 8585895Syz147064 { (uint_t)DLDIOC_RENAME, "DLDIOC_RENAME", "dld_ioc_rename"}, 8595895Syz147064 { (uint_t)DLDIOC_SETZID, "DLDIOC_SETZID", "dld_ioc_setzid"}, 8605895Syz147064 { (uint_t)DLDIOC_GETZID, "DLDIOC_GETZID", "dld_ioc_getzid"}, 861789Sahrens 862789Sahrens /* ZFS ioctls */ 863789Sahrens { (uint_t)ZFS_IOC_POOL_CREATE, "ZFS_IOC_POOL_CREATE", 864789Sahrens "zfs_cmd_t" }, 865789Sahrens { (uint_t)ZFS_IOC_POOL_DESTROY, "ZFS_IOC_POOL_DESTROY", 866789Sahrens "zfs_cmd_t" }, 867789Sahrens { (uint_t)ZFS_IOC_POOL_IMPORT, "ZFS_IOC_POOL_IMPORT", 868789Sahrens "zfs_cmd_t" }, 869789Sahrens { (uint_t)ZFS_IOC_POOL_EXPORT, "ZFS_IOC_POOL_EXPORT", 870789Sahrens "zfs_cmd_t" }, 871789Sahrens { (uint_t)ZFS_IOC_POOL_CONFIGS, "ZFS_IOC_POOL_CONFIGS", 872789Sahrens "zfs_cmd_t" }, 873789Sahrens { (uint_t)ZFS_IOC_POOL_STATS, "ZFS_IOC_POOL_STATS", 874789Sahrens "zfs_cmd_t" }, 875789Sahrens { (uint_t)ZFS_IOC_POOL_TRYIMPORT, "ZFS_IOC_POOL_TRYIMPORT", 876789Sahrens "zfs_cmd_t" }, 877789Sahrens { (uint_t)ZFS_IOC_POOL_SCRUB, "ZFS_IOC_POOL_SCRUB", 878789Sahrens "zfs_cmd_t" }, 879789Sahrens { (uint_t)ZFS_IOC_POOL_FREEZE, "ZFS_IOC_POOL_FREEZE", 880789Sahrens "zfs_cmd_t" }, 8811760Seschrock { (uint_t)ZFS_IOC_POOL_UPGRADE, "ZFS_IOC_POOL_UPGRADE", 8821760Seschrock "zfs_cmd_t" }, 8832926Sek110237 { (uint_t)ZFS_IOC_POOL_GET_HISTORY, "ZFS_IOC_POOL_GET_HISTORY", 8842926Sek110237 "zfs_cmd_t" }, 885789Sahrens { (uint_t)ZFS_IOC_VDEV_ADD, "ZFS_IOC_VDEV_ADD", 886789Sahrens "zfs_cmd_t" }, 887789Sahrens { (uint_t)ZFS_IOC_VDEV_REMOVE, "ZFS_IOC_VDEV_REMOVE", 888789Sahrens "zfs_cmd_t" }, 8894451Seschrock { (uint_t)ZFS_IOC_VDEV_SET_STATE, "ZFS_IOC_VDEV_SET_STATE", 890789Sahrens "zfs_cmd_t" }, 891789Sahrens { (uint_t)ZFS_IOC_VDEV_ATTACH, "ZFS_IOC_VDEV_ATTACH", 892789Sahrens "zfs_cmd_t" }, 893789Sahrens { (uint_t)ZFS_IOC_VDEV_DETACH, "ZFS_IOC_VDEV_DETACH", 894789Sahrens "zfs_cmd_t" }, 8951354Seschrock { (uint_t)ZFS_IOC_VDEV_SETPATH, "ZFS_IOC_VDEV_SETPATH", 8961354Seschrock "zfs_cmd_t" }, 897789Sahrens { (uint_t)ZFS_IOC_OBJSET_STATS, "ZFS_IOC_OBJSET_STATS", 898789Sahrens "zfs_cmd_t" }, 899789Sahrens { (uint_t)ZFS_IOC_DATASET_LIST_NEXT, "ZFS_IOC_DATASET_LIST_NEXT", 900789Sahrens "zfs_cmd_t" }, 901789Sahrens { (uint_t)ZFS_IOC_SNAPSHOT_LIST_NEXT, "ZFS_IOC_SNAPSHOT_LIST_NEXT", 902789Sahrens "zfs_cmd_t" }, 903789Sahrens { (uint_t)ZFS_IOC_SET_PROP, "ZFS_IOC_SET_PROP", 904789Sahrens "zfs_cmd_t" }, 905789Sahrens { (uint_t)ZFS_IOC_CREATE_MINOR, "ZFS_IOC_CREATE_MINOR", 906789Sahrens "zfs_cmd_t" }, 907789Sahrens { (uint_t)ZFS_IOC_REMOVE_MINOR, "ZFS_IOC_REMOVE_MINOR", 908789Sahrens "zfs_cmd_t" }, 909789Sahrens { (uint_t)ZFS_IOC_CREATE, "ZFS_IOC_CREATE", 910789Sahrens "zfs_cmd_t" }, 911789Sahrens { (uint_t)ZFS_IOC_DESTROY, "ZFS_IOC_DESTROY", 912789Sahrens "zfs_cmd_t" }, 913789Sahrens { (uint_t)ZFS_IOC_ROLLBACK, "ZFS_IOC_ROLLBACK", 914789Sahrens "zfs_cmd_t" }, 915789Sahrens { (uint_t)ZFS_IOC_RENAME, "ZFS_IOC_RENAME", 916789Sahrens "zfs_cmd_t" }, 9175367Sahrens { (uint_t)ZFS_IOC_RECV, "ZFS_IOC_RECV", 918789Sahrens "zfs_cmd_t" }, 9195367Sahrens { (uint_t)ZFS_IOC_SEND, "ZFS_IOC_SEND", 920789Sahrens "zfs_cmd_t" }, 9211544Seschrock { (uint_t)ZFS_IOC_INJECT_FAULT, "ZFS_IOC_INJECT_FAULT", 9221544Seschrock "zfs_cmd_t" }, 9231544Seschrock { (uint_t)ZFS_IOC_CLEAR_FAULT, "ZFS_IOC_CLEAR_FAULT", 9241544Seschrock "zfs_cmd_t" }, 9251544Seschrock { (uint_t)ZFS_IOC_INJECT_LIST_NEXT, "ZFS_IOC_INJECT_LIST_NEXT", 9261544Seschrock "zfs_cmd_t" }, 9271544Seschrock { (uint_t)ZFS_IOC_ERROR_LOG, "ZFS_IOC_ERROR_LOG", 9281544Seschrock "zfs_cmd_t" }, 9291544Seschrock { (uint_t)ZFS_IOC_CLEAR, "ZFS_IOC_CLEAR", 9301544Seschrock "zfs_cmd_t" }, 9312082Seschrock { (uint_t)ZFS_IOC_PROMOTE, "ZFS_IOC_PROMOTE", 9322082Seschrock "zfs_cmd_t" }, 9332199Sahrens { (uint_t)ZFS_IOC_DESTROY_SNAPS, "ZFS_IOC_DESTROY_SNAPS", 9342199Sahrens "zfs_cmd_t" }, 9352199Sahrens { (uint_t)ZFS_IOC_SNAPSHOT, "ZFS_IOC_SNAPSHOT", 9362199Sahrens "zfs_cmd_t" }, 9373444Sek110237 { (uint_t)ZFS_IOC_DSOBJ_TO_DSNAME, "ZFS_IOC_DSOBJ_TO_DSNAME", 9383444Sek110237 "zfs_cmd_t" }, 9393444Sek110237 { (uint_t)ZFS_IOC_OBJ_TO_PATH, "ZFS_IOC_OBJ_TO_PATH", 9403444Sek110237 "zfs_cmd_t" }, 9413912Slling { (uint_t)ZFS_IOC_POOL_SET_PROPS, "ZFS_IOC_POOL_SET_PROPS", 9423912Slling "zfs_cmd_t" }, 9433912Slling { (uint_t)ZFS_IOC_POOL_GET_PROPS, "ZFS_IOC_POOL_GET_PROPS", 9443912Slling "zfs_cmd_t" }, 9454543Smarks { (uint_t)ZFS_IOC_SET_FSACL, "ZFS_IOC_SET_FSACL", 9464543Smarks "zfs_cmd_t" }, 9474543Smarks { (uint_t)ZFS_IOC_GET_FSACL, "ZFS_IOC_GET_FSACL", 9484543Smarks "zfs_cmd_t" }, 9494543Smarks { (uint_t)ZFS_IOC_ISCSI_PERM_CHECK, "ZFS_IOC_ISCSI_PERM_CHECK", 9504543Smarks "zfs_cmd_t" }, 9514543Smarks { (uint_t)ZFS_IOC_SHARE, "ZFS_IOC_SHARE", 9524543Smarks "zfs_cmd_t" }, 9534849Sahrens { (uint_t)ZFS_IOC_INHERIT_PROP, "ZFS_IOC_INHERIT_PROP", 9544849Sahrens "zfs_cmd_t" }, 955789Sahrens 9561400Skrishna /* kssl ioctls */ 9571400Skrishna { (uint_t)KSSL_ADD_ENTRY, "KSSL_ADD_ENTRY", 9581400Skrishna "kssl_params_t"}, 9591400Skrishna { (uint_t)KSSL_DELETE_ENTRY, "KSSL_DELETE_ENTRY", 9601400Skrishna "sockaddr_in"}, 9611400Skrishna 962*6318Sedp /* dkio ioctls - (0x04 << 8) */ 963*6318Sedp { (uint_t)DKIOCGGEOM, "DKIOCGGEOM", 964*6318Sedp "struct dk_geom"}, 965*6318Sedp { (uint_t)DKIOCSGEOM, "DKIOCSGEOM", 966*6318Sedp "struct dk_geom"}, 967*6318Sedp { (uint_t)DKIOCINFO, "DKIOCINFO", 968*6318Sedp "struct dk_info"}, 969*6318Sedp { (uint_t)DKIOCGVTOC, "DKIOCGVTOC", 970*6318Sedp "struct vtoc"}, 971*6318Sedp { (uint_t)DKIOCSVTOC, "DKIOCSVTOC", 972*6318Sedp "struct vtoc"}, 973*6318Sedp { (uint_t)DKIOCADDBAD, "DKIOCADDBAD", 974*6318Sedp NULL}, 975*6318Sedp { (uint_t)DKIOCG_PHYGEOM, "DKIOCG_PHYGEOM", 976*6318Sedp "struct dk_geom"}, 977*6318Sedp { (uint_t)DKIOCG_VIRTGEOM, "DKIOCG_VIRTGEOM", 978*6318Sedp "struct dk_geom"}, 979*6318Sedp { (uint_t)DKIOCGMEDIAINFO, "DKIOCGMEDIAINFO", 980*6318Sedp "struct dk_minfo"}, 981*6318Sedp 982*6318Sedp /* dumpadm ioctls - (0xdd << 8) */ 983*6318Sedp { (uint_t)DIOCGETDEV, "DIOCGETDEV", 984*6318Sedp "char *"}, 985*6318Sedp 986*6318Sedp /* mntio ioctls - ('m' << 8) */ 987*6318Sedp { (uint_t)MNTIOC_GETMNTENT, "MNTIOC_GETMNTENT", 988*6318Sedp "struct extmnttab"}, 989*6318Sedp 9900Sstevel@tonic-gate { (uint_t)0, NULL, NULL } 9910Sstevel@tonic-gate }; 9920Sstevel@tonic-gate 9930Sstevel@tonic-gate void 9940Sstevel@tonic-gate ioctl_ioccom(char *buf, size_t size, uint_t code, int nbytes, int x, int y) 9950Sstevel@tonic-gate { 9960Sstevel@tonic-gate const char *inoutstr; 9970Sstevel@tonic-gate 9980Sstevel@tonic-gate if (code & IOC_VOID) 9990Sstevel@tonic-gate inoutstr = ""; 10000Sstevel@tonic-gate else if ((code & IOC_INOUT) == IOC_INOUT) 10010Sstevel@tonic-gate inoutstr = "WR"; 10020Sstevel@tonic-gate else 10030Sstevel@tonic-gate inoutstr = code & IOC_IN ? "W" : "R"; 10040Sstevel@tonic-gate 10050Sstevel@tonic-gate if (isascii(x) && isprint(x)) 10060Sstevel@tonic-gate (void) snprintf(buf, size, "_IO%sN('%c', %d, %d)", inoutstr, 10070Sstevel@tonic-gate x, y, nbytes); 10080Sstevel@tonic-gate else 10090Sstevel@tonic-gate (void) snprintf(buf, size, "_IO%sN(0x%x, %d, %d)", inoutstr, 10100Sstevel@tonic-gate x, y, nbytes); 10110Sstevel@tonic-gate } 10120Sstevel@tonic-gate 10130Sstevel@tonic-gate 10140Sstevel@tonic-gate const char * 10150Sstevel@tonic-gate ioctlname(private_t *pri, uint_t code) 10160Sstevel@tonic-gate { 10170Sstevel@tonic-gate const struct ioc *ip; 10180Sstevel@tonic-gate const char *str = NULL; 10190Sstevel@tonic-gate 10200Sstevel@tonic-gate for (ip = &ioc[0]; ip->name; ip++) { 10210Sstevel@tonic-gate if (code == ip->code) { 10220Sstevel@tonic-gate str = ip->name; 10230Sstevel@tonic-gate break; 10240Sstevel@tonic-gate } 10250Sstevel@tonic-gate } 10260Sstevel@tonic-gate 10270Sstevel@tonic-gate /* 10280Sstevel@tonic-gate * Developers hide ascii ioctl names in the ioctl subcode; for example 10290Sstevel@tonic-gate * 0x445210 should be printed 'D'<<16|'R'<<8|10. We allow for all 10300Sstevel@tonic-gate * three high order bytes (called hi, mid and lo) to contain ascii 10310Sstevel@tonic-gate * characters. 10320Sstevel@tonic-gate */ 10330Sstevel@tonic-gate if (str == NULL) { 10340Sstevel@tonic-gate int c_hi = code >> 24; 10350Sstevel@tonic-gate int c_mid = (code >> 16) & 0xff; 10360Sstevel@tonic-gate int c_mid_nm = (code >> 16); 10370Sstevel@tonic-gate int c_lo = (code >> 8) & 0xff; 10380Sstevel@tonic-gate int c_lo_nm = code >> 8; 10390Sstevel@tonic-gate 10400Sstevel@tonic-gate if (isascii(c_lo) && isprint(c_lo) && 10410Sstevel@tonic-gate isascii(c_mid) && isprint(c_mid) && 10420Sstevel@tonic-gate isascii(c_hi) && isprint(c_hi)) 10430Sstevel@tonic-gate (void) sprintf(pri->code_buf, 10440Sstevel@tonic-gate "(('%c'<<24)|('%c'<<16)|('%c'<<8)|%d)", 10450Sstevel@tonic-gate c_hi, c_mid, c_lo, code & 0xff); 10460Sstevel@tonic-gate else if (isascii(c_lo) && isprint(c_lo) && 10470Sstevel@tonic-gate isascii(c_mid_nm) && isprint(c_mid_nm)) 10480Sstevel@tonic-gate (void) sprintf(pri->code_buf, 10490Sstevel@tonic-gate "(('%c'<<16)|('%c'<<8)|%d)", c_mid, c_lo, 10500Sstevel@tonic-gate code & 0xff); 10510Sstevel@tonic-gate else if (isascii(c_lo_nm) && isprint(c_lo_nm)) 10520Sstevel@tonic-gate (void) sprintf(pri->code_buf, "(('%c'<<8)|%d)", 10533912Slling c_lo_nm, code & 0xff); 10540Sstevel@tonic-gate else if (code & (IOC_VOID|IOC_INOUT)) 10550Sstevel@tonic-gate ioctl_ioccom(pri->code_buf, sizeof (pri->code_buf), 10560Sstevel@tonic-gate code, c_mid, c_lo, code & 0xff); 10570Sstevel@tonic-gate else 10580Sstevel@tonic-gate (void) sprintf(pri->code_buf, "0x%.4X", code); 10590Sstevel@tonic-gate str = (const char *)pri->code_buf; 10600Sstevel@tonic-gate } 10610Sstevel@tonic-gate 10620Sstevel@tonic-gate return (str); 10630Sstevel@tonic-gate } 10640Sstevel@tonic-gate 10650Sstevel@tonic-gate 10660Sstevel@tonic-gate const char * 10670Sstevel@tonic-gate ioctldatastruct(uint_t code) 10680Sstevel@tonic-gate { 10690Sstevel@tonic-gate const struct ioc *ip; 10700Sstevel@tonic-gate const char *str = NULL; 10710Sstevel@tonic-gate 10720Sstevel@tonic-gate for (ip = &ioc[0]; ip->name != NULL; ip++) { 10730Sstevel@tonic-gate if (code == ip->code) { 10740Sstevel@tonic-gate str = ip->datastruct; 10750Sstevel@tonic-gate break; 10760Sstevel@tonic-gate } 10770Sstevel@tonic-gate } 10780Sstevel@tonic-gate return (str); 10790Sstevel@tonic-gate } 10800Sstevel@tonic-gate 10810Sstevel@tonic-gate 10820Sstevel@tonic-gate const char * 10830Sstevel@tonic-gate fcntlname(int code) 10840Sstevel@tonic-gate { 10850Sstevel@tonic-gate const char *str = NULL; 10860Sstevel@tonic-gate 10870Sstevel@tonic-gate if (code >= FCNTLMIN && code <= FCNTLMAX) 10880Sstevel@tonic-gate str = FCNTLname[code-FCNTLMIN]; 10890Sstevel@tonic-gate return (str); 10900Sstevel@tonic-gate } 10910Sstevel@tonic-gate 10920Sstevel@tonic-gate const char * 10930Sstevel@tonic-gate sfsname(int code) 10940Sstevel@tonic-gate { 10950Sstevel@tonic-gate const char *str = NULL; 10960Sstevel@tonic-gate 10970Sstevel@tonic-gate if (code >= SYSFSMIN && code <= SYSFSMAX) 10980Sstevel@tonic-gate str = SYSFSname[code-SYSFSMIN]; 10990Sstevel@tonic-gate return (str); 11000Sstevel@tonic-gate } 11010Sstevel@tonic-gate 11020Sstevel@tonic-gate const char * 11030Sstevel@tonic-gate plockname(int code) 11040Sstevel@tonic-gate { 11050Sstevel@tonic-gate const char *str = NULL; 11060Sstevel@tonic-gate 11070Sstevel@tonic-gate if (code >= PLOCKMIN && code <= PLOCKMAX) 11080Sstevel@tonic-gate str = PLOCKname[code-PLOCKMIN]; 11090Sstevel@tonic-gate return (str); 11100Sstevel@tonic-gate } 11110Sstevel@tonic-gate 11120Sstevel@tonic-gate /* ARGSUSED */ 11130Sstevel@tonic-gate const char * 11140Sstevel@tonic-gate si86name(int code) 11150Sstevel@tonic-gate { 11160Sstevel@tonic-gate const char *str = NULL; 11170Sstevel@tonic-gate 11180Sstevel@tonic-gate #if defined(__i386) || defined(__amd64) 11190Sstevel@tonic-gate switch (code) { 11200Sstevel@tonic-gate case SI86SWPI: str = "SI86SWPI"; break; 11210Sstevel@tonic-gate case SI86SYM: str = "SI86SYM"; break; 11220Sstevel@tonic-gate case SI86CONF: str = "SI86CONF"; break; 11230Sstevel@tonic-gate case SI86BOOT: str = "SI86BOOT"; break; 11240Sstevel@tonic-gate case SI86AUTO: str = "SI86AUTO"; break; 11250Sstevel@tonic-gate case SI86EDT: str = "SI86EDT"; break; 11260Sstevel@tonic-gate case SI86SWAP: str = "SI86SWAP"; break; 11270Sstevel@tonic-gate case SI86FPHW: str = "SI86FPHW"; break; 11280Sstevel@tonic-gate case SI86FPSTART: str = "SI86FPSTART"; break; 11290Sstevel@tonic-gate case GRNON: str = "GRNON"; break; 11300Sstevel@tonic-gate case GRNFLASH: str = "GRNFLASH"; break; 11310Sstevel@tonic-gate case STIME: str = "STIME"; break; 11320Sstevel@tonic-gate case SETNAME: str = "SETNAME"; break; 11330Sstevel@tonic-gate case RNVR: str = "RNVR"; break; 11340Sstevel@tonic-gate case WNVR: str = "WNVR"; break; 11350Sstevel@tonic-gate case RTODC: str = "RTODC"; break; 11360Sstevel@tonic-gate case CHKSER: str = "CHKSER"; break; 11370Sstevel@tonic-gate case SI86NVPRT: str = "SI86NVPRT"; break; 11380Sstevel@tonic-gate case SANUPD: str = "SANUPD"; break; 11390Sstevel@tonic-gate case SI86KSTR: str = "SI86KSTR"; break; 11400Sstevel@tonic-gate case SI86MEM: str = "SI86MEM"; break; 11410Sstevel@tonic-gate case SI86TODEMON: str = "SI86TODEMON"; break; 11420Sstevel@tonic-gate case SI86CCDEMON: str = "SI86CCDEMON"; break; 11430Sstevel@tonic-gate case SI86CACHE: str = "SI86CACHE"; break; 11440Sstevel@tonic-gate case SI86DELMEM: str = "SI86DELMEM"; break; 11450Sstevel@tonic-gate case SI86ADDMEM: str = "SI86ADDMEM"; break; 11460Sstevel@tonic-gate /* 71 through 74 reserved for VPIX */ 11470Sstevel@tonic-gate case SI86V86: str = "SI86V86"; break; 11480Sstevel@tonic-gate case SI86SLTIME: str = "SI86SLTIME"; break; 11490Sstevel@tonic-gate case SI86DSCR: str = "SI86DSCR"; break; 11500Sstevel@tonic-gate case RDUBLK: str = "RDUBLK"; break; 11510Sstevel@tonic-gate /* NFA entry point */ 11520Sstevel@tonic-gate case SI86NFA: str = "SI86NFA"; break; 11530Sstevel@tonic-gate case SI86VM86: str = "SI86VM86"; break; 11540Sstevel@tonic-gate case SI86VMENABLE: str = "SI86VMENABLE"; break; 11550Sstevel@tonic-gate case SI86LIMUSER: str = "SI86LIMUSER"; break; 11560Sstevel@tonic-gate case SI86RDID: str = "SI86RDID"; break; 11570Sstevel@tonic-gate case SI86RDBOOT: str = "SI86RDBOOT"; break; 11580Sstevel@tonic-gate /* Merged Product defines */ 11590Sstevel@tonic-gate case SI86SHFIL: str = "SI86SHFIL"; break; 11600Sstevel@tonic-gate case SI86PCHRGN: str = "SI86PCHRGN"; break; 11610Sstevel@tonic-gate case SI86BADVISE: str = "SI86BADVISE"; break; 11620Sstevel@tonic-gate case SI86SHRGN: str = "SI86SHRGN"; break; 11630Sstevel@tonic-gate case SI86CHIDT: str = "SI86CHIDT"; break; 11640Sstevel@tonic-gate case SI86EMULRDA: str = "SI86EMULRDA"; break; 11650Sstevel@tonic-gate } 11660Sstevel@tonic-gate #endif /* __i386 */ 11670Sstevel@tonic-gate 11680Sstevel@tonic-gate return (str); 11690Sstevel@tonic-gate } 11700Sstevel@tonic-gate 11710Sstevel@tonic-gate const char * 11720Sstevel@tonic-gate utscode(int code) 11730Sstevel@tonic-gate { 11740Sstevel@tonic-gate const char *str = NULL; 11750Sstevel@tonic-gate 11760Sstevel@tonic-gate switch (code) { 11770Sstevel@tonic-gate case UTS_UNAME: str = "UNAME"; break; 11780Sstevel@tonic-gate case UTS_USTAT: str = "USTAT"; break; 11790Sstevel@tonic-gate case UTS_FUSERS: str = "FUSERS"; break; 11800Sstevel@tonic-gate } 11810Sstevel@tonic-gate 11820Sstevel@tonic-gate return (str); 11830Sstevel@tonic-gate } 11840Sstevel@tonic-gate 11850Sstevel@tonic-gate const char * 11862447Snf202958 rctlsyscode(int code) 11872447Snf202958 { 11882447Snf202958 const char *str = NULL; 11892447Snf202958 switch (code) { 11902447Snf202958 case 0: str = "GETRCTL"; break; 11912447Snf202958 case 1: str = "SETRCTL"; break; 11922447Snf202958 case 2: str = "RCTLSYS_LST"; break; 11932447Snf202958 case 3: str = "RCTLSYS_CTL"; break; 11943684Srd117015 case 4: str = "RCTLSYS_SETPROJ"; break; 11952447Snf202958 default: str = "UNKNOWN"; break; 11962447Snf202958 } 11972447Snf202958 return (str); 11982447Snf202958 } 11992447Snf202958 12002447Snf202958 const char * 12012447Snf202958 rctl_local_action(private_t *pri, uint_t val) 12022447Snf202958 { 12032447Snf202958 uint_t action = val & (~RCTL_LOCAL_ACTION_MASK); 12042447Snf202958 12052447Snf202958 char *s = pri->code_buf; 12062447Snf202958 12072447Snf202958 *s = '\0'; 12082447Snf202958 12092447Snf202958 if (action & RCTL_LOCAL_NOACTION) { 12102447Snf202958 action ^= RCTL_LOCAL_NOACTION; 12112447Snf202958 (void) strlcat(s, "|RCTL_LOCAL_NOACTION", 12122447Snf202958 sizeof (pri->code_buf)); 12132447Snf202958 } 12142447Snf202958 if (action & RCTL_LOCAL_SIGNAL) { 12152447Snf202958 action ^= RCTL_LOCAL_SIGNAL; 12162447Snf202958 (void) strlcat(s, "|RCTL_LOCAL_SIGNAL", 12172447Snf202958 sizeof (pri->code_buf)); 12182447Snf202958 } 12192447Snf202958 if (action & RCTL_LOCAL_DENY) { 12202447Snf202958 action ^= RCTL_LOCAL_DENY; 12212447Snf202958 (void) strlcat(s, "|RCTL_LOCAL_DENY", 12222447Snf202958 sizeof (pri->code_buf)); 12232447Snf202958 } 12242447Snf202958 12252447Snf202958 if ((action & (~RCTL_LOCAL_ACTION_MASK)) != 0) 12262447Snf202958 return (NULL); 12272447Snf202958 else if (*s != '\0') 12282447Snf202958 return (s+1); 12292447Snf202958 else 12302447Snf202958 return (NULL); 12312447Snf202958 } 12322447Snf202958 12332447Snf202958 12342447Snf202958 const char * 12352447Snf202958 rctl_local_flags(private_t *pri, uint_t val) 12362447Snf202958 { 12372447Snf202958 uint_t pval = val & RCTL_LOCAL_ACTION_MASK; 12382447Snf202958 char *s = pri->code_buf; 12392447Snf202958 12402447Snf202958 *s = '\0'; 12412447Snf202958 12422447Snf202958 if (pval & RCTL_LOCAL_MAXIMAL) { 12432447Snf202958 pval ^= RCTL_LOCAL_MAXIMAL; 12442447Snf202958 (void) strlcat(s, "|RCTL_LOCAL_MAXIMAL", 12452447Snf202958 sizeof (pri->code_buf)); 12462447Snf202958 } 12472447Snf202958 12482447Snf202958 if ((pval & RCTL_LOCAL_ACTION_MASK) != 0) 12492447Snf202958 return (NULL); 12502447Snf202958 else if (*s != '\0') 12512447Snf202958 return (s+1); 12522447Snf202958 else 12532447Snf202958 return (NULL); 12542447Snf202958 } 12552447Snf202958 12562447Snf202958 12572447Snf202958 const char * 12580Sstevel@tonic-gate sconfname(int code) 12590Sstevel@tonic-gate { 12600Sstevel@tonic-gate const char *str = NULL; 12610Sstevel@tonic-gate 12620Sstevel@tonic-gate if (code >= SCONFMIN && code <= SCONFMAX) 12630Sstevel@tonic-gate str = SCONFname[code-SCONFMIN]; 12640Sstevel@tonic-gate return (str); 12650Sstevel@tonic-gate } 12660Sstevel@tonic-gate 12670Sstevel@tonic-gate const char * 12680Sstevel@tonic-gate pathconfname(int code) 12690Sstevel@tonic-gate { 12700Sstevel@tonic-gate const char *str = NULL; 12710Sstevel@tonic-gate 12720Sstevel@tonic-gate if (code >= PATHCONFMIN && code <= PATHCONFMAX) 12730Sstevel@tonic-gate str = PATHCONFname[code-PATHCONFMIN]; 12740Sstevel@tonic-gate return (str); 12750Sstevel@tonic-gate } 12760Sstevel@tonic-gate 12770Sstevel@tonic-gate const char * 12780Sstevel@tonic-gate sigarg(private_t *pri, int arg) 12790Sstevel@tonic-gate { 12800Sstevel@tonic-gate char *str = NULL; 12810Sstevel@tonic-gate int sig = (arg & SIGNO_MASK); 12820Sstevel@tonic-gate 12830Sstevel@tonic-gate str = pri->code_buf; 12840Sstevel@tonic-gate arg &= ~SIGNO_MASK; 12850Sstevel@tonic-gate if (arg & ~(SIGDEFER|SIGHOLD|SIGRELSE|SIGIGNORE|SIGPAUSE)) 12860Sstevel@tonic-gate (void) snprintf(pri->code_buf, sizeof (pri->code_buf), 12870Sstevel@tonic-gate "%s|0x%X", signame(pri, sig), arg); 12880Sstevel@tonic-gate else { 12890Sstevel@tonic-gate (void) strcpy(str, signame(pri, sig)); 12900Sstevel@tonic-gate if (arg & SIGDEFER) 12910Sstevel@tonic-gate (void) strcat(str, "|SIGDEFER"); 12920Sstevel@tonic-gate if (arg & SIGHOLD) 12930Sstevel@tonic-gate (void) strcat(str, "|SIGHOLD"); 12940Sstevel@tonic-gate if (arg & SIGRELSE) 12950Sstevel@tonic-gate (void) strcat(str, "|SIGRELSE"); 12960Sstevel@tonic-gate if (arg & SIGIGNORE) 12970Sstevel@tonic-gate (void) strcat(str, "|SIGIGNORE"); 12980Sstevel@tonic-gate if (arg & SIGPAUSE) 12990Sstevel@tonic-gate (void) strcat(str, "|SIGPAUSE"); 13000Sstevel@tonic-gate } 13010Sstevel@tonic-gate 13020Sstevel@tonic-gate return ((const char *)str); 13030Sstevel@tonic-gate } 13040Sstevel@tonic-gate 13050Sstevel@tonic-gate #define ALL_O_FLAGS \ 13060Sstevel@tonic-gate (O_NDELAY|O_APPEND|O_SYNC|O_DSYNC|O_NONBLOCK|O_CREAT|O_TRUNC\ 13070Sstevel@tonic-gate |O_EXCL|O_NOCTTY|O_LARGEFILE|O_RSYNC|O_XATTR|O_NOFOLLOW|O_NOLINKS) 13080Sstevel@tonic-gate 13090Sstevel@tonic-gate const char * 13100Sstevel@tonic-gate openarg(private_t *pri, int arg) 13110Sstevel@tonic-gate { 13120Sstevel@tonic-gate char *str = pri->code_buf; 13130Sstevel@tonic-gate 13140Sstevel@tonic-gate switch (arg & ~ALL_O_FLAGS) { 13150Sstevel@tonic-gate default: 13160Sstevel@tonic-gate return ((char *)NULL); 13170Sstevel@tonic-gate case O_RDONLY: 13180Sstevel@tonic-gate (void) strcpy(str, "O_RDONLY"); 13190Sstevel@tonic-gate break; 13200Sstevel@tonic-gate case O_WRONLY: 13210Sstevel@tonic-gate (void) strcpy(str, "O_WRONLY"); 13220Sstevel@tonic-gate break; 13230Sstevel@tonic-gate case O_RDWR: 13240Sstevel@tonic-gate (void) strcpy(str, "O_RDWR"); 13250Sstevel@tonic-gate break; 13260Sstevel@tonic-gate } 13270Sstevel@tonic-gate 13280Sstevel@tonic-gate if (arg & O_NDELAY) 13290Sstevel@tonic-gate (void) strlcat(str, "|O_NDELAY", sizeof (pri->code_buf)); 13300Sstevel@tonic-gate if (arg & O_APPEND) 13310Sstevel@tonic-gate (void) strlcat(str, "|O_APPEND", sizeof (pri->code_buf)); 13320Sstevel@tonic-gate if (arg & O_SYNC) 13330Sstevel@tonic-gate (void) strlcat(str, "|O_SYNC", sizeof (pri->code_buf)); 13340Sstevel@tonic-gate if (arg & O_DSYNC) 13350Sstevel@tonic-gate (void) strlcat(str, "|O_DSYNC", sizeof (pri->code_buf)); 13360Sstevel@tonic-gate if (arg & O_NONBLOCK) 13370Sstevel@tonic-gate (void) strlcat(str, "|O_NONBLOCK", sizeof (pri->code_buf)); 13380Sstevel@tonic-gate if (arg & O_CREAT) 13390Sstevel@tonic-gate (void) strlcat(str, "|O_CREAT", sizeof (pri->code_buf)); 13400Sstevel@tonic-gate if (arg & O_TRUNC) 13410Sstevel@tonic-gate (void) strlcat(str, "|O_TRUNC", sizeof (pri->code_buf)); 13420Sstevel@tonic-gate if (arg & O_EXCL) 13430Sstevel@tonic-gate (void) strlcat(str, "|O_EXCL", sizeof (pri->code_buf)); 13440Sstevel@tonic-gate if (arg & O_NOCTTY) 13450Sstevel@tonic-gate (void) strlcat(str, "|O_NOCTTY", sizeof (pri->code_buf)); 13460Sstevel@tonic-gate if (arg & O_LARGEFILE) 13470Sstevel@tonic-gate (void) strlcat(str, "|O_LARGEFILE", sizeof (pri->code_buf)); 13480Sstevel@tonic-gate if (arg & O_RSYNC) 13490Sstevel@tonic-gate (void) strlcat(str, "|O_RSYNC", sizeof (pri->code_buf)); 13500Sstevel@tonic-gate if (arg & O_XATTR) 13510Sstevel@tonic-gate (void) strlcat(str, "|O_XATTR", sizeof (pri->code_buf)); 13520Sstevel@tonic-gate if (arg & O_NOFOLLOW) 13530Sstevel@tonic-gate (void) strlcat(str, "|O_NOFOLLOW", sizeof (pri->code_buf)); 13540Sstevel@tonic-gate if (arg & O_NOLINKS) 13550Sstevel@tonic-gate (void) strlcat(str, "|O_NOLINKS", sizeof (pri->code_buf)); 13560Sstevel@tonic-gate 13570Sstevel@tonic-gate return ((const char *)str); 13580Sstevel@tonic-gate } 13590Sstevel@tonic-gate 13600Sstevel@tonic-gate const char * 13610Sstevel@tonic-gate whencearg(int arg) 13620Sstevel@tonic-gate { 13630Sstevel@tonic-gate const char *str = NULL; 13640Sstevel@tonic-gate 13650Sstevel@tonic-gate switch (arg) { 13660Sstevel@tonic-gate case SEEK_SET: str = "SEEK_SET"; break; 13670Sstevel@tonic-gate case SEEK_CUR: str = "SEEK_CUR"; break; 13680Sstevel@tonic-gate case SEEK_END: str = "SEEK_END"; break; 13690Sstevel@tonic-gate case SEEK_DATA: str = "SEEK_DATA"; break; 13700Sstevel@tonic-gate case SEEK_HOLE: str = "SEEK_HOLE"; break; 13710Sstevel@tonic-gate } 13720Sstevel@tonic-gate 13730Sstevel@tonic-gate return (str); 13740Sstevel@tonic-gate } 13750Sstevel@tonic-gate 13760Sstevel@tonic-gate #define IPC_FLAGS (IPC_ALLOC|IPC_CREAT|IPC_EXCL|IPC_NOWAIT) 13770Sstevel@tonic-gate 13780Sstevel@tonic-gate char * 13790Sstevel@tonic-gate ipcflags(private_t *pri, int arg) 13800Sstevel@tonic-gate { 13810Sstevel@tonic-gate char *str = pri->code_buf; 13820Sstevel@tonic-gate 13830Sstevel@tonic-gate if (arg & 0777) 13840Sstevel@tonic-gate (void) sprintf(str, "0%.3o", arg&0777); 13850Sstevel@tonic-gate else 13860Sstevel@tonic-gate *str = '\0'; 13870Sstevel@tonic-gate 13880Sstevel@tonic-gate if (arg & IPC_ALLOC) 13890Sstevel@tonic-gate (void) strcat(str, "|IPC_ALLOC"); 13900Sstevel@tonic-gate if (arg & IPC_CREAT) 13910Sstevel@tonic-gate (void) strcat(str, "|IPC_CREAT"); 13920Sstevel@tonic-gate if (arg & IPC_EXCL) 13930Sstevel@tonic-gate (void) strcat(str, "|IPC_EXCL"); 13940Sstevel@tonic-gate if (arg & IPC_NOWAIT) 13950Sstevel@tonic-gate (void) strcat(str, "|IPC_NOWAIT"); 13960Sstevel@tonic-gate 13970Sstevel@tonic-gate return (str); 13980Sstevel@tonic-gate } 13990Sstevel@tonic-gate 14000Sstevel@tonic-gate const char * 14010Sstevel@tonic-gate msgflags(private_t *pri, int arg) 14020Sstevel@tonic-gate { 14030Sstevel@tonic-gate char *str; 14040Sstevel@tonic-gate 14050Sstevel@tonic-gate if (arg == 0 || (arg & ~(IPC_FLAGS|MSG_NOERROR|0777)) != 0) 14060Sstevel@tonic-gate return ((char *)NULL); 14070Sstevel@tonic-gate 14080Sstevel@tonic-gate str = ipcflags(pri, arg); 14090Sstevel@tonic-gate 14100Sstevel@tonic-gate if (arg & MSG_NOERROR) 14110Sstevel@tonic-gate (void) strcat(str, "|MSG_NOERROR"); 14120Sstevel@tonic-gate 14130Sstevel@tonic-gate if (*str == '|') 14140Sstevel@tonic-gate str++; 14150Sstevel@tonic-gate return ((const char *)str); 14160Sstevel@tonic-gate } 14170Sstevel@tonic-gate 14180Sstevel@tonic-gate const char * 14190Sstevel@tonic-gate semflags(private_t *pri, int arg) 14200Sstevel@tonic-gate { 14210Sstevel@tonic-gate char *str; 14220Sstevel@tonic-gate 14230Sstevel@tonic-gate if (arg == 0 || (arg & ~(IPC_FLAGS|SEM_UNDO|0777)) != 0) 14240Sstevel@tonic-gate return ((char *)NULL); 14250Sstevel@tonic-gate 14260Sstevel@tonic-gate str = ipcflags(pri, arg); 14270Sstevel@tonic-gate 14280Sstevel@tonic-gate if (arg & SEM_UNDO) 14290Sstevel@tonic-gate (void) strcat(str, "|SEM_UNDO"); 14300Sstevel@tonic-gate 14310Sstevel@tonic-gate if (*str == '|') 14320Sstevel@tonic-gate str++; 14330Sstevel@tonic-gate return ((const char *)str); 14340Sstevel@tonic-gate } 14350Sstevel@tonic-gate 14360Sstevel@tonic-gate const char * 14370Sstevel@tonic-gate shmflags(private_t *pri, int arg) 14380Sstevel@tonic-gate { 14390Sstevel@tonic-gate char *str; 14400Sstevel@tonic-gate 14410Sstevel@tonic-gate if (arg == 0 || (arg & ~(IPC_FLAGS|SHM_RDONLY|SHM_RND|0777)) != 0) 14420Sstevel@tonic-gate return ((char *)NULL); 14430Sstevel@tonic-gate 14440Sstevel@tonic-gate str = ipcflags(pri, arg); 14450Sstevel@tonic-gate 14460Sstevel@tonic-gate if (arg & SHM_RDONLY) 14470Sstevel@tonic-gate (void) strcat(str, "|SHM_RDONLY"); 14480Sstevel@tonic-gate if (arg & SHM_RND) 14490Sstevel@tonic-gate (void) strcat(str, "|SHM_RND"); 14500Sstevel@tonic-gate 14510Sstevel@tonic-gate if (*str == '|') 14520Sstevel@tonic-gate str++; 14530Sstevel@tonic-gate return ((const char *)str); 14540Sstevel@tonic-gate } 14550Sstevel@tonic-gate 14560Sstevel@tonic-gate #define MSGCMDMIN 0 14570Sstevel@tonic-gate #define MSGCMDMAX IPC_STAT64 14580Sstevel@tonic-gate const char *const MSGCMDname[MSGCMDMAX+1] = { 14590Sstevel@tonic-gate NULL, NULL, NULL, NULL, NULL, 14600Sstevel@tonic-gate NULL, NULL, NULL, NULL, NULL, 14610Sstevel@tonic-gate "IPC_RMID", /* 10 */ 14620Sstevel@tonic-gate "IPC_SET", /* 11 */ 14630Sstevel@tonic-gate "IPC_STAT", /* 12 */ 14640Sstevel@tonic-gate "IPC_SET64", /* 13 */ 14650Sstevel@tonic-gate "IPC_STAT64", /* 14 */ 14660Sstevel@tonic-gate }; 14670Sstevel@tonic-gate 14680Sstevel@tonic-gate #define SEMCMDMIN 0 14690Sstevel@tonic-gate #define SEMCMDMAX IPC_STAT64 14700Sstevel@tonic-gate const char *const SEMCMDname[SEMCMDMAX+1] = { 14710Sstevel@tonic-gate NULL, /* 0 */ 14720Sstevel@tonic-gate NULL, /* 1 */ 14730Sstevel@tonic-gate NULL, /* 2 */ 14740Sstevel@tonic-gate "GETNCNT", /* 3 */ 14750Sstevel@tonic-gate "GETPID", /* 4 */ 14760Sstevel@tonic-gate "GETVAL", /* 5 */ 14770Sstevel@tonic-gate "GETALL", /* 6 */ 14780Sstevel@tonic-gate "GETZCNT", /* 7 */ 14790Sstevel@tonic-gate "SETVAL", /* 8 */ 14800Sstevel@tonic-gate "SETALL", /* 9 */ 14810Sstevel@tonic-gate "IPC_RMID", /* 10 */ 14820Sstevel@tonic-gate "IPC_SET", /* 11 */ 14830Sstevel@tonic-gate "IPC_STAT", /* 12 */ 14840Sstevel@tonic-gate "IPC_SET64", /* 13 */ 14850Sstevel@tonic-gate "IPC_STAT64", /* 14 */ 14860Sstevel@tonic-gate }; 14870Sstevel@tonic-gate 14880Sstevel@tonic-gate #define SHMCMDMIN 0 14890Sstevel@tonic-gate #define SHMCMDMAX IPC_STAT64 14900Sstevel@tonic-gate const char *const SHMCMDname[SHMCMDMAX+1] = { 14910Sstevel@tonic-gate NULL, /* 0 */ 14920Sstevel@tonic-gate NULL, /* 1 */ 14930Sstevel@tonic-gate NULL, /* 2 */ 14940Sstevel@tonic-gate "SHM_LOCK", /* 3 */ 14950Sstevel@tonic-gate "SHM_UNLOCK", /* 4 */ 14960Sstevel@tonic-gate NULL, NULL, NULL, NULL, NULL, /* 5 NULLs */ 14970Sstevel@tonic-gate "IPC_RMID", /* 10 */ 14980Sstevel@tonic-gate "IPC_SET", /* 11 */ 14990Sstevel@tonic-gate "IPC_STAT", /* 12 */ 15000Sstevel@tonic-gate "IPC_SET64", /* 13 */ 15010Sstevel@tonic-gate "IPC_STAT64", /* 14 */ 15020Sstevel@tonic-gate }; 15030Sstevel@tonic-gate 15040Sstevel@tonic-gate const char * 15050Sstevel@tonic-gate msgcmd(int arg) 15060Sstevel@tonic-gate { 15070Sstevel@tonic-gate const char *str = NULL; 15080Sstevel@tonic-gate 15090Sstevel@tonic-gate if (arg >= MSGCMDMIN && arg <= MSGCMDMAX) 15100Sstevel@tonic-gate str = MSGCMDname[arg-MSGCMDMIN]; 15110Sstevel@tonic-gate return (str); 15120Sstevel@tonic-gate } 15130Sstevel@tonic-gate 15140Sstevel@tonic-gate const char * 15150Sstevel@tonic-gate semcmd(int arg) 15160Sstevel@tonic-gate { 15170Sstevel@tonic-gate const char *str = NULL; 15180Sstevel@tonic-gate 15190Sstevel@tonic-gate if (arg >= SEMCMDMIN && arg <= SEMCMDMAX) 15200Sstevel@tonic-gate str = SEMCMDname[arg-SEMCMDMIN]; 15210Sstevel@tonic-gate return (str); 15220Sstevel@tonic-gate } 15230Sstevel@tonic-gate 15240Sstevel@tonic-gate const char * 15250Sstevel@tonic-gate shmcmd(int arg) 15260Sstevel@tonic-gate { 15270Sstevel@tonic-gate const char *str = NULL; 15280Sstevel@tonic-gate 15290Sstevel@tonic-gate if (arg >= SHMCMDMIN && arg <= SHMCMDMAX) 15300Sstevel@tonic-gate str = SHMCMDname[arg-SHMCMDMIN]; 15310Sstevel@tonic-gate return (str); 15320Sstevel@tonic-gate } 15330Sstevel@tonic-gate 15340Sstevel@tonic-gate const char * 15350Sstevel@tonic-gate strrdopt(int arg) /* streams read option (I_SRDOPT I_GRDOPT) */ 15360Sstevel@tonic-gate { 15370Sstevel@tonic-gate const char *str = NULL; 15380Sstevel@tonic-gate 15390Sstevel@tonic-gate switch (arg) { 15400Sstevel@tonic-gate case RNORM: str = "RNORM"; break; 15410Sstevel@tonic-gate case RMSGD: str = "RMSGD"; break; 15420Sstevel@tonic-gate case RMSGN: str = "RMSGN"; break; 15430Sstevel@tonic-gate } 15440Sstevel@tonic-gate 15450Sstevel@tonic-gate return (str); 15460Sstevel@tonic-gate } 15470Sstevel@tonic-gate 15480Sstevel@tonic-gate /* bit map of streams events (I_SETSIG & I_GETSIG) */ 15490Sstevel@tonic-gate const char * 15500Sstevel@tonic-gate strevents(private_t *pri, int arg) 15510Sstevel@tonic-gate { 15520Sstevel@tonic-gate char *str = pri->code_buf; 15530Sstevel@tonic-gate 15540Sstevel@tonic-gate if (arg & ~(S_INPUT|S_HIPRI|S_OUTPUT|S_MSG|S_ERROR|S_HANGUP)) 15550Sstevel@tonic-gate return ((char *)NULL); 15560Sstevel@tonic-gate 15570Sstevel@tonic-gate *str = '\0'; 15580Sstevel@tonic-gate if (arg & S_INPUT) 15590Sstevel@tonic-gate (void) strcat(str, "|S_INPUT"); 15600Sstevel@tonic-gate if (arg & S_HIPRI) 15610Sstevel@tonic-gate (void) strcat(str, "|S_HIPRI"); 15620Sstevel@tonic-gate if (arg & S_OUTPUT) 15630Sstevel@tonic-gate (void) strcat(str, "|S_OUTPUT"); 15640Sstevel@tonic-gate if (arg & S_MSG) 15650Sstevel@tonic-gate (void) strcat(str, "|S_MSG"); 15660Sstevel@tonic-gate if (arg & S_ERROR) 15670Sstevel@tonic-gate (void) strcat(str, "|S_ERROR"); 15680Sstevel@tonic-gate if (arg & S_HANGUP) 15690Sstevel@tonic-gate (void) strcat(str, "|S_HANGUP"); 15700Sstevel@tonic-gate 15710Sstevel@tonic-gate return ((const char *)(str+1)); 15720Sstevel@tonic-gate } 15730Sstevel@tonic-gate 15740Sstevel@tonic-gate const char * 15750Sstevel@tonic-gate tiocflush(private_t *pri, int arg) /* bit map passsed by TIOCFLUSH */ 15760Sstevel@tonic-gate { 15770Sstevel@tonic-gate char *str = pri->code_buf; 15780Sstevel@tonic-gate 15790Sstevel@tonic-gate if (arg & ~(FREAD|FWRITE)) 15800Sstevel@tonic-gate return ((char *)NULL); 15810Sstevel@tonic-gate 15820Sstevel@tonic-gate *str = '\0'; 15830Sstevel@tonic-gate if (arg & FREAD) 15840Sstevel@tonic-gate (void) strcat(str, "|FREAD"); 15850Sstevel@tonic-gate if (arg & FWRITE) 15860Sstevel@tonic-gate (void) strcat(str, "|FWRITE"); 15870Sstevel@tonic-gate 15880Sstevel@tonic-gate return ((const char *)(str+1)); 15890Sstevel@tonic-gate } 15900Sstevel@tonic-gate 15910Sstevel@tonic-gate const char * 15920Sstevel@tonic-gate strflush(int arg) /* streams flush option (I_FLUSH) */ 15930Sstevel@tonic-gate { 15940Sstevel@tonic-gate const char *str = NULL; 15950Sstevel@tonic-gate 15960Sstevel@tonic-gate switch (arg) { 15970Sstevel@tonic-gate case FLUSHR: str = "FLUSHR"; break; 15980Sstevel@tonic-gate case FLUSHW: str = "FLUSHW"; break; 15990Sstevel@tonic-gate case FLUSHRW: str = "FLUSHRW"; break; 16000Sstevel@tonic-gate } 16010Sstevel@tonic-gate 16020Sstevel@tonic-gate return (str); 16030Sstevel@tonic-gate } 16040Sstevel@tonic-gate 16050Sstevel@tonic-gate #define ALL_MOUNT_FLAGS (MS_RDONLY|MS_FSS|MS_DATA|MS_NOSUID|MS_REMOUNT| \ 16060Sstevel@tonic-gate MS_NOTRUNC|MS_OVERLAY|MS_OPTIONSTR|MS_GLOBAL|MS_FORCE|MS_NOMNTTAB) 16070Sstevel@tonic-gate 16080Sstevel@tonic-gate const char * 16090Sstevel@tonic-gate mountflags(private_t *pri, int arg) /* bit map of mount syscall flags */ 16100Sstevel@tonic-gate { 16110Sstevel@tonic-gate char *str = pri->code_buf; 16120Sstevel@tonic-gate size_t used = 0; 16130Sstevel@tonic-gate 16140Sstevel@tonic-gate if (arg & ~ALL_MOUNT_FLAGS) 16150Sstevel@tonic-gate return ((char *)NULL); 16160Sstevel@tonic-gate 16170Sstevel@tonic-gate *str = '\0'; 16180Sstevel@tonic-gate if (arg & MS_RDONLY) 16190Sstevel@tonic-gate used = strlcat(str, "|MS_RDONLY", sizeof (pri->code_buf)); 16200Sstevel@tonic-gate if (arg & MS_FSS) 16210Sstevel@tonic-gate used = strlcat(str, "|MS_FSS", sizeof (pri->code_buf)); 16220Sstevel@tonic-gate if (arg & MS_DATA) 16230Sstevel@tonic-gate used = strlcat(str, "|MS_DATA", sizeof (pri->code_buf)); 16240Sstevel@tonic-gate if (arg & MS_NOSUID) 16250Sstevel@tonic-gate used = strlcat(str, "|MS_NOSUID", sizeof (pri->code_buf)); 16260Sstevel@tonic-gate if (arg & MS_REMOUNT) 16270Sstevel@tonic-gate used = strlcat(str, "|MS_REMOUNT", sizeof (pri->code_buf)); 16280Sstevel@tonic-gate if (arg & MS_NOTRUNC) 16290Sstevel@tonic-gate used = strlcat(str, "|MS_NOTRUNC", sizeof (pri->code_buf)); 16300Sstevel@tonic-gate if (arg & MS_OVERLAY) 16310Sstevel@tonic-gate used = strlcat(str, "|MS_OVERLAY", sizeof (pri->code_buf)); 16320Sstevel@tonic-gate if (arg & MS_OPTIONSTR) 16330Sstevel@tonic-gate used = strlcat(str, "|MS_OPTIONSTR", sizeof (pri->code_buf)); 16340Sstevel@tonic-gate if (arg & MS_GLOBAL) 16350Sstevel@tonic-gate used = strlcat(str, "|MS_GLOBAL", sizeof (pri->code_buf)); 16360Sstevel@tonic-gate if (arg & MS_FORCE) 16370Sstevel@tonic-gate used = strlcat(str, "|MS_FORCE", sizeof (pri->code_buf)); 16380Sstevel@tonic-gate if (arg & MS_NOMNTTAB) 16390Sstevel@tonic-gate used = strlcat(str, "|MS_NOMNTTAB", sizeof (pri->code_buf)); 16400Sstevel@tonic-gate 16410Sstevel@tonic-gate if (used == 0 || used >= sizeof (pri->code_buf)) 16420Sstevel@tonic-gate return ((char *)NULL); /* use prt_hex() */ 16430Sstevel@tonic-gate 16440Sstevel@tonic-gate return ((const char *)(str+1)); 16450Sstevel@tonic-gate } 16460Sstevel@tonic-gate 16470Sstevel@tonic-gate const char * 16480Sstevel@tonic-gate svfsflags(private_t *pri, ulong_t arg) /* bit map of statvfs syscall flags */ 16490Sstevel@tonic-gate { 16500Sstevel@tonic-gate char *str = pri->code_buf; 16510Sstevel@tonic-gate 16520Sstevel@tonic-gate if (arg & ~(ST_RDONLY|ST_NOSUID|ST_NOTRUNC)) { 16530Sstevel@tonic-gate (void) sprintf(str, "0x%lx", arg); 16540Sstevel@tonic-gate return (str); 16550Sstevel@tonic-gate } 16560Sstevel@tonic-gate *str = '\0'; 16570Sstevel@tonic-gate if (arg & ST_RDONLY) 16580Sstevel@tonic-gate (void) strcat(str, "|ST_RDONLY"); 16590Sstevel@tonic-gate if (arg & ST_NOSUID) 16600Sstevel@tonic-gate (void) strcat(str, "|ST_NOSUID"); 16610Sstevel@tonic-gate if (arg & ST_NOTRUNC) 16620Sstevel@tonic-gate (void) strcat(str, "|ST_NOTRUNC"); 16630Sstevel@tonic-gate if (*str == '\0') 16640Sstevel@tonic-gate (void) strcat(str, "|0"); 16650Sstevel@tonic-gate return ((const char *)(str+1)); 16660Sstevel@tonic-gate } 16670Sstevel@tonic-gate 16680Sstevel@tonic-gate const char * 16690Sstevel@tonic-gate fuiname(int arg) /* fusers() input argument */ 16700Sstevel@tonic-gate { 16710Sstevel@tonic-gate const char *str = NULL; 16720Sstevel@tonic-gate 16730Sstevel@tonic-gate switch (arg) { 16740Sstevel@tonic-gate case F_FILE_ONLY: str = "F_FILE_ONLY"; break; 16750Sstevel@tonic-gate case F_CONTAINED: str = "F_CONTAINED"; break; 16760Sstevel@tonic-gate } 16770Sstevel@tonic-gate 16780Sstevel@tonic-gate return (str); 16790Sstevel@tonic-gate } 16800Sstevel@tonic-gate 16810Sstevel@tonic-gate const char * 16820Sstevel@tonic-gate fuflags(private_t *pri, int arg) /* fusers() output flags */ 16830Sstevel@tonic-gate { 16840Sstevel@tonic-gate char *str = pri->code_buf; 16850Sstevel@tonic-gate 16860Sstevel@tonic-gate if (arg & ~(F_CDIR|F_RDIR|F_TEXT|F_MAP|F_OPEN|F_TRACE|F_TTY)) { 16870Sstevel@tonic-gate (void) sprintf(str, "0x%x", arg); 16880Sstevel@tonic-gate return (str); 16890Sstevel@tonic-gate } 16900Sstevel@tonic-gate *str = '\0'; 16910Sstevel@tonic-gate if (arg & F_CDIR) 16920Sstevel@tonic-gate (void) strcat(str, "|F_CDIR"); 16930Sstevel@tonic-gate if (arg & F_RDIR) 16940Sstevel@tonic-gate (void) strcat(str, "|F_RDIR"); 16950Sstevel@tonic-gate if (arg & F_TEXT) 16960Sstevel@tonic-gate (void) strcat(str, "|F_TEXT"); 16970Sstevel@tonic-gate if (arg & F_MAP) 16980Sstevel@tonic-gate (void) strcat(str, "|F_MAP"); 16990Sstevel@tonic-gate if (arg & F_OPEN) 17000Sstevel@tonic-gate (void) strcat(str, "|F_OPEN"); 17010Sstevel@tonic-gate if (arg & F_TRACE) 17020Sstevel@tonic-gate (void) strcat(str, "|F_TRACE"); 17030Sstevel@tonic-gate if (arg & F_TTY) 17040Sstevel@tonic-gate (void) strcat(str, "|F_TTY"); 17050Sstevel@tonic-gate if (*str == '\0') 17060Sstevel@tonic-gate (void) strcat(str, "|0"); 17070Sstevel@tonic-gate return ((const char *)(str+1)); 17080Sstevel@tonic-gate } 17090Sstevel@tonic-gate 17100Sstevel@tonic-gate 17110Sstevel@tonic-gate const char * 17120Sstevel@tonic-gate ipprotos(int arg) /* IP protocols cf. netinet/in.h */ 17130Sstevel@tonic-gate { 17140Sstevel@tonic-gate switch (arg) { 17150Sstevel@tonic-gate case IPPROTO_IP: return ("IPPROTO_IP"); 17160Sstevel@tonic-gate case IPPROTO_ICMP: return ("IPPROTO_ICMP"); 17170Sstevel@tonic-gate case IPPROTO_IGMP: return ("IPPROTO_IGMP"); 17180Sstevel@tonic-gate case IPPROTO_GGP: return ("IPPROTO_GGP"); 17190Sstevel@tonic-gate case IPPROTO_ENCAP: return ("IPPROTO_ENCAP"); 17200Sstevel@tonic-gate case IPPROTO_TCP: return ("IPPROTO_TCP"); 17210Sstevel@tonic-gate case IPPROTO_EGP: return ("IPPROTO_EGP"); 17220Sstevel@tonic-gate case IPPROTO_PUP: return ("IPPROTO_PUP"); 17230Sstevel@tonic-gate case IPPROTO_UDP: return ("IPPROTO_UDP"); 17240Sstevel@tonic-gate case IPPROTO_IDP: return ("IPPROTO_IDP"); 17250Sstevel@tonic-gate case IPPROTO_IPV6: return ("IPPROTO_IPV6"); 17260Sstevel@tonic-gate case IPPROTO_ROUTING: return ("IPPROTO_ROUTING"); 17270Sstevel@tonic-gate case IPPROTO_FRAGMENT: return ("IPPROTO_FRAGMENT"); 17280Sstevel@tonic-gate case IPPROTO_RSVP: return ("IPPROTO_RSVP"); 17290Sstevel@tonic-gate case IPPROTO_ESP: return ("IPPROTO_ESP"); 17300Sstevel@tonic-gate case IPPROTO_AH: return ("IPPROTO_AH"); 17310Sstevel@tonic-gate case IPPROTO_ICMPV6: return ("IPPROTO_ICMPV6"); 17320Sstevel@tonic-gate case IPPROTO_NONE: return ("IPPROTO_NONE"); 17330Sstevel@tonic-gate case IPPROTO_DSTOPTS: return ("IPPROTO_DSTOPTS"); 17340Sstevel@tonic-gate case IPPROTO_HELLO: return ("IPPROTO_HELLO"); 17350Sstevel@tonic-gate case IPPROTO_ND: return ("IPPROTO_ND"); 17360Sstevel@tonic-gate case IPPROTO_EON: return ("IPPROTO_EON"); 17370Sstevel@tonic-gate case IPPROTO_PIM: return ("IPPROTO_PIM"); 17380Sstevel@tonic-gate case IPPROTO_SCTP: return ("IPPROTO_SCTP"); 17390Sstevel@tonic-gate case IPPROTO_RAW: return ("IPPROTO_RAW"); 17400Sstevel@tonic-gate default: return (NULL); 17410Sstevel@tonic-gate } 17420Sstevel@tonic-gate } 1743