xref: /titanic_51/usr/src/cmd/truss/codes.c (revision 06bbe1e05e4f6fd0773ee85a50c0de7adfc4fa06)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5ea8dc4b6Seschrock  * Common Development and Distribution License (the "License").
6ea8dc4b6Seschrock  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22d62bc4baSyz147064  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
277c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include <stdio.h>
337c478bd9Sstevel@tonic-gate #include <stdlib.h>
347c478bd9Sstevel@tonic-gate #include <unistd.h>
357c478bd9Sstevel@tonic-gate #include <sys/types.h>
367c478bd9Sstevel@tonic-gate #include <libproc.h>
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate #include <ctype.h>
397c478bd9Sstevel@tonic-gate #include <string.h>
407c478bd9Sstevel@tonic-gate #include <sys/dlpi.h>
417c478bd9Sstevel@tonic-gate #include <sys/ipc.h>
427c478bd9Sstevel@tonic-gate #include <sys/ipc_impl.h>
437c478bd9Sstevel@tonic-gate #include <sys/msg.h>
447c478bd9Sstevel@tonic-gate #include <sys/sem.h>
457c478bd9Sstevel@tonic-gate #include <sys/shm.h>
467c478bd9Sstevel@tonic-gate #include <sys/fstyp.h>
477c478bd9Sstevel@tonic-gate #if defined(__i386) || defined(__amd64)
487c478bd9Sstevel@tonic-gate #include <sys/sysi86.h>
497c478bd9Sstevel@tonic-gate #endif /* __i386 */
507c478bd9Sstevel@tonic-gate #include <sys/unistd.h>
517c478bd9Sstevel@tonic-gate #include <sys/file.h>
527c478bd9Sstevel@tonic-gate #include <sys/tiuser.h>
537c478bd9Sstevel@tonic-gate #include <sys/timod.h>
547c478bd9Sstevel@tonic-gate #include <sys/stream.h>
557c478bd9Sstevel@tonic-gate #include <sys/stropts.h>
567c478bd9Sstevel@tonic-gate #include <sys/termios.h>
577c478bd9Sstevel@tonic-gate #include <sys/termiox.h>
587c478bd9Sstevel@tonic-gate #include <sys/jioctl.h>
597c478bd9Sstevel@tonic-gate #include <sys/filio.h>
607c478bd9Sstevel@tonic-gate #include <fcntl.h>
617c478bd9Sstevel@tonic-gate #include <sys/termio.h>
627c478bd9Sstevel@tonic-gate #include <sys/stermio.h>
637c478bd9Sstevel@tonic-gate #include <sys/ttold.h>
647c478bd9Sstevel@tonic-gate #include <sys/lock.h>
657c478bd9Sstevel@tonic-gate #include <sys/mount.h>
667c478bd9Sstevel@tonic-gate #include <sys/utssys.h>
677c478bd9Sstevel@tonic-gate #include <sys/sysconfig.h>
687c478bd9Sstevel@tonic-gate #include <sys/statvfs.h>
697c478bd9Sstevel@tonic-gate #include <sys/kstat.h>
707c478bd9Sstevel@tonic-gate #include <sys/audio.h>
717c478bd9Sstevel@tonic-gate #include <sys/mixer.h>
727c478bd9Sstevel@tonic-gate #include <sys/cpc_impl.h>
737c478bd9Sstevel@tonic-gate #include <sys/devpoll.h>
747c478bd9Sstevel@tonic-gate #include <sys/strredir.h>
757c478bd9Sstevel@tonic-gate #include <sys/sockio.h>
767c478bd9Sstevel@tonic-gate #include <netinet/ip_mroute.h>
777c478bd9Sstevel@tonic-gate #include <net/if.h>
787c478bd9Sstevel@tonic-gate #include <net/if_arp.h>
797c478bd9Sstevel@tonic-gate #include <sys/ptyvar.h>
807c478bd9Sstevel@tonic-gate #include <sys/des.h>
817c478bd9Sstevel@tonic-gate #include <sys/prnio.h>
827c478bd9Sstevel@tonic-gate #include <sys/dtrace.h>
837c478bd9Sstevel@tonic-gate #include <sys/crypto/ioctladmin.h>
847c478bd9Sstevel@tonic-gate #include <sys/crypto/ioctl.h>
857c478bd9Sstevel@tonic-gate #include <sys/kbio.h>
867c478bd9Sstevel@tonic-gate #include <sys/ptms.h>
877c478bd9Sstevel@tonic-gate #include <sys/aggr.h>
887c478bd9Sstevel@tonic-gate #include <sys/dld.h>
89fa9e4066Sahrens #include <sys/fs/zfs.h>
905cd9bd63Skrishna #include <inet/kssl/kssl.h>
91*06bbe1e0Sedp #include <sys/dkio.h>
92*06bbe1e0Sedp #include <sys/dumpadm.h>
93*06bbe1e0Sedp #include <sys/mntio.h>
947c478bd9Sstevel@tonic-gate 
957c478bd9Sstevel@tonic-gate #include "ramdata.h"
967c478bd9Sstevel@tonic-gate #include "proto.h"
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate #define	FCNTLMIN	F_DUPFD
997c478bd9Sstevel@tonic-gate #define	FCNTLMAX	44		/* F_SETLK64_NBMAND */
1007c478bd9Sstevel@tonic-gate const char *const FCNTLname[] = {
1017c478bd9Sstevel@tonic-gate 	"F_DUPFD",
1027c478bd9Sstevel@tonic-gate 	"F_GETFD",
1037c478bd9Sstevel@tonic-gate 	"F_SETFD",
1047c478bd9Sstevel@tonic-gate 	"F_GETFL",
1057c478bd9Sstevel@tonic-gate 	"F_SETFL",
1067c478bd9Sstevel@tonic-gate 	"F_O_GETLK",
1077c478bd9Sstevel@tonic-gate 	"F_SETLK",
1087c478bd9Sstevel@tonic-gate 	"F_SETLKW",
1097c478bd9Sstevel@tonic-gate 	"F_CHKFL",
1107c478bd9Sstevel@tonic-gate 	"F_DUP2FD",
1117c478bd9Sstevel@tonic-gate 	"F_ALLOCSP",
1127c478bd9Sstevel@tonic-gate 	"F_FREESP",
1137c478bd9Sstevel@tonic-gate 	NULL,		/* 12 */
1147c478bd9Sstevel@tonic-gate 	NULL,		/* 13 */
1157c478bd9Sstevel@tonic-gate 	"F_GETLK",
1167c478bd9Sstevel@tonic-gate 	NULL,		/* 15 */
1177c478bd9Sstevel@tonic-gate 	NULL,		/* 16 */
1187c478bd9Sstevel@tonic-gate 	NULL,		/* 17 */
1197c478bd9Sstevel@tonic-gate 	NULL,		/* 18 */
1207c478bd9Sstevel@tonic-gate 	NULL,		/* 19 */
1217c478bd9Sstevel@tonic-gate 	NULL,		/* 20 */
1227c478bd9Sstevel@tonic-gate 	NULL,		/* 21 */
1237c478bd9Sstevel@tonic-gate 	NULL,		/* 22 */
1247c478bd9Sstevel@tonic-gate 	"F_GETOWN",
1257c478bd9Sstevel@tonic-gate 	"F_SETOWN",
1267c478bd9Sstevel@tonic-gate 	"F_REVOKE",
1277c478bd9Sstevel@tonic-gate 	"F_HASREMOTELOCKS",
1287c478bd9Sstevel@tonic-gate 	"F_FREESP64",
1297c478bd9Sstevel@tonic-gate 	NULL,		/* 28 */
1307c478bd9Sstevel@tonic-gate 	NULL,		/* 29 */
1317c478bd9Sstevel@tonic-gate 	NULL,		/* 30 */
1327c478bd9Sstevel@tonic-gate 	NULL,		/* 31 */
1337c478bd9Sstevel@tonic-gate 	NULL,		/* 32 */
1347c478bd9Sstevel@tonic-gate 	"F_GETLK64",
1357c478bd9Sstevel@tonic-gate 	"F_SETLK64",
1367c478bd9Sstevel@tonic-gate 	"F_SETLKW64",
1377c478bd9Sstevel@tonic-gate 	NULL,		/* 36 */
1387c478bd9Sstevel@tonic-gate 	NULL,		/* 37 */
1397c478bd9Sstevel@tonic-gate 	NULL,		/* 38 */
1407c478bd9Sstevel@tonic-gate 	NULL,		/* 39 */
1417c478bd9Sstevel@tonic-gate 	"F_SHARE",
1427c478bd9Sstevel@tonic-gate 	"F_UNSHARE",
1437c478bd9Sstevel@tonic-gate 	"F_SETLK_NBMAND",
1447c478bd9Sstevel@tonic-gate 	"F_SHARE_NBMAND",
1457c478bd9Sstevel@tonic-gate 	"F_SETLK64_NBMAND"
1467c478bd9Sstevel@tonic-gate };
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate #define	SYSFSMIN	GETFSIND
1497c478bd9Sstevel@tonic-gate #define	SYSFSMAX	GETNFSTYP
1507c478bd9Sstevel@tonic-gate const char *const SYSFSname[] = {
1517c478bd9Sstevel@tonic-gate 	"GETFSIND",
1527c478bd9Sstevel@tonic-gate 	"GETFSTYP",
1537c478bd9Sstevel@tonic-gate 	"GETNFSTYP"
1547c478bd9Sstevel@tonic-gate };
1557c478bd9Sstevel@tonic-gate 
1567c478bd9Sstevel@tonic-gate #define	PLOCKMIN	UNLOCK
1577c478bd9Sstevel@tonic-gate #define	PLOCKMAX	DATLOCK
1587c478bd9Sstevel@tonic-gate const char *const PLOCKname[] = {
1597c478bd9Sstevel@tonic-gate 	"UNLOCK",
1607c478bd9Sstevel@tonic-gate 	"PROCLOCK",
1617c478bd9Sstevel@tonic-gate 	"TXTLOCK",
1627c478bd9Sstevel@tonic-gate 	NULL,
1637c478bd9Sstevel@tonic-gate 	"DATLOCK"
1647c478bd9Sstevel@tonic-gate };
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate #define	SCONFMIN	_CONFIG_NGROUPS
1677c478bd9Sstevel@tonic-gate #define	SCONFMAX	_CONFIG_CPUID_MAX
1687c478bd9Sstevel@tonic-gate const char *const SCONFname[] = {
1697c478bd9Sstevel@tonic-gate 	"_CONFIG_NGROUPS",		/*  2 */
1707c478bd9Sstevel@tonic-gate 	"_CONFIG_CHILD_MAX",		/*  3 */
1717c478bd9Sstevel@tonic-gate 	"_CONFIG_OPEN_FILES",		/*  4 */
1727c478bd9Sstevel@tonic-gate 	"_CONFIG_POSIX_VER",		/*  5 */
1737c478bd9Sstevel@tonic-gate 	"_CONFIG_PAGESIZE",		/*  6 */
1747c478bd9Sstevel@tonic-gate 	"_CONFIG_CLK_TCK",		/*  7 */
1757c478bd9Sstevel@tonic-gate 	"_CONFIG_XOPEN_VER",		/*  8 */
1767c478bd9Sstevel@tonic-gate 	"_CONFIG_HRESCLK_TCK",		/*  9 */
1777c478bd9Sstevel@tonic-gate 	"_CONFIG_PROF_TCK",		/* 10 */
1787c478bd9Sstevel@tonic-gate 	"_CONFIG_NPROC_CONF",		/* 11 */
1797c478bd9Sstevel@tonic-gate 	"_CONFIG_NPROC_ONLN",		/* 12 */
1807c478bd9Sstevel@tonic-gate 	"_CONFIG_AIO_LISTIO_MAX",	/* 13 */
1817c478bd9Sstevel@tonic-gate 	"_CONFIG_AIO_MAX",		/* 14 */
1827c478bd9Sstevel@tonic-gate 	"_CONFIG_AIO_PRIO_DELTA_MAX",	/* 15 */
1837c478bd9Sstevel@tonic-gate 	"_CONFIG_DELAYTIMER_MAX",	/* 16 */
1847c478bd9Sstevel@tonic-gate 	"_CONFIG_MQ_OPEN_MAX",		/* 17 */
1857c478bd9Sstevel@tonic-gate 	"_CONFIG_MQ_PRIO_MAX",		/* 18 */
1867c478bd9Sstevel@tonic-gate 	"_CONFIG_RTSIG_MAX",		/* 19 */
1877c478bd9Sstevel@tonic-gate 	"_CONFIG_SEM_NSEMS_MAX",	/* 20 */
1887c478bd9Sstevel@tonic-gate 	"_CONFIG_SEM_VALUE_MAX",	/* 21 */
1897c478bd9Sstevel@tonic-gate 	"_CONFIG_SIGQUEUE_MAX",		/* 22 */
1907c478bd9Sstevel@tonic-gate 	"_CONFIG_SIGRT_MIN",		/* 23 */
1917c478bd9Sstevel@tonic-gate 	"_CONFIG_SIGRT_MAX",		/* 24 */
1927c478bd9Sstevel@tonic-gate 	"_CONFIG_TIMER_MAX",		/* 25 */
1937c478bd9Sstevel@tonic-gate 	"_CONFIG_PHYS_PAGES",		/* 26 */
1947c478bd9Sstevel@tonic-gate 	"_CONFIG_AVPHYS_PAGES",		/* 27 */
1957c478bd9Sstevel@tonic-gate 	"_CONFIG_COHERENCY",		/* 28 */
1967c478bd9Sstevel@tonic-gate 	"_CONFIG_SPLIT_CACHE",		/* 29 */
1977c478bd9Sstevel@tonic-gate 	"_CONFIG_ICACHESZ",		/* 30 */
1987c478bd9Sstevel@tonic-gate 	"_CONFIG_DCACHESZ",		/* 31 */
1997c478bd9Sstevel@tonic-gate 	"_CONFIG_ICACHELINESZ",		/* 32 */
2007c478bd9Sstevel@tonic-gate 	"_CONFIG_DCACHELINESZ",		/* 33 */
2017c478bd9Sstevel@tonic-gate 	"_CONFIG_ICACHEBLKSZ",		/* 34 */
2027c478bd9Sstevel@tonic-gate 	"_CONFIG_DCACHEBLKSZ",		/* 35 */
2037c478bd9Sstevel@tonic-gate 	"_CONFIG_DCACHETBLKSZ",		/* 36 */
2047c478bd9Sstevel@tonic-gate 	"_CONFIG_ICACHE_ASSOC",		/* 37 */
2057c478bd9Sstevel@tonic-gate 	"_CONFIG_DCACHE_ASSOC",		/* 38 */
2067c478bd9Sstevel@tonic-gate 	NULL,				/* 39 */
2077c478bd9Sstevel@tonic-gate 	NULL,				/* 40 */
2087c478bd9Sstevel@tonic-gate 	NULL,				/* 41 */
2097c478bd9Sstevel@tonic-gate 	"_CONFIG_MAXPID",		/* 42 */
2107c478bd9Sstevel@tonic-gate 	"_CONFIG_STACK_PROT",		/* 43 */
2117c478bd9Sstevel@tonic-gate 	"_CONFIG_NPROC_MAX",		/* 44 */
2127c478bd9Sstevel@tonic-gate 	"_CONFIG_CPUID_MAX"		/* 45 */
2137c478bd9Sstevel@tonic-gate };
2147c478bd9Sstevel@tonic-gate 
2157c478bd9Sstevel@tonic-gate #define	PATHCONFMIN	_PC_LINK_MAX
2167c478bd9Sstevel@tonic-gate #define	PATHCONFMAX	_PC_CHOWN_RESTRICTED
2177c478bd9Sstevel@tonic-gate const char *const PATHCONFname[] = {
2187c478bd9Sstevel@tonic-gate 	"_PC_LINK_MAX",
2197c478bd9Sstevel@tonic-gate 	"_PC_MAX_CANON",
2207c478bd9Sstevel@tonic-gate 	"_PC_MAX_INPUT",
2217c478bd9Sstevel@tonic-gate 	"_PC_NAME_MAX",
2227c478bd9Sstevel@tonic-gate 	"_PC_PATH_MAX",
2237c478bd9Sstevel@tonic-gate 	"_PC_PIPE_BUF",
2247c478bd9Sstevel@tonic-gate 	"_PC_NO_TRUNC",
2257c478bd9Sstevel@tonic-gate 	"_PC_VDISABLE",
2267c478bd9Sstevel@tonic-gate 	"_PC_CHOWN_RESTRICTED"
2277c478bd9Sstevel@tonic-gate };
2287c478bd9Sstevel@tonic-gate 
2297c478bd9Sstevel@tonic-gate const struct ioc {
2307c478bd9Sstevel@tonic-gate 	uint_t	code;
2317c478bd9Sstevel@tonic-gate 	const char *name;
2327c478bd9Sstevel@tonic-gate 	const char *datastruct;
2337c478bd9Sstevel@tonic-gate } ioc[] = {
2347c478bd9Sstevel@tonic-gate 	{ (uint_t)TCGETA,	"TCGETA",	NULL },
2357c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETA,	"TCSETA",	NULL },
2367c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETAW,	"TCSETAW",	NULL },
2377c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETAF,	"TCSETAF",	NULL },
2387c478bd9Sstevel@tonic-gate 	{ (uint_t)TCFLSH,	"TCFLSH",	NULL },
2397c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCKBON,	"TIOCKBON",	NULL },
2407c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCKBOF,	"TIOCKBOF",	NULL },
2417c478bd9Sstevel@tonic-gate 	{ (uint_t)KBENABLED,	"KBENABLED",	NULL },
2427c478bd9Sstevel@tonic-gate 	{ (uint_t)TCGETS,	"TCGETS",	NULL },
2437c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETS,	"TCSETS",	NULL },
2447c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETSW,	"TCSETSW",	NULL },
2457c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETSF,	"TCSETSF",	NULL },
2467c478bd9Sstevel@tonic-gate 	{ (uint_t)TCXONC,	"TCXONC",	NULL },
2477c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSBRK,	"TCSBRK",	NULL },
2487c478bd9Sstevel@tonic-gate 	{ (uint_t)TCDSET,	"TCDSET",	NULL },
2497c478bd9Sstevel@tonic-gate 	{ (uint_t)RTS_TOG,	"RTS_TOG",	NULL },
2507c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSWINSZ,	"TIOCSWINSZ",	NULL },
2517c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGWINSZ,	"TIOCGWINSZ",	NULL },
2527c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGETD,	"TIOCGETD",	NULL },
2537c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSETD,	"TIOCSETD",	NULL },
2547c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCHPCL,	"TIOCHPCL",	NULL },
2557c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGETP,	"TIOCGETP",	NULL },
2567c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSETP,	"TIOCSETP",	NULL },
2577c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSETN,	"TIOCSETN",	NULL },
2587c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCEXCL,	"TIOCEXCL",	NULL },
2597c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCNXCL,	"TIOCNXCL",	NULL },
2607c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCFLUSH,	"TIOCFLUSH",	NULL },
2617c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSETC,	"TIOCSETC",	NULL },
2627c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGETC,	"TIOCGETC",	NULL },
2637c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGPGRP,	"TIOCGPGRP",	NULL },
2647c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSPGRP,	"TIOCSPGRP",	NULL },
2657c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGSID,	"TIOCGSID",	NULL },
2667c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSTI,	"TIOCSTI",	NULL },
2677c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCMSET,	"TIOCMSET",	NULL },
2687c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCMBIS,	"TIOCMBIS",	NULL },
2697c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCMBIC,	"TIOCMBIC",	NULL },
2707c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCMGET,	"TIOCMGET",	NULL },
2717c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCREMOTE,	"TIOCREMOTE",	NULL },
2727c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSIGNAL,	"TIOCSIGNAL",	NULL },
2737c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSTART,	"TIOCSTART",	NULL },
2747c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSTOP,	"TIOCSTOP",	NULL },
2757c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCNOTTY,	"TIOCNOTTY",	NULL },
2767c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCOUTQ,	"TIOCOUTQ",	NULL },
2777c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGLTC,	"TIOCGLTC",	NULL },
2787c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSLTC,	"TIOCSLTC",	NULL },
2797c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCCDTR,	"TIOCCDTR",	NULL },
2807c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSDTR,	"TIOCSDTR",	NULL },
2817c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCCBRK,	"TIOCCBRK",	NULL },
2827c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSBRK,	"TIOCSBRK",	NULL },
2837c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCLGET,	"TIOCLGET",	NULL },
2847c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCLSET,	"TIOCLSET",	NULL },
2857c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCLBIC,	"TIOCLBIC",	NULL },
2867c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCLBIS,	"TIOCLBIS",	NULL },
2877c478bd9Sstevel@tonic-gate 
2887c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCPKT,	"TIOCPKT",	NULL },	/* ptyvar.h */
2897c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCUCNTL,	"TIOCUCNTL",	NULL },
2907c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCTCNTL,	"TIOCTCNTL",	NULL },
2917c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCISPACE,	"TIOCISPACE",	NULL },
2927c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCISIZE,	"TIOCISIZE",	NULL },
2937c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSSIZE,	"TIOCSSIZE",	"ttysize" },
2947c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGSIZE,	"TIOCGSIZE",	"ttysize" },
2957c478bd9Sstevel@tonic-gate 
2967c478bd9Sstevel@tonic-gate 	/*
2970ba2cbe9Sxc151355 	 * Unfortunately, the DLIOC and LDIOC codes overlap.  Since the LDIOC
2987c478bd9Sstevel@tonic-gate 	 * ioctls (for xenix compatibility) are far less likely to be used, we
2990ba2cbe9Sxc151355 	 * give preference to DLIOC.
3007c478bd9Sstevel@tonic-gate 	 */
3017c478bd9Sstevel@tonic-gate 	{ (uint_t)DLIOCRAW,	"DLIOCRAW",	NULL },
3020ba2cbe9Sxc151355 	{ (uint_t)DLIOCNATIVE,	"DLIOCNATIVE",	NULL },
3037c478bd9Sstevel@tonic-gate 
3047c478bd9Sstevel@tonic-gate 	{ (uint_t)LDOPEN,	"LDOPEN",	NULL },
3057c478bd9Sstevel@tonic-gate 	{ (uint_t)LDCLOSE,	"LDCLOSE",	NULL },
3067c478bd9Sstevel@tonic-gate 	{ (uint_t)LDCHG,	"LDCHG",	NULL },
3077c478bd9Sstevel@tonic-gate 	{ (uint_t)LDGETT,	"LDGETT",	NULL },
3087c478bd9Sstevel@tonic-gate 	{ (uint_t)LDSETT,	"LDSETT",	NULL },
3097c478bd9Sstevel@tonic-gate 	{ (uint_t)LDSMAP,	"LDSMAP",	NULL },
3107c478bd9Sstevel@tonic-gate 	{ (uint_t)LDGMAP,	"LDGMAP",	NULL },
3117c478bd9Sstevel@tonic-gate 	{ (uint_t)LDNMAP,	"LDNMAP",	NULL },
3127c478bd9Sstevel@tonic-gate 	{ (uint_t)TCGETX,	"TCGETX",	NULL },
3137c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETX,	"TCSETX",	NULL },
3147c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETXW,	"TCSETXW",	NULL },
3157c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETXF,	"TCSETXF",	NULL },
3167c478bd9Sstevel@tonic-gate 	{ (uint_t)FIORDCHK,	"FIORDCHK",	NULL },
3177c478bd9Sstevel@tonic-gate 	{ (uint_t)FIOCLEX,	"FIOCLEX",	NULL },
3187c478bd9Sstevel@tonic-gate 	{ (uint_t)FIONCLEX,	"FIONCLEX",	NULL },
3197c478bd9Sstevel@tonic-gate 	{ (uint_t)FIONREAD,	"FIONREAD",	NULL },
3207c478bd9Sstevel@tonic-gate 	{ (uint_t)FIONBIO,	"FIONBIO",	NULL },
3217c478bd9Sstevel@tonic-gate 	{ (uint_t)FIOASYNC,	"FIOASYNC",	NULL },
3227c478bd9Sstevel@tonic-gate 	{ (uint_t)FIOSETOWN,	"FIOSETOWN",	NULL },
3237c478bd9Sstevel@tonic-gate 	{ (uint_t)FIOGETOWN,	"FIOGETOWN",	NULL },
3247c478bd9Sstevel@tonic-gate #ifdef DIOCGETP
3257c478bd9Sstevel@tonic-gate 	{ (uint_t)DIOCGETP,	"DIOCGETP",	NULL },
3267c478bd9Sstevel@tonic-gate 	{ (uint_t)DIOCSETP,	"DIOCSETP",	NULL },
3277c478bd9Sstevel@tonic-gate #endif
3287c478bd9Sstevel@tonic-gate #ifdef DIOCGETC
3297c478bd9Sstevel@tonic-gate 	{ (uint_t)DIOCGETC,	"DIOCGETC",	NULL },
3307c478bd9Sstevel@tonic-gate 	{ (uint_t)DIOCGETB,	"DIOCGETB",	NULL },
3317c478bd9Sstevel@tonic-gate 	{ (uint_t)DIOCSETE,	"DIOCSETE",	NULL },
3327c478bd9Sstevel@tonic-gate #endif
3337c478bd9Sstevel@tonic-gate #ifdef IFFORMAT
3347c478bd9Sstevel@tonic-gate 	{ (uint_t)IFFORMAT,	"IFFORMAT",	NULL },
3357c478bd9Sstevel@tonic-gate 	{ (uint_t)IFBCHECK,	"IFBCHECK",	NULL },
3367c478bd9Sstevel@tonic-gate 	{ (uint_t)IFCONFIRM,	"IFCONFIRM",	NULL },
3377c478bd9Sstevel@tonic-gate #endif
3387c478bd9Sstevel@tonic-gate #ifdef LIOCGETP
3397c478bd9Sstevel@tonic-gate 	{ (uint_t)LIOCGETP,	"LIOCGETP",	NULL },
3407c478bd9Sstevel@tonic-gate 	{ (uint_t)LIOCSETP,	"LIOCSETP",	NULL },
3417c478bd9Sstevel@tonic-gate 	{ (uint_t)LIOCGETS,	"LIOCGETS",	NULL },
3427c478bd9Sstevel@tonic-gate 	{ (uint_t)LIOCSETS,	"LIOCSETS",	NULL },
3437c478bd9Sstevel@tonic-gate #endif
3447c478bd9Sstevel@tonic-gate #ifdef JBOOT
3457c478bd9Sstevel@tonic-gate 	{ (uint_t)JBOOT,	"JBOOT",	NULL },
3467c478bd9Sstevel@tonic-gate 	{ (uint_t)JTERM,	"JTERM",	NULL },
3477c478bd9Sstevel@tonic-gate 	{ (uint_t)JMPX,		"JMPX",	NULL },
3487c478bd9Sstevel@tonic-gate #ifdef JTIMO
3497c478bd9Sstevel@tonic-gate 	{ (uint_t)JTIMO,	"JTIMO",	NULL },
3507c478bd9Sstevel@tonic-gate #endif
3517c478bd9Sstevel@tonic-gate 	{ (uint_t)JWINSIZE,	"JWINSIZE",	NULL },
3527c478bd9Sstevel@tonic-gate 	{ (uint_t)JTIMOM,	"JTIMOM",	NULL },
3537c478bd9Sstevel@tonic-gate 	{ (uint_t)JZOMBOOT,	"JZOMBOOT",	NULL },
3547c478bd9Sstevel@tonic-gate 	{ (uint_t)JAGENT,	"JAGENT",	NULL },
3557c478bd9Sstevel@tonic-gate 	{ (uint_t)JTRUN,	"JTRUN",	NULL },
3567c478bd9Sstevel@tonic-gate 	{ (uint_t)JXTPROTO,	"JXTPROTO",	NULL },
3577c478bd9Sstevel@tonic-gate #endif
3587c478bd9Sstevel@tonic-gate 	{ (uint_t)KSTAT_IOC_CHAIN_ID,	"KSTAT_IOC_CHAIN_ID",	NULL },
3597c478bd9Sstevel@tonic-gate 	{ (uint_t)KSTAT_IOC_READ,	"KSTAT_IOC_READ",	NULL },
3607c478bd9Sstevel@tonic-gate 	{ (uint_t)KSTAT_IOC_WRITE,	"KSTAT_IOC_WRITE",	NULL },
3617c478bd9Sstevel@tonic-gate 	{ (uint_t)STGET,	"STGET",	NULL },
3627c478bd9Sstevel@tonic-gate 	{ (uint_t)STSET,	"STSET",	NULL },
3637c478bd9Sstevel@tonic-gate 	{ (uint_t)STTHROW,	"STTHROW",	NULL },
3647c478bd9Sstevel@tonic-gate 	{ (uint_t)STWLINE,	"STWLINE",	NULL },
3657c478bd9Sstevel@tonic-gate 	{ (uint_t)STTSV,	"STTSV",	NULL },
3667c478bd9Sstevel@tonic-gate 	{ (uint_t)I_NREAD,	"I_NREAD",	NULL },
3677c478bd9Sstevel@tonic-gate 	{ (uint_t)I_PUSH,	"I_PUSH",	NULL },
3687c478bd9Sstevel@tonic-gate 	{ (uint_t)I_POP,	"I_POP",	NULL },
3697c478bd9Sstevel@tonic-gate 	{ (uint_t)I_LOOK,	"I_LOOK",	NULL },
3707c478bd9Sstevel@tonic-gate 	{ (uint_t)I_FLUSH,	"I_FLUSH",	NULL },
3717c478bd9Sstevel@tonic-gate 	{ (uint_t)I_SRDOPT,	"I_SRDOPT",	NULL },
3727c478bd9Sstevel@tonic-gate 	{ (uint_t)I_GRDOPT,	"I_GRDOPT",	NULL },
3737c478bd9Sstevel@tonic-gate 	{ (uint_t)I_STR,	"I_STR",	NULL },
3747c478bd9Sstevel@tonic-gate 	{ (uint_t)I_SETSIG,	"I_SETSIG",	NULL },
3757c478bd9Sstevel@tonic-gate 	{ (uint_t)I_GETSIG,	"I_GETSIG",	NULL },
3767c478bd9Sstevel@tonic-gate 	{ (uint_t)I_FIND,	"I_FIND",	NULL },
3777c478bd9Sstevel@tonic-gate 	{ (uint_t)I_LINK,	"I_LINK",	NULL },
3787c478bd9Sstevel@tonic-gate 	{ (uint_t)I_UNLINK,	"I_UNLINK",	NULL },
3797c478bd9Sstevel@tonic-gate 	{ (uint_t)I_PEEK,	"I_PEEK",	NULL },
3807c478bd9Sstevel@tonic-gate 	{ (uint_t)I_FDINSERT,	"I_FDINSERT",	NULL },
3817c478bd9Sstevel@tonic-gate 	{ (uint_t)I_SENDFD,	"I_SENDFD",	NULL },
3827c478bd9Sstevel@tonic-gate 	{ (uint_t)I_RECVFD,	"I_RECVFD",	NULL },
3837c478bd9Sstevel@tonic-gate 	{ (uint_t)I_SWROPT,	"I_SWROPT",	NULL },
3847c478bd9Sstevel@tonic-gate 	{ (uint_t)I_GWROPT,	"I_GWROPT",	NULL },
3857c478bd9Sstevel@tonic-gate 	{ (uint_t)I_LIST,	"I_LIST",	NULL },
3867c478bd9Sstevel@tonic-gate 	{ (uint_t)I_PLINK,	"I_PLINK",	NULL },
3877c478bd9Sstevel@tonic-gate 	{ (uint_t)I_PUNLINK,	"I_PUNLINK",	NULL },
3887c478bd9Sstevel@tonic-gate 	{ (uint_t)I_FLUSHBAND,	"I_FLUSHBAND",	NULL },
3897c478bd9Sstevel@tonic-gate 	{ (uint_t)I_CKBAND,	"I_CKBAND",	NULL },
3907c478bd9Sstevel@tonic-gate 	{ (uint_t)I_GETBAND,	"I_GETBAND",	NULL },
3917c478bd9Sstevel@tonic-gate 	{ (uint_t)I_ATMARK,	"I_ATMARK",	NULL },
3927c478bd9Sstevel@tonic-gate 	{ (uint_t)I_SETCLTIME,	"I_SETCLTIME",	NULL },
3937c478bd9Sstevel@tonic-gate 	{ (uint_t)I_GETCLTIME,	"I_GETCLTIME",	NULL },
3947c478bd9Sstevel@tonic-gate 	{ (uint_t)I_CANPUT,	"I_CANPUT",	NULL },
3957c478bd9Sstevel@tonic-gate #ifdef I_ANCHOR
3967c478bd9Sstevel@tonic-gate 	{ (uint_t)I_ANCHOR,	"I_ANCHOR",	NULL },
3977c478bd9Sstevel@tonic-gate #endif
3987c478bd9Sstevel@tonic-gate #ifdef TI_GETINFO
3997c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_GETINFO,	"TI_GETINFO",	NULL },
4007c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_OPTMGMT,	"TI_OPTMGMT",	NULL },
4017c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_BIND,	"TI_BIND",	NULL },
4027c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_UNBIND,	"TI_UNBIND",	NULL },
4037c478bd9Sstevel@tonic-gate #endif
4047c478bd9Sstevel@tonic-gate #ifdef	TI_CAPABILITY
4057c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_CAPABILITY,	"TI_CAPABILITY",	NULL },
4067c478bd9Sstevel@tonic-gate #endif
4077c478bd9Sstevel@tonic-gate #ifdef TI_GETMYNAME
4087c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_GETMYNAME,		"TI_GETMYNAME",		NULL },
4097c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_GETPEERNAME,	"TI_GETPEERNAME",	NULL },
4107c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_SETMYNAME,		"TI_SETMYNAME",		NULL },
4117c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_SETPEERNAME,	"TI_SETPEERNAME",	NULL },
4127c478bd9Sstevel@tonic-gate #endif
4137c478bd9Sstevel@tonic-gate #ifdef V_PREAD
4147c478bd9Sstevel@tonic-gate 	{ (uint_t)V_PREAD,	"V_PREAD",	NULL },
4157c478bd9Sstevel@tonic-gate 	{ (uint_t)V_PWRITE,	"V_PWRITE",	NULL },
4167c478bd9Sstevel@tonic-gate 	{ (uint_t)V_PDREAD,	"V_PDREAD",	NULL },
4177c478bd9Sstevel@tonic-gate 	{ (uint_t)V_PDWRITE,	"V_PDWRITE",	NULL },
4187c478bd9Sstevel@tonic-gate #if !defined(__i386) && !defined(__amd64)
4197c478bd9Sstevel@tonic-gate 	{ (uint_t)V_GETSSZ,	"V_GETSSZ",	NULL },
4207c478bd9Sstevel@tonic-gate #endif /* !__i386 */
4217c478bd9Sstevel@tonic-gate #endif
4227c478bd9Sstevel@tonic-gate 	/* audio */
4237c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GETINFO,	"AUDIO_GETINFO",	NULL },
4247c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_SETINFO,	"AUDIO_SETINFO",	NULL },
4257c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_DRAIN,		"AUDIO_DRAIN",		NULL },
4267c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GETDEV,		"AUDIO_GETDEV",		NULL },
4277c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_DIAG_LOOPBACK,	"AUDIO_DIAG_LOOPBACK",	NULL },
4287c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_CH_NUMBER,	"AUDIO_GET_CH_NUMBER",	NULL },
4297c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_CH_TYPE,	"AUDIO_GET_CH_TYPE",	NULL },
4307c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_NUM_CHS,	"AUDIO_GET_NUM_CHS",	NULL },
4317c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_AD_DEV,	"AUDIO_GET_AD_DEV",	NULL },
4327c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_APM_DEV,	"AUDIO_GET_APM_DEV",	NULL },
4337c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_AS_DEV,	"AUDIO_GET_AS_DEV",	NULL },
4347c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXER_MULTIPLE_OPEN,	"AUDIO_MIXER_MULTIPLE_OPEN",
4357c478bd9Sstevel@tonic-gate 	    NULL },
4367c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXER_SINGLE_OPEN,	"AUDIO_MIXER_SINGLE_OPEN",
4377c478bd9Sstevel@tonic-gate 	    NULL },
4387c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXER_GET_SAMPLE_RATES,	"AUDIO_MIXER_GET_SAMPLE_RATES",
4397c478bd9Sstevel@tonic-gate 	    NULL },
4407c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_GETINFO,	"AUDIO_MIXERCTL_GETINFO",
4417c478bd9Sstevel@tonic-gate 	    NULL },
4427c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_SETINFO,	"AUDIO_MIXERCTL_SETINFO",
4437c478bd9Sstevel@tonic-gate 	    NULL },
4447c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_GET_CHINFO,	"AUDIO_MIXERCTL_GET_CHINFO",
4457c478bd9Sstevel@tonic-gate 	    NULL },
4467c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_SET_CHINFO,	"AUDIO_MIXERCTL_SET_CHINFO",
4477c478bd9Sstevel@tonic-gate 	    NULL },
4487c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_GET_MODE,	"AUDIO_MIXERCTL_GET_MODE",
4497c478bd9Sstevel@tonic-gate 	    NULL },
4507c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_SET_MODE,	"AUDIO_MIXERCTL_SET_MODE",
4517c478bd9Sstevel@tonic-gate 	    NULL },
4527c478bd9Sstevel@tonic-gate 	/* STREAMS redirection ioctls */
4537c478bd9Sstevel@tonic-gate 	{ (uint_t)SRIOCSREDIR,		"SRIOCSREDIR",	NULL },
4547c478bd9Sstevel@tonic-gate 	{ (uint_t)SRIOCISREDIR,		"SRIOCISREDIR",	NULL },
4557c478bd9Sstevel@tonic-gate 	{ (uint_t)CPCIO_BIND,		"CPCIO_BIND",		NULL },
4567c478bd9Sstevel@tonic-gate 	{ (uint_t)CPCIO_SAMPLE,		"CPCIO_SAMPLE",		NULL },
4577c478bd9Sstevel@tonic-gate 	{ (uint_t)CPCIO_RELE,		"CPCIO_RELE",		NULL },
4587c478bd9Sstevel@tonic-gate 	/* /dev/poll ioctl() control codes */
4597c478bd9Sstevel@tonic-gate 	{ (uint_t)DP_POLL,	"DP_POLL",	NULL },
4607c478bd9Sstevel@tonic-gate 	{ (uint_t)DP_ISPOLLED,	"DP_ISPOLLED",	NULL },
4617c478bd9Sstevel@tonic-gate 	/* the old /proc ioctl() control codes */
4627c478bd9Sstevel@tonic-gate #define	PIOC	('q'<<8)
4637c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|1),	"PIOCSTATUS",	NULL },
4647c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|2),	"PIOCSTOP",	NULL },
4657c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|3),	"PIOCWSTOP",	NULL },
4667c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|4),	"PIOCRUN",	NULL },
4677c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|5),	"PIOCGTRACE",	NULL },
4687c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|6),	"PIOCSTRACE",	NULL },
4697c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|7),	"PIOCSSIG",	NULL },
4707c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|8),	"PIOCKILL",	NULL },
4717c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|9),	"PIOCUNKILL",	NULL },
4727c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|10),	"PIOCGHOLD",	NULL },
4737c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|11),	"PIOCSHOLD",	NULL },
4747c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|12),	"PIOCMAXSIG",	NULL },
4757c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|13),	"PIOCACTION",	NULL },
4767c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|14),	"PIOCGFAULT",	NULL },
4777c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|15),	"PIOCSFAULT",	NULL },
4787c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|16),	"PIOCCFAULT",	NULL },
4797c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|17),	"PIOCGENTRY",	NULL },
4807c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|18),	"PIOCSENTRY",	NULL },
4817c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|19),	"PIOCGEXIT",	NULL },
4827c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|20),	"PIOCSEXIT",	NULL },
4837c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|21),	"PIOCSFORK",	NULL },
4847c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|22),	"PIOCRFORK",	NULL },
4857c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|23),	"PIOCSRLC",	NULL },
4867c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|24),	"PIOCRRLC",	NULL },
4877c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|25),	"PIOCGREG",	NULL },
4887c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|26),	"PIOCSREG",	NULL },
4897c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|27),	"PIOCGFPREG",	NULL },
4907c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|28),	"PIOCSFPREG",	NULL },
4917c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|29),	"PIOCNICE",	NULL },
4927c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|30),	"PIOCPSINFO",	NULL },
4937c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|31),	"PIOCNMAP",	NULL },
4947c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|32),	"PIOCMAP",	NULL },
4957c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|33),	"PIOCOPENM",	NULL },
4967c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|34),	"PIOCCRED",	NULL },
4977c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|35),	"PIOCGROUPS",	NULL },
4987c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|36),	"PIOCGETPR",	NULL },
4997c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|37),	"PIOCGETU",	NULL },
5007c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|38),	"PIOCSET",	NULL },
5017c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|39),	"PIOCRESET",	NULL },
5027c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|43),	"PIOCUSAGE",	NULL },
5037c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|44),	"PIOCOPENPD",	NULL },
5047c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|45),	"PIOCLWPIDS",	NULL },
5057c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|46),	"PIOCOPENLWP",	NULL },
5067c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|47),	"PIOCLSTATUS",	NULL },
5077c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|48),	"PIOCLUSAGE",	NULL },
5087c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|49),	"PIOCNAUXV",	NULL },
5097c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|50),	"PIOCAUXV",	NULL },
5107c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|51),	"PIOCGXREGSIZE",	NULL },
5117c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|52),	"PIOCGXREG",	NULL },
5127c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|53),	"PIOCSXREG",	NULL },
5137c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|101),	"PIOCGWIN",	NULL },
5147c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|103),	"PIOCNLDT",	NULL },
5157c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|104),	"PIOCLDT",	NULL },
5167c478bd9Sstevel@tonic-gate 
5177c478bd9Sstevel@tonic-gate 	/* ioctl's applicable on sockets */
5187c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSHIWAT,	"SIOCSHIWAT",	NULL },
5197c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGHIWAT,	"SIOCGHIWAT",	NULL },
5207c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLOWAT,	"SIOCSLOWAT",	NULL },
5217c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLOWAT,	"SIOCGLOWAT",	NULL },
5227c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCATMARK,	"SIOCATMARK",	NULL },
5237c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSPGRP,	"SIOCSPGRP",	NULL },
5247c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGPGRP,	"SIOCGPGRP",	NULL },
5257c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCADDRT,	"SIOCADDRT",	"rtentry" },
5267c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCDELRT,	"SIOCDELRT",	"rtentry" },
5277c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETVIFCNT,	"SIOCGETVIFCNT", "sioc_vif_req" },
5287c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETSGCNT,	"SIOCGETSGCNT",	"sioc_sg_req" },
5297c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETLSGCNT,	"SIOCGETLSGCNT", "sioc_lsg_req" },
5307c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFADDR,	"SIOCSIFADDR",	"ifreq" },
5317c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFADDR,	"SIOCGIFADDR",	"ifreq" },
5327c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFDSTADDR,	"SIOCSIFDSTADDR", "ifreq" },
5337c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFDSTADDR,	"SIOCGIFDSTADDR", "ifreq" },
5347c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFFLAGS,	"SIOCSIFFLAGS",	"ifreq" },
5357c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFFLAGS,	"SIOCGIFFLAGS",	"ifreq" },
5367c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFMEM,	"SIOCSIFMEM",	"ifreq" },
5377c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFMEM,	"SIOCGIFMEM",	"ifreq" },
5387c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFCONF,	"SIOCGIFCONF",	"ifconf" },
5397c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFMTU,	"SIOCSIFMTU",	"ifreq" },
5407c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFMTU,	"SIOCGIFMTU",	"ifreq" },
5417c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFBRDADDR,	"SIOCGIFBRDADDR",	"ifreq" },
5427c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFBRDADDR,	"SIOCSIFBRDADDR",	"ifreq" },
5437c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFNETMASK,	"SIOCGIFNETMASK",	"ifreq" },
5447c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFNETMASK,	"SIOCSIFNETMASK",	"ifreq" },
5457c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFMETRIC,	"SIOCGIFMETRIC",	"ifreq" },
5467c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFMETRIC,	"SIOCSIFMETRIC",	"ifreq" },
5477c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSARP,	"SIOCSARP",	"arpreq" },
5487c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGARP,	"SIOCGARP",	"arpreq" },
5497c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCDARP,	"SIOCDARP",	"arpreq" },
5507c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCUPPER,	"SIOCUPPER",	"ifreq" },
5517c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLOWER,	"SIOCLOWER",	"ifreq" },
5527c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSETSYNC,	"SIOCSETSYNC",	"ifreq" },
5537c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETSYNC,	"SIOCGETSYNC",	"ifreq" },
5547c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSSDSTATS,	"SIOCSSDSTATS",	"ifreq" },
5557c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSSESTATS,	"SIOCSSESTATS",	"ifreq" },
5567c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSPROMISC,	"SIOCSPROMISC",	NULL },
5577c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCADDMULTI,	"SIOCADDMULTI",	"ifreq" },
5587c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCDELMULTI,	"SIOCDELMULTI",	"ifreq" },
5597c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETNAME,	"SIOCGETNAME",	"sockaddr" },
5607c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETPEER,	"SIOCGETPEER",	"sockaddr" },
5617c478bd9Sstevel@tonic-gate 	{ (uint_t)IF_UNITSEL,	"IF_UNITSEL",	NULL },
5627c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCXPROTO,	"SIOCXPROTO",	NULL },
5637c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCIFDETACH,	"SIOCIFDETACH",	"ifreq" },
5647c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGENPSTATS,	"SIOCGENPSTATS",	"ifreq" },
5657c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCX25XMT,	"SIOCX25XMT",	"ifreq" },
5667c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCX25RCV,	"SIOCX25RCV",	"ifreq" },
5677c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCX25TBL,	"SIOCX25TBL",	"ifreq" },
5687c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLGETREQ,	"SIOCSLGETREQ",	"ifreq" },
5697c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLSTAT,	"SIOCSLSTAT",	"ifreq" },
5707c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFNAME,	"SIOCSIFNAME",	"ifreq" },
5717c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGENADDR,	"SIOCGENADDR",	"ifreq" },
5727c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFNUM,	"SIOCGIFNUM",	NULL },
5737c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFMUXID,	"SIOCGIFMUXID",	"ifreq" },
5747c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFMUXID,	"SIOCSIFMUXID",	"ifreq" },
5757c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFINDEX,	"SIOCGIFINDEX",	"ifreq" },
5767c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFINDEX,	"SIOCSIFINDEX",	"ifreq" },
5777c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFREMOVEIF,	"SIOCLIFREMOVEIF",	"lifreq" },
5787c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFADDIF,		"SIOCLIFADDIF",		"lifreq" },
5797c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFADDR,		"SIOCSLIFADDR",		"lifreq" },
5807c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFADDR,		"SIOCGLIFADDR",		"lifreq" },
5817c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFDSTADDR,	"SIOCSLIFDSTADDR",	"lifreq" },
5827c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFDSTADDR,	"SIOCGLIFDSTADDR",	"lifreq" },
5837c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFFLAGS,	"SIOCSLIFFLAGS",	"lifreq" },
5847c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFFLAGS,	"SIOCGLIFFLAGS",	"lifreq" },
5857c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFCONF,		"SIOCGLIFCONF",		"lifconf" },
5867c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFMTU,		"SIOCSLIFMTU",		"lifreq" },
5877c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFMTU,		"SIOCGLIFMTU",		"lifreq" },
5887c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFBRDADDR,	"SIOCGLIFBRDADDR",	"lifreq" },
5897c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFBRDADDR,	"SIOCSLIFBRDADDR",	"lifreq" },
5907c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFNETMASK,	"SIOCGLIFNETMASK",	"lifreq" },
5917c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFNETMASK,	"SIOCSLIFNETMASK",	"lifreq" },
5927c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFMETRIC,	"SIOCGLIFMETRIC",	"lifreq" },
5937c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFMETRIC,	"SIOCSLIFMETRIC",	"lifreq" },
5947c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFNAME,		"SIOCSLIFNAME",		"lifreq" },
5957c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFNUM,		"SIOCGLIFNUM",		"lifnum" },
5967c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFMUXID,	"SIOCGLIFMUXID",	"lifreq" },
5977c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFMUXID,	"SIOCSLIFMUXID",	"lifreq" },
5987c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFINDEX,	"SIOCGLIFINDEX",	"lifreq" },
5997c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFINDEX,	"SIOCSLIFINDEX",	"lifreq" },
6007c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFTOKEN,	"SIOCSLIFTOKEN",	"lifreq" },
6017c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFTOKEN,	"SIOCGLIFTOKEN",	"lifreq" },
6027c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFSUBNET,	"SIOCSLIFSUBNET",	"lifreq" },
6037c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFSUBNET,	"SIOCGLIFSUBNET",	"lifreq" },
6047c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFLNKINFO,	"SIOCSLIFLNKINFO",	"lifreq" },
6057c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFLNKINFO,	"SIOCGLIFLNKINFO",	"lifreq" },
6067c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFDELND,		"SIOCLIFDELND",		"lifreq" },
6077c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFGETND,		"SIOCLIFGETND",		"lifreq" },
6087c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFSETND,		"SIOCLIFSETND",		"lifreq" },
6097c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCTMYADDR,		"SIOCTMYADDR",	"sioc_addrreq" },
6107c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCTONLINK,		"SIOCTONLINK",	"sioc_addrreq" },
6117c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCTMYSITE,		"SIOCTMYSITE",	"sioc_addrreq" },
6127c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGTUNPARAM,	"SIOCGTUNPARAM",	"iftun_req" },
6137c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSTUNPARAM,	"SIOCSTUNPARAM",	"iftun_req" },
6147c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCFIPSECONFIG,	"SIOCFIPSECONFIG",	NULL },
6157c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIPSECONFIG,	"SIOCSIPSECONFIG",	NULL },
6167c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCDIPSECONFIG,	"SIOCDIPSECONFIG",	NULL },
6177c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIPSECONFIG,	"SIOCLIPSECONFIG",	NULL },
6187c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFFAILOVER,	"SIOCLIFFAILOVER",	"lifreq" },
6197c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFFAILBACK,	"SIOCLIFFAILBACK",	"lifreq" },
620dffe27bdSethindra 	{ (uint_t)SIOCSIPMPFAILBACK,	"SIOCSIPMPFAILBACK",	NULL },
6217c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFGROUPNAME,	"SIOCSLIFGROUPNAME",	"lifreq" },
6227c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFGROUPNAME,	"SIOCGLIFGROUPNAME",	"lifreq" },
6237c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFOINDEX,	"SIOCGLIFOINDEX",	"lifreq" },
6247c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFOINDEX,	"SIOCSLIFOINDEX",	"lifreq" },
6257c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGDSTINFO,		"SIOCGDSTINFO",		NULL },
6267c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIP6ADDRPOLICY,	"SIOCGIP6ADDRPOLICY",	NULL },
6277c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIP6ADDRPOLICY,	"SIOCSIP6ADDRPOLICY", 	NULL },
6287c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSXARP,		"SIOCSXARP",		"xarpreq" },
6297c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGXARP,		"SIOCGXARP",		"xarpreq" },
6307c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCDXARP,		"SIOCDXARP",		"xarpreq" },
6317c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFZONE,		"SIOCGLIFZONE",		"lifreq" },
6327c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFZONE,		"SIOCSLIFZONE",		"lifreq" },
6337c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSCTPSOPT,		"SIOCSCTPSOPT",		NULL },
6347c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSCTPGOPT,		"SIOCSCTPGOPT",		NULL },
6357c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSCTPPEELOFF,	"SIOPCSCTPPEELOFF",	"int" },
6367c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFUSESRC,	"SIOCGLIFUSESRC",	"lifreq" },
6377c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFUSESRC,	"SIOCSLIFUSESRC",	"lifreq" },
6387c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFSRCOF,	"SIOCGLIFSRCOF",	"lifsrcof" },
6397c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGMSFILTER,	"SIOCGMSFILTER",    "group_filter" },
6407c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSMSFILTER,	"SIOCSMSFILTER",    "group_filter" },
6417c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIPMSFILTER,	"SIOCGIPMSFILTER",  "ip_msfilter" },
6427c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIPMSFILTER,	"SIOCSIPMSFILTER",  "ip_msfilter" },
6437c478bd9Sstevel@tonic-gate 
6447c478bd9Sstevel@tonic-gate 	/* DES encryption */
6457c478bd9Sstevel@tonic-gate 	{ (uint_t)DESIOCBLOCK,	"DESIOCBLOCK", 	"desparams" },
6467c478bd9Sstevel@tonic-gate 	{ (uint_t)DESIOCQUICK,	"DESIOCQUICK", 	"desparams" },
6477c478bd9Sstevel@tonic-gate 
6487c478bd9Sstevel@tonic-gate 	/* Printing system */
6497c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_IFCAP,	"PRNIOC_GET_IFCAP", 	NULL },
6507c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_SET_IFCAP,	"PRNIOC_SET_IFCAP", 	NULL },
6517c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_IFINFO,	"PRNIOC_GET_IFINFO",
6527c478bd9Sstevel@tonic-gate 	    "prn_interface_info" },
6537c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_STATUS,	"PRNIOC_GET_STATUS", 	NULL },
6547c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_1284_DEVID,	"PRNIOC_GET_1284_DEVID",
6557c478bd9Sstevel@tonic-gate 	    "prn_1284_device_id" },
6567c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_1284_STATUS,
6577c478bd9Sstevel@tonic-gate 	    "PRNIOC_GET_IFCANIOC_GET_1284_STATUS", NULL },
6587c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_TIMEOUTS,	"PRNIOC_GET_TIMEOUTS",
6597c478bd9Sstevel@tonic-gate 	    "prn_timeouts" },
6607c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_SET_TIMEOUTS,	"PRNIOC_SET_TIMEOUTS",
6617c478bd9Sstevel@tonic-gate 	    "prn_timeouts" },
6627c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_RESET,	"PRNIOC_RESET", 	NULL },
6637c478bd9Sstevel@tonic-gate 
6647c478bd9Sstevel@tonic-gate 	/* DTrace */
6657c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_PROVIDER,	"DTRACEIOC_PROVIDER",	NULL },
6667c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_PROBES,	"DTRACEIOC_PROBES",	NULL },
6677c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_BUFSNAP,	"DTRACEIOC_BUFSNAP",	NULL },
6687c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_PROBEMATCH,	"DTRACEIOC_PROBEMATCH",	NULL },
6697c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_ENABLE,	"DTRACEIOC_ENABLE",	NULL },
6707c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_AGGSNAP,	"DTRACEIOC_AGGSNAP",	NULL },
6717c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_EPROBE,	"DTRACEIOC_EPROBE",	NULL },
6727c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_PROBEARG,   "DTRACEIOC_PROBEARG",   NULL },
6737c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_CONF,	"DTRACEIOC_CONF",	NULL },
6747c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_STATUS,	"DTRACEIOC_STATUS",	NULL },
6757c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_GO,		"DTRACEIOC_GO",		NULL },
6767c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_STOP,	"DTRACEIOC_STOP",	NULL },
6777c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_AGGDESC,	"DTRACEIOC_AGGDESC",	NULL },
6787c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_FORMAT,	"DTRACEIOC_FORMAT",	NULL },
6797c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_DOFGET,	"DTRACEIOC_DOFGET",	NULL },
6807c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_REPLICATE,	"DTRACEIOC_REPLICATE",	NULL },
6817c478bd9Sstevel@tonic-gate 
6827c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEHIOC_ADD,	"DTRACEHIOC_ADD",	NULL },
6837c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEHIOC_REMOVE,	"DTRACEHIOC_REMOVE",	NULL },
6847c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEHIOC_ADDDOF,	"DTRACEHIOC_ADDDOF",	NULL },
6857c478bd9Sstevel@tonic-gate 
6867c478bd9Sstevel@tonic-gate 	/* /dev/cryptoadm ioctl() control codes */
6877c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_VERSION,	"CRYPTO_GET_VERSION",	NULL },
6887c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_DEV_LIST,	"CRYPTO_GET_DEV_LIST",	NULL },
6897c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_SOFT_LIST,	"CRYPTO_GET_SOFT_LIST",	NULL },
6907c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_DEV_INFO,	"CRYPTO_GET_DEV_INFO",	NULL },
6917c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_SOFT_INFO,	"CRYPTO_GET_SOFT_INFO",	NULL },
6927c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOAD_DEV_DISABLED,	"CRYPTO_LOAD_DEV_DISABLED",
6937c478bd9Sstevel@tonic-gate 	    NULL },
6947c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOAD_SOFT_DISABLED,	"CRYPTO_LOAD_SOFT_DISABLED",
6957c478bd9Sstevel@tonic-gate 	    NULL },
6967c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_UNLOAD_SOFT_MODULE,	"CRYPTO_UNLOAD_SOFT_MODULE",
6977c478bd9Sstevel@tonic-gate 	    NULL },
6987c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOAD_SOFT_CONFIG,	"CRYPTO_LOAD_SOFT_CONFIG",
6997c478bd9Sstevel@tonic-gate 	    NULL },
7007c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_POOL_CREATE,	"CRYPTO_POOL_CREATE",	NULL },
7017c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_POOL_WAIT,	"CRYPTO_POOL_WAIT",	NULL },
7027c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_POOL_RUN,	"CRYPTO_POOL_RUN",	NULL },
7037c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOAD_DOOR,	"CRYPTO_LOAD_DOOR",	NULL },
7047c478bd9Sstevel@tonic-gate 
7057c478bd9Sstevel@tonic-gate 	/* /dev/crypto ioctl() control codes */
7067c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_FUNCTION_LIST,	"CRYPTO_GET_FUNCTION_LIST",
7077c478bd9Sstevel@tonic-gate 	    NULL },
7087c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_MECHANISM_NUMBER,	"CRYPTO_GET_MECHANISM_NUMBER",
7097c478bd9Sstevel@tonic-gate 	    NULL },
7107c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OPEN_SESSION,	"CRYPTO_OPEN_SESSION",	NULL },
7117c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_CLOSE_SESSION,	"CRYPTO_CLOSE_SESSION",	NULL },
7127c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_CLOSE_ALL_SESSIONS,	"CRYPTO_CLOSE_ALL_SESSIONS",
7137c478bd9Sstevel@tonic-gate 	    NULL },
7147c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOGIN,		"CRYPTO_LOGIN",		NULL },
7157c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOGOUT,	"CRYPTO_LOGOUT",	NULL },
7167c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_ENCRYPT,	"CRYPTO_ENCRYPT",	NULL },
7177c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_ENCRYPT_INIT,	"CRYPTO_ENCRYPT_INIT",	NULL },
7187c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_ENCRYPT_UPDATE,	"CRYPTO_ENCRYPT_UPDATE",
7197c478bd9Sstevel@tonic-gate 	    NULL },
7207c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_ENCRYPT_FINAL,	"CRYPTO_ENCRYPT_FINAL",	NULL },
7217c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT,	"CRYPTO_DECRYPT",	NULL },
7227c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT_INIT,	"CRYPTO_DECRYPT_INIT",	NULL },
7237c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT_UPDATE,	"CRYPTO_DECRYPT_UPDATE",
7247c478bd9Sstevel@tonic-gate 	    NULL },
7257c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT_FINAL,	"CRYPTO_DECRYPT_FINAL",	NULL },
7267c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST,	"CRYPTO_DIGEST",	NULL },
7277c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST_INIT,	"CRYPTO_DIGEST_INIT",	NULL },
7287c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST_UPDATE,	"CRYPTO_DIGEST_UPDATE",	NULL },
7297c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST_KEY,	"CRYPTO_DIGEST_KEY",	NULL },
7307c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST_FINAL,	"CRYPTO_DIGEST_FINAL",	NULL },
7317c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_MAC,		"CRYPTO_MAC",		NULL },
7327c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_MAC_INIT,	"CRYPTO_MAC_INIT",	NULL },
7337c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_MAC_UPDATE,	"CRYPTO_MAC_UPDATE",	NULL },
7347c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_MAC_FINAL,	"CRYPTO_MAC_FINAL",	NULL },
7357c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN,		"CRYPTO_SIGN",		NULL },
7367c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_INIT,	"CRYPTO_SIGN_INIT",	NULL },
7377c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_UPDATE,	"CRYPTO_SIGN_UPDATE",	NULL },
7387c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_FINAL,	"CRYPTO_SIGN_FINAL",	NULL },
7397c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_RECOVER_INIT,	"CRYPTO_SIGN_RECOVER_INIT",
7407c478bd9Sstevel@tonic-gate 	    NULL },
7417c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_RECOVER,	"CRYPTO_SIGN_RECOVER",	NULL },
7427c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY,	"CRYPTO_VERIFY",	NULL },
7437c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY_INIT,	"CRYPTO_VERIFY_INIT",	NULL },
7447c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY_UPDATE,	"CRYPTO_VERIFY_UPDATE",	NULL },
7457c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY_FINAL,	"CRYPTO_VERIFY_FINAL",	NULL },
7467c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY_RECOVER_INIT,	"CRYPTO_VERIFY_RECOVER_INIT",
7477c478bd9Sstevel@tonic-gate 	    NULL },
7487c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY_RECOVER,	"CRYPTO_VERIFY_RECOVER",
7497c478bd9Sstevel@tonic-gate 	    NULL },
7507c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST_ENCRYPT_UPDATE,	"CRYPTO_DIGEST_ENCRYPT_UPDATE",
7517c478bd9Sstevel@tonic-gate 	    NULL },
7527c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT_DIGEST_UPDATE,	"CRYPTO_DECRYPT_DIGEST_UPDATE",
7537c478bd9Sstevel@tonic-gate 	    NULL },
7547c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_ENCRYPT_UPDATE,	"CRYPTO_SIGN_ENCRYPT_UPDATE",
7557c478bd9Sstevel@tonic-gate 	    NULL },
7567c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT_VERIFY_UPDATE,	"CRYPTO_DECRYPT_VERIFY_UPDATE",
7577c478bd9Sstevel@tonic-gate 	    NULL },
7587c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SEED_RANDOM,	"CRYPTO_SEED_RANDOM",	NULL },
7597c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GENERATE_RANDOM,	"CRYPTO_GENERATE_RANDOM",
7607c478bd9Sstevel@tonic-gate 	    NULL },
7617c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_CREATE,	"CRYPTO_OBJECT_CREATE",	NULL },
7627c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_COPY,	"CRYPTO_OBJECT_COPY",	NULL },
7637c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_DESTROY,	"CRYPTO_OBJECT_DESTROY",
7647c478bd9Sstevel@tonic-gate 	    NULL },
7657c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE,
7667c478bd9Sstevel@tonic-gate 	    "CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE",	NULL },
7677c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_GET_SIZE, "CRYPTO_OBJECT_GET_SIZE",	NULL },
7687c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE,
7697c478bd9Sstevel@tonic-gate 	    "CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE",	NULL },
7707c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_FIND_INIT,	"CRYPTO_OBJECT_FIND_INIT",
7717c478bd9Sstevel@tonic-gate 	    NULL },
7727c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_FIND_UPDATE,	"CRYPTO_OBJECT_FIND_UPDATE",
7737c478bd9Sstevel@tonic-gate 	    NULL },
7747c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_FIND_FINAL,	"CRYPTO_OBJECT_FIND_FINAL",
7757c478bd9Sstevel@tonic-gate 	    NULL },
7767c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GENERATE_KEY,	"CRYPTO_GENERATE_KEY",	NULL },
7777c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GENERATE_KEY_PAIR,	"CRYPTO_GENERATE_KEY_PAIR",
7787c478bd9Sstevel@tonic-gate 	    NULL },
7797c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_WRAP_KEY,	"CRYPTO_WRAP_KEY",	NULL },
7807c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_UNWRAP_KEY,	"CRYPTO_UNWRAP_KEY",	NULL },
7817c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DERIVE_KEY,	"CRYPTO_DERIVE_KEY",	NULL },
7827c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_PROVIDER_LIST,	"CRYPTO_GET_PROVIDER_LIST",
7837c478bd9Sstevel@tonic-gate 	    NULL },
7847c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_PROVIDER_INFO,	"CRYPTO_GET_PROVIDER_INFO",
7857c478bd9Sstevel@tonic-gate 	    NULL },
7867c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_PROVIDER_MECHANISMS,
7877c478bd9Sstevel@tonic-gate 	    "CRYPTO_GET_PROVIDER_MECHANISMS",	NULL },
7887c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_PROVIDER_MECHANISM_INFO,
7897c478bd9Sstevel@tonic-gate 	    "CRYPTO_GET_PROVIDER_MECHANISM_INFO",	NULL },
7907c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_INIT_TOKEN,	"CRYPTO_INIT_TOKEN",	NULL },
7917c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_INIT_PIN,	"CRYPTO_INIT_PIN",	NULL },
7927c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SET_PIN,	"CRYPTO_SET_PIN",	NULL },
793034448feSmcpowers 	{ (uint_t)CRYPTO_NOSTORE_GENERATE_KEY,
794034448feSmcpowers 	    "CRYPTO_NOSTORE_GENERATE_KEY",	NULL },
795034448feSmcpowers 	{ (uint_t)CRYPTO_NOSTORE_GENERATE_KEY_PAIR,
796034448feSmcpowers 	    "CRYPTO_NOSTORE_GENERATE_KEY_PAIR",	NULL },
797034448feSmcpowers 	{ (uint_t)CRYPTO_NOSTORE_DERIVE_KEY,
798034448feSmcpowers 	    "CRYPTO_NOSTORE_DERIVE_KEY",	NULL },
7997c478bd9Sstevel@tonic-gate 
8007c478bd9Sstevel@tonic-gate 	/* kbio ioctls */
8017c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCTRANS,		"KIOCTRANS",	NULL },
8027c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGTRANS,		"KIOCGTRANS",	NULL },
8037c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCTRANSABLE,	"KIOCTRANSABLE",	NULL },
8047c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGTRANSABLE,	"KIOCGTRANSABLE",	NULL },
8057c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSETKEY,		"KIOCSETKEY",	NULL },
8067c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGETKEY,		"KIOCGETKEY",	NULL },
8077c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCCMD,		"KIOCCMD",	NULL },
8087c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCTYPE,		"KIOCTYPE",	NULL },
8097c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSDIRECT,		"KIOCSDIRECT",	NULL },
8107c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGDIRECT,		"KIOCGDIRECT",	NULL },
8117c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSKEY,		"KIOCSKEY",	NULL },
8127c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGKEY,		"KIOCGKEY",	NULL },
8137c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSLED,		"KIOCSLED",	NULL },
8147c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGLED,		"KIOCGLED",	NULL },
8157c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSCOMPAT,		"KIOCSCOMPAT",	NULL },
8167c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGCOMPAT,		"KIOCGCOMPAT",	NULL },
8177c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSLAYOUT,		"KIOCSLAYOUT",	NULL },
8187c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCLAYOUT,		"KIOCLAYOUT",	NULL },
8197c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSKABORTEN,	"KIOCSKABORTEN",	NULL },
8207c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGRPTDELAY,	"KIOCGRPTDELAY",	NULL },
8217c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSRPTDELAY,	"KIOCSRPTDELAY",	NULL },
8227c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGRPTRATE,		"KIOCGRPTRATE",	NULL },
8237c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSRPTRATE,		"KIOCSRPTRATE",	NULL },
8248ffc942dSrz201010 	{ (uint_t)KIOCSETFREQ,		"KIOCSETFREQ",	NULL },
825c35aa225Smarx 	{ (uint_t)KIOCMKTONE,		"KIOCMKTONE",	NULL },
8267c478bd9Sstevel@tonic-gate 
8277c478bd9Sstevel@tonic-gate 	/* ptm/pts driver I_STR ioctls */
8287c478bd9Sstevel@tonic-gate 	{ (uint_t)ISPTM,		"ISPTM",		NULL},
8297c478bd9Sstevel@tonic-gate 	{ (uint_t)UNLKPT,		"UNLKPT",		NULL},
8307c478bd9Sstevel@tonic-gate 	{ (uint_t)PTSSTTY,		"PTSSTTY",		NULL},
8317c478bd9Sstevel@tonic-gate 	{ (uint_t)ZONEPT,		"ZONEPT",		NULL},
83249e92448Svikram 	{ (uint_t)OWNERPT,		"OWNERPT",		NULL},
8337c478bd9Sstevel@tonic-gate 
8347c478bd9Sstevel@tonic-gate 	/* aggr link aggregation pseudo driver ioctls */
8357c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_CREATE,		"LAIOC_CREATE",		"laioc_create"},
8367c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_DELETE,		"LAIOC_DELETE",		"laioc_delete"},
8377c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_INFO,		"LAIOC_INFO",		"laioc_info"},
8387c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_ADD,		"LAIOC_ADD",
8397c478bd9Sstevel@tonic-gate 	    "laioc_add_rem"},
8407c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_REMOVE,		"LAIOC_REMOVE",
8417c478bd9Sstevel@tonic-gate 	    "laioc_add_rem"},
8427c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_MODIFY,		"LAIOC_MODIFY",		"laioc_modify"},
8437c478bd9Sstevel@tonic-gate 
844210db224Sericheng 	/* dld data-link ioctls */
845d62bc4baSyz147064 	{ (uint_t)DLDIOC_ATTR,		"DLDIOC_ATTR",		"dld_ioc_attr"},
846d62bc4baSyz147064 	{ (uint_t)DLDIOC_PHYS_ATTR,	"DLDIOC_PHYS_ATTR",
847d62bc4baSyz147064 		"dld_ioc_phys_attr"},
848d62bc4baSyz147064 	{ (uint_t)DLDIOC_VLAN_ATTR,	"DLDIOC_VLAN_ATTR",
849d62bc4baSyz147064 		"dld_ioc_vlan_attr"},
850d62bc4baSyz147064 	{ (uint_t)DLDIOC_CREATE_VLAN,	"DLDIOC_CREATE_VLAN",
851d62bc4baSyz147064 		"dld_ioc_create_vlan"},
852d62bc4baSyz147064 	{ (uint_t)DLDIOC_DELETE_VLAN,	"DLDIOC_DELETE_VLAN",
853d62bc4baSyz147064 		"dld_ioc_delete_vlan"},
854d62bc4baSyz147064 	{ (uint_t)DLDIOC_SETAUTOPUSH,   "DLDIOC_SETAUTOPUSH", "dld_ioc_ap"},
855d62bc4baSyz147064 	{ (uint_t)DLDIOC_GETAUTOPUSH,   "DLDIOC_GETAUTOPUSH", "dld_ioc_ap"},
856d62bc4baSyz147064 	{ (uint_t)DLDIOC_CLRAUTOPUSH,   "DLDIOC_CLRAUTOPUSH", "dld_ioc_ap"},
857d62bc4baSyz147064 	{ (uint_t)DLDIOC_DOORSERVER,   "DLDIOC_DOORSERVER", "dld_ioc_door"},
858d62bc4baSyz147064 	{ (uint_t)DLDIOC_RENAME,   "DLDIOC_RENAME", "dld_ioc_rename"},
859d62bc4baSyz147064 	{ (uint_t)DLDIOC_SETZID,   "DLDIOC_SETZID", "dld_ioc_setzid"},
860d62bc4baSyz147064 	{ (uint_t)DLDIOC_GETZID,   "DLDIOC_GETZID", "dld_ioc_getzid"},
861fa9e4066Sahrens 
862fa9e4066Sahrens 	/* ZFS ioctls */
863fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_POOL_CREATE,		"ZFS_IOC_POOL_CREATE",
864fa9e4066Sahrens 		"zfs_cmd_t" },
865fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_POOL_DESTROY,		"ZFS_IOC_POOL_DESTROY",
866fa9e4066Sahrens 		"zfs_cmd_t" },
867fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_POOL_IMPORT,		"ZFS_IOC_POOL_IMPORT",
868fa9e4066Sahrens 		"zfs_cmd_t" },
869fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_POOL_EXPORT,		"ZFS_IOC_POOL_EXPORT",
870fa9e4066Sahrens 		"zfs_cmd_t" },
871fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_POOL_CONFIGS,		"ZFS_IOC_POOL_CONFIGS",
872fa9e4066Sahrens 		"zfs_cmd_t" },
873fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_POOL_STATS,		"ZFS_IOC_POOL_STATS",
874fa9e4066Sahrens 		"zfs_cmd_t" },
875fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_POOL_TRYIMPORT,	"ZFS_IOC_POOL_TRYIMPORT",
876fa9e4066Sahrens 		"zfs_cmd_t" },
877fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_POOL_SCRUB,		"ZFS_IOC_POOL_SCRUB",
878fa9e4066Sahrens 		"zfs_cmd_t" },
879fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_POOL_FREEZE,		"ZFS_IOC_POOL_FREEZE",
880fa9e4066Sahrens 		"zfs_cmd_t" },
881eaca9bbdSeschrock 	{ (uint_t)ZFS_IOC_POOL_UPGRADE,		"ZFS_IOC_POOL_UPGRADE",
882eaca9bbdSeschrock 		"zfs_cmd_t" },
88306eeb2adSek110237 	{ (uint_t)ZFS_IOC_POOL_GET_HISTORY,	"ZFS_IOC_POOL_GET_HISTORY",
88406eeb2adSek110237 		"zfs_cmd_t" },
885fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_VDEV_ADD,		"ZFS_IOC_VDEV_ADD",
886fa9e4066Sahrens 		"zfs_cmd_t" },
887fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_VDEV_REMOVE,		"ZFS_IOC_VDEV_REMOVE",
888fa9e4066Sahrens 		"zfs_cmd_t" },
8893d7072f8Seschrock 	{ (uint_t)ZFS_IOC_VDEV_SET_STATE,	"ZFS_IOC_VDEV_SET_STATE",
890fa9e4066Sahrens 		"zfs_cmd_t" },
891fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_VDEV_ATTACH,		"ZFS_IOC_VDEV_ATTACH",
892fa9e4066Sahrens 		"zfs_cmd_t" },
893fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_VDEV_DETACH,		"ZFS_IOC_VDEV_DETACH",
894fa9e4066Sahrens 		"zfs_cmd_t" },
895c67d9675Seschrock 	{ (uint_t)ZFS_IOC_VDEV_SETPATH,		"ZFS_IOC_VDEV_SETPATH",
896c67d9675Seschrock 		"zfs_cmd_t" },
897fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_OBJSET_STATS,		"ZFS_IOC_OBJSET_STATS",
898fa9e4066Sahrens 		"zfs_cmd_t" },
899fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_DATASET_LIST_NEXT,	"ZFS_IOC_DATASET_LIST_NEXT",
900fa9e4066Sahrens 		"zfs_cmd_t" },
901fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_SNAPSHOT_LIST_NEXT,	"ZFS_IOC_SNAPSHOT_LIST_NEXT",
902fa9e4066Sahrens 		"zfs_cmd_t" },
903fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_SET_PROP,		"ZFS_IOC_SET_PROP",
904fa9e4066Sahrens 		"zfs_cmd_t" },
905fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_CREATE_MINOR,		"ZFS_IOC_CREATE_MINOR",
906fa9e4066Sahrens 		"zfs_cmd_t" },
907fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_REMOVE_MINOR,		"ZFS_IOC_REMOVE_MINOR",
908fa9e4066Sahrens 		"zfs_cmd_t" },
909fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_CREATE,		"ZFS_IOC_CREATE",
910fa9e4066Sahrens 		"zfs_cmd_t" },
911fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_DESTROY,		"ZFS_IOC_DESTROY",
912fa9e4066Sahrens 		"zfs_cmd_t" },
913fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_ROLLBACK,		"ZFS_IOC_ROLLBACK",
914fa9e4066Sahrens 		"zfs_cmd_t" },
915fa9e4066Sahrens 	{ (uint_t)ZFS_IOC_RENAME,		"ZFS_IOC_RENAME",
916fa9e4066Sahrens 		"zfs_cmd_t" },
9173cb34c60Sahrens 	{ (uint_t)ZFS_IOC_RECV,			"ZFS_IOC_RECV",
918fa9e4066Sahrens 		"zfs_cmd_t" },
9193cb34c60Sahrens 	{ (uint_t)ZFS_IOC_SEND,			"ZFS_IOC_SEND",
920fa9e4066Sahrens 		"zfs_cmd_t" },
921ea8dc4b6Seschrock 	{ (uint_t)ZFS_IOC_INJECT_FAULT,		"ZFS_IOC_INJECT_FAULT",
922ea8dc4b6Seschrock 		"zfs_cmd_t" },
923ea8dc4b6Seschrock 	{ (uint_t)ZFS_IOC_CLEAR_FAULT,		"ZFS_IOC_CLEAR_FAULT",
924ea8dc4b6Seschrock 		"zfs_cmd_t" },
925ea8dc4b6Seschrock 	{ (uint_t)ZFS_IOC_INJECT_LIST_NEXT,	"ZFS_IOC_INJECT_LIST_NEXT",
926ea8dc4b6Seschrock 		"zfs_cmd_t" },
927ea8dc4b6Seschrock 	{ (uint_t)ZFS_IOC_ERROR_LOG,		"ZFS_IOC_ERROR_LOG",
928ea8dc4b6Seschrock 		"zfs_cmd_t" },
929ea8dc4b6Seschrock 	{ (uint_t)ZFS_IOC_CLEAR,		"ZFS_IOC_CLEAR",
930ea8dc4b6Seschrock 		"zfs_cmd_t" },
93199653d4eSeschrock 	{ (uint_t)ZFS_IOC_PROMOTE,		"ZFS_IOC_PROMOTE",
93299653d4eSeschrock 		"zfs_cmd_t" },
9331d452cf5Sahrens 	{ (uint_t)ZFS_IOC_DESTROY_SNAPS,	"ZFS_IOC_DESTROY_SNAPS",
9341d452cf5Sahrens 		"zfs_cmd_t" },
9351d452cf5Sahrens 	{ (uint_t)ZFS_IOC_SNAPSHOT,		"ZFS_IOC_SNAPSHOT",
9361d452cf5Sahrens 		"zfs_cmd_t" },
93755434c77Sek110237 	{ (uint_t)ZFS_IOC_DSOBJ_TO_DSNAME,	"ZFS_IOC_DSOBJ_TO_DSNAME",
93855434c77Sek110237 		"zfs_cmd_t" },
93955434c77Sek110237 	{ (uint_t)ZFS_IOC_OBJ_TO_PATH,		"ZFS_IOC_OBJ_TO_PATH",
94055434c77Sek110237 		"zfs_cmd_t" },
941b1b8ab34Slling 	{ (uint_t)ZFS_IOC_POOL_SET_PROPS,	"ZFS_IOC_POOL_SET_PROPS",
942b1b8ab34Slling 		"zfs_cmd_t" },
943b1b8ab34Slling 	{ (uint_t)ZFS_IOC_POOL_GET_PROPS,	"ZFS_IOC_POOL_GET_PROPS",
944b1b8ab34Slling 		"zfs_cmd_t" },
945ecd6cf80Smarks 	{ (uint_t)ZFS_IOC_SET_FSACL,		"ZFS_IOC_SET_FSACL",
946ecd6cf80Smarks 		"zfs_cmd_t" },
947ecd6cf80Smarks 	{ (uint_t)ZFS_IOC_GET_FSACL,		"ZFS_IOC_GET_FSACL",
948ecd6cf80Smarks 		"zfs_cmd_t" },
949ecd6cf80Smarks 	{ (uint_t)ZFS_IOC_ISCSI_PERM_CHECK,	"ZFS_IOC_ISCSI_PERM_CHECK",
950ecd6cf80Smarks 		"zfs_cmd_t" },
951ecd6cf80Smarks 	{ (uint_t)ZFS_IOC_SHARE,		"ZFS_IOC_SHARE",
952ecd6cf80Smarks 		"zfs_cmd_t" },
953e45ce728Sahrens 	{ (uint_t)ZFS_IOC_INHERIT_PROP,		"ZFS_IOC_INHERIT_PROP",
954e45ce728Sahrens 		"zfs_cmd_t" },
955fa9e4066Sahrens 
9565cd9bd63Skrishna 	/* kssl ioctls */
9575cd9bd63Skrishna 	{ (uint_t)KSSL_ADD_ENTRY,		"KSSL_ADD_ENTRY",
9585cd9bd63Skrishna 		"kssl_params_t"},
9595cd9bd63Skrishna 	{ (uint_t)KSSL_DELETE_ENTRY,		"KSSL_DELETE_ENTRY",
9605cd9bd63Skrishna 		"sockaddr_in"},
9615cd9bd63Skrishna 
962*06bbe1e0Sedp 	/* dkio ioctls - (0x04 << 8) */
963*06bbe1e0Sedp 	{ (uint_t)DKIOCGGEOM,		"DKIOCGGEOM",
964*06bbe1e0Sedp 		"struct dk_geom"},
965*06bbe1e0Sedp 	{ (uint_t)DKIOCSGEOM,		"DKIOCSGEOM",
966*06bbe1e0Sedp 		"struct dk_geom"},
967*06bbe1e0Sedp 	{ (uint_t)DKIOCINFO,		"DKIOCINFO",
968*06bbe1e0Sedp 		"struct dk_info"},
969*06bbe1e0Sedp 	{ (uint_t)DKIOCGVTOC,		"DKIOCGVTOC",
970*06bbe1e0Sedp 		"struct vtoc"},
971*06bbe1e0Sedp 	{ (uint_t)DKIOCSVTOC,		"DKIOCSVTOC",
972*06bbe1e0Sedp 		"struct vtoc"},
973*06bbe1e0Sedp 	{ (uint_t)DKIOCADDBAD,		"DKIOCADDBAD",
974*06bbe1e0Sedp 		NULL},
975*06bbe1e0Sedp 	{ (uint_t)DKIOCG_PHYGEOM,	"DKIOCG_PHYGEOM",
976*06bbe1e0Sedp 		"struct dk_geom"},
977*06bbe1e0Sedp 	{ (uint_t)DKIOCG_VIRTGEOM,	"DKIOCG_VIRTGEOM",
978*06bbe1e0Sedp 		"struct dk_geom"},
979*06bbe1e0Sedp 	{ (uint_t)DKIOCGMEDIAINFO,	"DKIOCGMEDIAINFO",
980*06bbe1e0Sedp 		"struct dk_minfo"},
981*06bbe1e0Sedp 
982*06bbe1e0Sedp 	/* dumpadm ioctls - (0xdd << 8) */
983*06bbe1e0Sedp 	{ (uint_t)DIOCGETDEV,	"DIOCGETDEV",
984*06bbe1e0Sedp 		"char *"},
985*06bbe1e0Sedp 
986*06bbe1e0Sedp 	/* mntio ioctls - ('m' << 8) */
987*06bbe1e0Sedp 	{ (uint_t)MNTIOC_GETMNTENT,	"MNTIOC_GETMNTENT",
988*06bbe1e0Sedp 		"struct extmnttab"},
989*06bbe1e0Sedp 
9907c478bd9Sstevel@tonic-gate 	{ (uint_t)0, NULL, NULL	}
9917c478bd9Sstevel@tonic-gate };
9927c478bd9Sstevel@tonic-gate 
9937c478bd9Sstevel@tonic-gate void
9947c478bd9Sstevel@tonic-gate ioctl_ioccom(char *buf, size_t size, uint_t code, int nbytes, int x, int y)
9957c478bd9Sstevel@tonic-gate {
9967c478bd9Sstevel@tonic-gate 	const char *inoutstr;
9977c478bd9Sstevel@tonic-gate 
9987c478bd9Sstevel@tonic-gate 	if (code & IOC_VOID)
9997c478bd9Sstevel@tonic-gate 		inoutstr = "";
10007c478bd9Sstevel@tonic-gate 	else if ((code & IOC_INOUT) == IOC_INOUT)
10017c478bd9Sstevel@tonic-gate 		inoutstr = "WR";
10027c478bd9Sstevel@tonic-gate 	else
10037c478bd9Sstevel@tonic-gate 		inoutstr = code & IOC_IN ? "W" : "R";
10047c478bd9Sstevel@tonic-gate 
10057c478bd9Sstevel@tonic-gate 	if (isascii(x) && isprint(x))
10067c478bd9Sstevel@tonic-gate 		(void) snprintf(buf, size, "_IO%sN('%c', %d, %d)", inoutstr,
10077c478bd9Sstevel@tonic-gate 		    x, y, nbytes);
10087c478bd9Sstevel@tonic-gate 	else
10097c478bd9Sstevel@tonic-gate 		(void) snprintf(buf, size, "_IO%sN(0x%x, %d, %d)", inoutstr,
10107c478bd9Sstevel@tonic-gate 		    x, y, nbytes);
10117c478bd9Sstevel@tonic-gate }
10127c478bd9Sstevel@tonic-gate 
10137c478bd9Sstevel@tonic-gate 
10147c478bd9Sstevel@tonic-gate const char *
10157c478bd9Sstevel@tonic-gate ioctlname(private_t *pri, uint_t code)
10167c478bd9Sstevel@tonic-gate {
10177c478bd9Sstevel@tonic-gate 	const struct ioc *ip;
10187c478bd9Sstevel@tonic-gate 	const char *str = NULL;
10197c478bd9Sstevel@tonic-gate 
10207c478bd9Sstevel@tonic-gate 	for (ip = &ioc[0]; ip->name; ip++) {
10217c478bd9Sstevel@tonic-gate 		if (code == ip->code) {
10227c478bd9Sstevel@tonic-gate 			str = ip->name;
10237c478bd9Sstevel@tonic-gate 			break;
10247c478bd9Sstevel@tonic-gate 		}
10257c478bd9Sstevel@tonic-gate 	}
10267c478bd9Sstevel@tonic-gate 
10277c478bd9Sstevel@tonic-gate 	/*
10287c478bd9Sstevel@tonic-gate 	 * Developers hide ascii ioctl names in the ioctl subcode; for example
10297c478bd9Sstevel@tonic-gate 	 * 0x445210 should be printed 'D'<<16|'R'<<8|10.  We allow for all
10307c478bd9Sstevel@tonic-gate 	 * three high order bytes (called hi, mid and lo) to contain ascii
10317c478bd9Sstevel@tonic-gate 	 * characters.
10327c478bd9Sstevel@tonic-gate 	 */
10337c478bd9Sstevel@tonic-gate 	if (str == NULL) {
10347c478bd9Sstevel@tonic-gate 		int c_hi = code >> 24;
10357c478bd9Sstevel@tonic-gate 		int c_mid = (code >> 16) & 0xff;
10367c478bd9Sstevel@tonic-gate 		int c_mid_nm = (code >> 16);
10377c478bd9Sstevel@tonic-gate 		int c_lo = (code >> 8) & 0xff;
10387c478bd9Sstevel@tonic-gate 		int c_lo_nm = code >> 8;
10397c478bd9Sstevel@tonic-gate 
10407c478bd9Sstevel@tonic-gate 		if (isascii(c_lo) && isprint(c_lo) &&
10417c478bd9Sstevel@tonic-gate 		    isascii(c_mid) && isprint(c_mid) &&
10427c478bd9Sstevel@tonic-gate 		    isascii(c_hi) && isprint(c_hi))
10437c478bd9Sstevel@tonic-gate 			(void) sprintf(pri->code_buf,
10447c478bd9Sstevel@tonic-gate 			    "(('%c'<<24)|('%c'<<16)|('%c'<<8)|%d)",
10457c478bd9Sstevel@tonic-gate 			    c_hi, c_mid, c_lo, code & 0xff);
10467c478bd9Sstevel@tonic-gate 		else if (isascii(c_lo) && isprint(c_lo) &&
10477c478bd9Sstevel@tonic-gate 		    isascii(c_mid_nm) && isprint(c_mid_nm))
10487c478bd9Sstevel@tonic-gate 			(void) sprintf(pri->code_buf,
10497c478bd9Sstevel@tonic-gate 			    "(('%c'<<16)|('%c'<<8)|%d)", c_mid, c_lo,
10507c478bd9Sstevel@tonic-gate 			    code & 0xff);
10517c478bd9Sstevel@tonic-gate 		else if (isascii(c_lo_nm) && isprint(c_lo_nm))
10527c478bd9Sstevel@tonic-gate 			(void) sprintf(pri->code_buf, "(('%c'<<8)|%d)",
10537c478bd9Sstevel@tonic-gate 			    c_lo_nm, code & 0xff);
10547c478bd9Sstevel@tonic-gate 		else if (code & (IOC_VOID|IOC_INOUT))
10557c478bd9Sstevel@tonic-gate 			ioctl_ioccom(pri->code_buf, sizeof (pri->code_buf),
10567c478bd9Sstevel@tonic-gate 			    code, c_mid, c_lo, code & 0xff);
10577c478bd9Sstevel@tonic-gate 		else
10587c478bd9Sstevel@tonic-gate 			(void) sprintf(pri->code_buf, "0x%.4X", code);
10597c478bd9Sstevel@tonic-gate 		str = (const char *)pri->code_buf;
10607c478bd9Sstevel@tonic-gate 	}
10617c478bd9Sstevel@tonic-gate 
10627c478bd9Sstevel@tonic-gate 	return (str);
10637c478bd9Sstevel@tonic-gate }
10647c478bd9Sstevel@tonic-gate 
10657c478bd9Sstevel@tonic-gate 
10667c478bd9Sstevel@tonic-gate const char *
10677c478bd9Sstevel@tonic-gate ioctldatastruct(uint_t code)
10687c478bd9Sstevel@tonic-gate {
10697c478bd9Sstevel@tonic-gate 	const struct ioc *ip;
10707c478bd9Sstevel@tonic-gate 	const char *str = NULL;
10717c478bd9Sstevel@tonic-gate 
10727c478bd9Sstevel@tonic-gate 	for (ip = &ioc[0]; ip->name != NULL; ip++) {
10737c478bd9Sstevel@tonic-gate 		if (code == ip->code) {
10747c478bd9Sstevel@tonic-gate 			str = ip->datastruct;
10757c478bd9Sstevel@tonic-gate 			break;
10767c478bd9Sstevel@tonic-gate 		}
10777c478bd9Sstevel@tonic-gate 	}
10787c478bd9Sstevel@tonic-gate 	return (str);
10797c478bd9Sstevel@tonic-gate }
10807c478bd9Sstevel@tonic-gate 
10817c478bd9Sstevel@tonic-gate 
10827c478bd9Sstevel@tonic-gate const char *
10837c478bd9Sstevel@tonic-gate fcntlname(int code)
10847c478bd9Sstevel@tonic-gate {
10857c478bd9Sstevel@tonic-gate 	const char *str = NULL;
10867c478bd9Sstevel@tonic-gate 
10877c478bd9Sstevel@tonic-gate 	if (code >= FCNTLMIN && code <= FCNTLMAX)
10887c478bd9Sstevel@tonic-gate 		str = FCNTLname[code-FCNTLMIN];
10897c478bd9Sstevel@tonic-gate 	return (str);
10907c478bd9Sstevel@tonic-gate }
10917c478bd9Sstevel@tonic-gate 
10927c478bd9Sstevel@tonic-gate const char *
10937c478bd9Sstevel@tonic-gate sfsname(int code)
10947c478bd9Sstevel@tonic-gate {
10957c478bd9Sstevel@tonic-gate 	const char *str = NULL;
10967c478bd9Sstevel@tonic-gate 
10977c478bd9Sstevel@tonic-gate 	if (code >= SYSFSMIN && code <= SYSFSMAX)
10987c478bd9Sstevel@tonic-gate 		str = SYSFSname[code-SYSFSMIN];
10997c478bd9Sstevel@tonic-gate 	return (str);
11007c478bd9Sstevel@tonic-gate }
11017c478bd9Sstevel@tonic-gate 
11027c478bd9Sstevel@tonic-gate const char *
11037c478bd9Sstevel@tonic-gate plockname(int code)
11047c478bd9Sstevel@tonic-gate {
11057c478bd9Sstevel@tonic-gate 	const char *str = NULL;
11067c478bd9Sstevel@tonic-gate 
11077c478bd9Sstevel@tonic-gate 	if (code >= PLOCKMIN && code <= PLOCKMAX)
11087c478bd9Sstevel@tonic-gate 		str = PLOCKname[code-PLOCKMIN];
11097c478bd9Sstevel@tonic-gate 	return (str);
11107c478bd9Sstevel@tonic-gate }
11117c478bd9Sstevel@tonic-gate 
11127c478bd9Sstevel@tonic-gate /* ARGSUSED */
11137c478bd9Sstevel@tonic-gate const char *
11147c478bd9Sstevel@tonic-gate si86name(int code)
11157c478bd9Sstevel@tonic-gate {
11167c478bd9Sstevel@tonic-gate 	const char *str = NULL;
11177c478bd9Sstevel@tonic-gate 
11187c478bd9Sstevel@tonic-gate #if defined(__i386) || defined(__amd64)
11197c478bd9Sstevel@tonic-gate 	switch (code) {
11207c478bd9Sstevel@tonic-gate 	case SI86SWPI:		str = "SI86SWPI";	break;
11217c478bd9Sstevel@tonic-gate 	case SI86SYM:		str = "SI86SYM";	break;
11227c478bd9Sstevel@tonic-gate 	case SI86CONF:		str = "SI86CONF";	break;
11237c478bd9Sstevel@tonic-gate 	case SI86BOOT:		str = "SI86BOOT";	break;
11247c478bd9Sstevel@tonic-gate 	case SI86AUTO:		str = "SI86AUTO";	break;
11257c478bd9Sstevel@tonic-gate 	case SI86EDT:		str = "SI86EDT";	break;
11267c478bd9Sstevel@tonic-gate 	case SI86SWAP:		str = "SI86SWAP";	break;
11277c478bd9Sstevel@tonic-gate 	case SI86FPHW:		str = "SI86FPHW";	break;
11287c478bd9Sstevel@tonic-gate 	case SI86FPSTART:	str = "SI86FPSTART";	break;
11297c478bd9Sstevel@tonic-gate 	case GRNON:		str = "GRNON";		break;
11307c478bd9Sstevel@tonic-gate 	case GRNFLASH:		str = "GRNFLASH";	break;
11317c478bd9Sstevel@tonic-gate 	case STIME:		str = "STIME";		break;
11327c478bd9Sstevel@tonic-gate 	case SETNAME:		str = "SETNAME";	break;
11337c478bd9Sstevel@tonic-gate 	case RNVR:		str = "RNVR";		break;
11347c478bd9Sstevel@tonic-gate 	case WNVR:		str = "WNVR";		break;
11357c478bd9Sstevel@tonic-gate 	case RTODC:		str = "RTODC";		break;
11367c478bd9Sstevel@tonic-gate 	case CHKSER:		str = "CHKSER";		break;
11377c478bd9Sstevel@tonic-gate 	case SI86NVPRT:		str = "SI86NVPRT";	break;
11387c478bd9Sstevel@tonic-gate 	case SANUPD:		str = "SANUPD";		break;
11397c478bd9Sstevel@tonic-gate 	case SI86KSTR:		str = "SI86KSTR";	break;
11407c478bd9Sstevel@tonic-gate 	case SI86MEM:		str = "SI86MEM";	break;
11417c478bd9Sstevel@tonic-gate 	case SI86TODEMON:	str = "SI86TODEMON";	break;
11427c478bd9Sstevel@tonic-gate 	case SI86CCDEMON:	str = "SI86CCDEMON";	break;
11437c478bd9Sstevel@tonic-gate 	case SI86CACHE:		str = "SI86CACHE";	break;
11447c478bd9Sstevel@tonic-gate 	case SI86DELMEM:	str = "SI86DELMEM";	break;
11457c478bd9Sstevel@tonic-gate 	case SI86ADDMEM:	str = "SI86ADDMEM";	break;
11467c478bd9Sstevel@tonic-gate /* 71 through 74 reserved for VPIX */
11477c478bd9Sstevel@tonic-gate 	case SI86V86: 		str = "SI86V86";	break;
11487c478bd9Sstevel@tonic-gate 	case SI86SLTIME:	str = "SI86SLTIME";	break;
11497c478bd9Sstevel@tonic-gate 	case SI86DSCR:		str = "SI86DSCR";	break;
11507c478bd9Sstevel@tonic-gate 	case RDUBLK:		str = "RDUBLK";		break;
11517c478bd9Sstevel@tonic-gate /* NFA entry point */
11527c478bd9Sstevel@tonic-gate 	case SI86NFA:		str = "SI86NFA";	break;
11537c478bd9Sstevel@tonic-gate 	case SI86VM86:		str = "SI86VM86";	break;
11547c478bd9Sstevel@tonic-gate 	case SI86VMENABLE:	str = "SI86VMENABLE";	break;
11557c478bd9Sstevel@tonic-gate 	case SI86LIMUSER:	str = "SI86LIMUSER";	break;
11567c478bd9Sstevel@tonic-gate 	case SI86RDID: 		str = "SI86RDID";	break;
11577c478bd9Sstevel@tonic-gate 	case SI86RDBOOT:	str = "SI86RDBOOT";	break;
11587c478bd9Sstevel@tonic-gate /* Merged Product defines */
11597c478bd9Sstevel@tonic-gate 	case SI86SHFIL:		str = "SI86SHFIL";	break;
11607c478bd9Sstevel@tonic-gate 	case SI86PCHRGN:	str = "SI86PCHRGN";	break;
11617c478bd9Sstevel@tonic-gate 	case SI86BADVISE:	str = "SI86BADVISE";	break;
11627c478bd9Sstevel@tonic-gate 	case SI86SHRGN:		str = "SI86SHRGN";	break;
11637c478bd9Sstevel@tonic-gate 	case SI86CHIDT:		str = "SI86CHIDT";	break;
11647c478bd9Sstevel@tonic-gate 	case SI86EMULRDA: 	str = "SI86EMULRDA";	break;
11657c478bd9Sstevel@tonic-gate 	}
11667c478bd9Sstevel@tonic-gate #endif /* __i386 */
11677c478bd9Sstevel@tonic-gate 
11687c478bd9Sstevel@tonic-gate 	return (str);
11697c478bd9Sstevel@tonic-gate }
11707c478bd9Sstevel@tonic-gate 
11717c478bd9Sstevel@tonic-gate const char *
11727c478bd9Sstevel@tonic-gate utscode(int code)
11737c478bd9Sstevel@tonic-gate {
11747c478bd9Sstevel@tonic-gate 	const char *str = NULL;
11757c478bd9Sstevel@tonic-gate 
11767c478bd9Sstevel@tonic-gate 	switch (code) {
11777c478bd9Sstevel@tonic-gate 	case UTS_UNAME:		str = "UNAME";	break;
11787c478bd9Sstevel@tonic-gate 	case UTS_USTAT:		str = "USTAT";	break;
11797c478bd9Sstevel@tonic-gate 	case UTS_FUSERS:	str = "FUSERS";	break;
11807c478bd9Sstevel@tonic-gate 	}
11817c478bd9Sstevel@tonic-gate 
11827c478bd9Sstevel@tonic-gate 	return (str);
11837c478bd9Sstevel@tonic-gate }
11847c478bd9Sstevel@tonic-gate 
11857c478bd9Sstevel@tonic-gate const char *
1186aa4a4f3bSnf202958 rctlsyscode(int code)
1187aa4a4f3bSnf202958 {
1188aa4a4f3bSnf202958 	const char *str = NULL;
1189aa4a4f3bSnf202958 	switch (code) {
1190aa4a4f3bSnf202958 	case 0:		str = "GETRCTL";	break;
1191aa4a4f3bSnf202958 	case 1:		str = "SETRCTL";	break;
1192aa4a4f3bSnf202958 	case 2:		str = "RCTLSYS_LST";	break;
1193aa4a4f3bSnf202958 	case 3:		str = "RCTLSYS_CTL";	break;
1194532877c4Srd117015 	case 4:		str = "RCTLSYS_SETPROJ";	break;
1195aa4a4f3bSnf202958 	default:	str = "UNKNOWN";	break;
1196aa4a4f3bSnf202958 	}
1197aa4a4f3bSnf202958 	return (str);
1198aa4a4f3bSnf202958 }
1199aa4a4f3bSnf202958 
1200aa4a4f3bSnf202958 const char *
1201aa4a4f3bSnf202958 rctl_local_action(private_t *pri, uint_t val)
1202aa4a4f3bSnf202958 {
1203aa4a4f3bSnf202958 	uint_t action = val & (~RCTL_LOCAL_ACTION_MASK);
1204aa4a4f3bSnf202958 
1205aa4a4f3bSnf202958 	char *s = pri->code_buf;
1206aa4a4f3bSnf202958 
1207aa4a4f3bSnf202958 	*s = '\0';
1208aa4a4f3bSnf202958 
1209aa4a4f3bSnf202958 	if (action & RCTL_LOCAL_NOACTION) {
1210aa4a4f3bSnf202958 		action ^= RCTL_LOCAL_NOACTION;
1211aa4a4f3bSnf202958 		(void) strlcat(s, "|RCTL_LOCAL_NOACTION",
1212aa4a4f3bSnf202958 		    sizeof (pri->code_buf));
1213aa4a4f3bSnf202958 	}
1214aa4a4f3bSnf202958 	if (action & RCTL_LOCAL_SIGNAL) {
1215aa4a4f3bSnf202958 		action ^= RCTL_LOCAL_SIGNAL;
1216aa4a4f3bSnf202958 		(void) strlcat(s, "|RCTL_LOCAL_SIGNAL",
1217aa4a4f3bSnf202958 		    sizeof (pri->code_buf));
1218aa4a4f3bSnf202958 	}
1219aa4a4f3bSnf202958 	if (action & RCTL_LOCAL_DENY) {
1220aa4a4f3bSnf202958 		action ^= RCTL_LOCAL_DENY;
1221aa4a4f3bSnf202958 		(void) strlcat(s, "|RCTL_LOCAL_DENY",
1222aa4a4f3bSnf202958 		    sizeof (pri->code_buf));
1223aa4a4f3bSnf202958 	}
1224aa4a4f3bSnf202958 
1225aa4a4f3bSnf202958 	if ((action & (~RCTL_LOCAL_ACTION_MASK)) != 0)
1226aa4a4f3bSnf202958 		return (NULL);
1227aa4a4f3bSnf202958 	else if (*s != '\0')
1228aa4a4f3bSnf202958 		return (s+1);
1229aa4a4f3bSnf202958 	else
1230aa4a4f3bSnf202958 		return (NULL);
1231aa4a4f3bSnf202958 }
1232aa4a4f3bSnf202958 
1233aa4a4f3bSnf202958 
1234aa4a4f3bSnf202958 const char *
1235aa4a4f3bSnf202958 rctl_local_flags(private_t *pri, uint_t val)
1236aa4a4f3bSnf202958 {
1237aa4a4f3bSnf202958 	uint_t pval = val & RCTL_LOCAL_ACTION_MASK;
1238aa4a4f3bSnf202958 	char *s = pri->code_buf;
1239aa4a4f3bSnf202958 
1240aa4a4f3bSnf202958 	*s = '\0';
1241aa4a4f3bSnf202958 
1242aa4a4f3bSnf202958 	if (pval & RCTL_LOCAL_MAXIMAL) {
1243aa4a4f3bSnf202958 		pval ^= RCTL_LOCAL_MAXIMAL;
1244aa4a4f3bSnf202958 		(void) strlcat(s, "|RCTL_LOCAL_MAXIMAL",
1245aa4a4f3bSnf202958 		    sizeof (pri->code_buf));
1246aa4a4f3bSnf202958 	}
1247aa4a4f3bSnf202958 
1248aa4a4f3bSnf202958 	if ((pval & RCTL_LOCAL_ACTION_MASK) != 0)
1249aa4a4f3bSnf202958 		return (NULL);
1250aa4a4f3bSnf202958 	else if (*s != '\0')
1251aa4a4f3bSnf202958 		return (s+1);
1252aa4a4f3bSnf202958 	else
1253aa4a4f3bSnf202958 		return (NULL);
1254aa4a4f3bSnf202958 }
1255aa4a4f3bSnf202958 
1256aa4a4f3bSnf202958 
1257aa4a4f3bSnf202958 const char *
12587c478bd9Sstevel@tonic-gate sconfname(int code)
12597c478bd9Sstevel@tonic-gate {
12607c478bd9Sstevel@tonic-gate 	const char *str = NULL;
12617c478bd9Sstevel@tonic-gate 
12627c478bd9Sstevel@tonic-gate 	if (code >= SCONFMIN && code <= SCONFMAX)
12637c478bd9Sstevel@tonic-gate 		str = SCONFname[code-SCONFMIN];
12647c478bd9Sstevel@tonic-gate 	return (str);
12657c478bd9Sstevel@tonic-gate }
12667c478bd9Sstevel@tonic-gate 
12677c478bd9Sstevel@tonic-gate const char *
12687c478bd9Sstevel@tonic-gate pathconfname(int code)
12697c478bd9Sstevel@tonic-gate {
12707c478bd9Sstevel@tonic-gate 	const char *str = NULL;
12717c478bd9Sstevel@tonic-gate 
12727c478bd9Sstevel@tonic-gate 	if (code >= PATHCONFMIN && code <= PATHCONFMAX)
12737c478bd9Sstevel@tonic-gate 		str = PATHCONFname[code-PATHCONFMIN];
12747c478bd9Sstevel@tonic-gate 	return (str);
12757c478bd9Sstevel@tonic-gate }
12767c478bd9Sstevel@tonic-gate 
12777c478bd9Sstevel@tonic-gate const char *
12787c478bd9Sstevel@tonic-gate sigarg(private_t *pri, int arg)
12797c478bd9Sstevel@tonic-gate {
12807c478bd9Sstevel@tonic-gate 	char *str = NULL;
12817c478bd9Sstevel@tonic-gate 	int sig = (arg & SIGNO_MASK);
12827c478bd9Sstevel@tonic-gate 
12837c478bd9Sstevel@tonic-gate 	str = pri->code_buf;
12847c478bd9Sstevel@tonic-gate 	arg &= ~SIGNO_MASK;
12857c478bd9Sstevel@tonic-gate 	if (arg & ~(SIGDEFER|SIGHOLD|SIGRELSE|SIGIGNORE|SIGPAUSE))
12867c478bd9Sstevel@tonic-gate 		(void) snprintf(pri->code_buf, sizeof (pri->code_buf),
12877c478bd9Sstevel@tonic-gate 		    "%s|0x%X", signame(pri, sig), arg);
12887c478bd9Sstevel@tonic-gate 	else {
12897c478bd9Sstevel@tonic-gate 		(void) strcpy(str, signame(pri, sig));
12907c478bd9Sstevel@tonic-gate 		if (arg & SIGDEFER)
12917c478bd9Sstevel@tonic-gate 			(void) strcat(str, "|SIGDEFER");
12927c478bd9Sstevel@tonic-gate 		if (arg & SIGHOLD)
12937c478bd9Sstevel@tonic-gate 			(void) strcat(str, "|SIGHOLD");
12947c478bd9Sstevel@tonic-gate 		if (arg & SIGRELSE)
12957c478bd9Sstevel@tonic-gate 			(void) strcat(str, "|SIGRELSE");
12967c478bd9Sstevel@tonic-gate 		if (arg & SIGIGNORE)
12977c478bd9Sstevel@tonic-gate 			(void) strcat(str, "|SIGIGNORE");
12987c478bd9Sstevel@tonic-gate 		if (arg & SIGPAUSE)
12997c478bd9Sstevel@tonic-gate 			(void) strcat(str, "|SIGPAUSE");
13007c478bd9Sstevel@tonic-gate 	}
13017c478bd9Sstevel@tonic-gate 
13027c478bd9Sstevel@tonic-gate 	return ((const char *)str);
13037c478bd9Sstevel@tonic-gate }
13047c478bd9Sstevel@tonic-gate 
13057c478bd9Sstevel@tonic-gate #define	ALL_O_FLAGS \
13067c478bd9Sstevel@tonic-gate 	(O_NDELAY|O_APPEND|O_SYNC|O_DSYNC|O_NONBLOCK|O_CREAT|O_TRUNC\
13077c478bd9Sstevel@tonic-gate 	|O_EXCL|O_NOCTTY|O_LARGEFILE|O_RSYNC|O_XATTR|O_NOFOLLOW|O_NOLINKS)
13087c478bd9Sstevel@tonic-gate 
13097c478bd9Sstevel@tonic-gate const char *
13107c478bd9Sstevel@tonic-gate openarg(private_t *pri, int arg)
13117c478bd9Sstevel@tonic-gate {
13127c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
13137c478bd9Sstevel@tonic-gate 
13147c478bd9Sstevel@tonic-gate 	switch (arg & ~ALL_O_FLAGS) {
13157c478bd9Sstevel@tonic-gate 	default:
13167c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
13177c478bd9Sstevel@tonic-gate 	case O_RDONLY:
13187c478bd9Sstevel@tonic-gate 		(void) strcpy(str, "O_RDONLY");
13197c478bd9Sstevel@tonic-gate 		break;
13207c478bd9Sstevel@tonic-gate 	case O_WRONLY:
13217c478bd9Sstevel@tonic-gate 		(void) strcpy(str, "O_WRONLY");
13227c478bd9Sstevel@tonic-gate 		break;
13237c478bd9Sstevel@tonic-gate 	case O_RDWR:
13247c478bd9Sstevel@tonic-gate 		(void) strcpy(str, "O_RDWR");
13257c478bd9Sstevel@tonic-gate 		break;
13267c478bd9Sstevel@tonic-gate 	}
13277c478bd9Sstevel@tonic-gate 
13287c478bd9Sstevel@tonic-gate 	if (arg & O_NDELAY)
13297c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_NDELAY", sizeof (pri->code_buf));
13307c478bd9Sstevel@tonic-gate 	if (arg & O_APPEND)
13317c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_APPEND", sizeof (pri->code_buf));
13327c478bd9Sstevel@tonic-gate 	if (arg & O_SYNC)
13337c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_SYNC", sizeof (pri->code_buf));
13347c478bd9Sstevel@tonic-gate 	if (arg & O_DSYNC)
13357c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_DSYNC", sizeof (pri->code_buf));
13367c478bd9Sstevel@tonic-gate 	if (arg & O_NONBLOCK)
13377c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_NONBLOCK", sizeof (pri->code_buf));
13387c478bd9Sstevel@tonic-gate 	if (arg & O_CREAT)
13397c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_CREAT", sizeof (pri->code_buf));
13407c478bd9Sstevel@tonic-gate 	if (arg & O_TRUNC)
13417c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_TRUNC", sizeof (pri->code_buf));
13427c478bd9Sstevel@tonic-gate 	if (arg & O_EXCL)
13437c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_EXCL", sizeof (pri->code_buf));
13447c478bd9Sstevel@tonic-gate 	if (arg & O_NOCTTY)
13457c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_NOCTTY", sizeof (pri->code_buf));
13467c478bd9Sstevel@tonic-gate 	if (arg & O_LARGEFILE)
13477c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_LARGEFILE", sizeof (pri->code_buf));
13487c478bd9Sstevel@tonic-gate 	if (arg & O_RSYNC)
13497c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_RSYNC", sizeof (pri->code_buf));
13507c478bd9Sstevel@tonic-gate 	if (arg & O_XATTR)
13517c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_XATTR", sizeof (pri->code_buf));
13527c478bd9Sstevel@tonic-gate 	if (arg & O_NOFOLLOW)
13537c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_NOFOLLOW", sizeof (pri->code_buf));
13547c478bd9Sstevel@tonic-gate 	if (arg & O_NOLINKS)
13557c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_NOLINKS", sizeof (pri->code_buf));
13567c478bd9Sstevel@tonic-gate 
13577c478bd9Sstevel@tonic-gate 	return ((const char *)str);
13587c478bd9Sstevel@tonic-gate }
13597c478bd9Sstevel@tonic-gate 
13607c478bd9Sstevel@tonic-gate const char *
13617c478bd9Sstevel@tonic-gate whencearg(int arg)
13627c478bd9Sstevel@tonic-gate {
13637c478bd9Sstevel@tonic-gate 	const char *str = NULL;
13647c478bd9Sstevel@tonic-gate 
13657c478bd9Sstevel@tonic-gate 	switch (arg) {
13667c478bd9Sstevel@tonic-gate 	case SEEK_SET:	str = "SEEK_SET";	break;
13677c478bd9Sstevel@tonic-gate 	case SEEK_CUR:	str = "SEEK_CUR";	break;
13687c478bd9Sstevel@tonic-gate 	case SEEK_END:	str = "SEEK_END";	break;
13697c478bd9Sstevel@tonic-gate 	case SEEK_DATA:	str = "SEEK_DATA";	break;
13707c478bd9Sstevel@tonic-gate 	case SEEK_HOLE:	str = "SEEK_HOLE";	break;
13717c478bd9Sstevel@tonic-gate 	}
13727c478bd9Sstevel@tonic-gate 
13737c478bd9Sstevel@tonic-gate 	return (str);
13747c478bd9Sstevel@tonic-gate }
13757c478bd9Sstevel@tonic-gate 
13767c478bd9Sstevel@tonic-gate #define	IPC_FLAGS	(IPC_ALLOC|IPC_CREAT|IPC_EXCL|IPC_NOWAIT)
13777c478bd9Sstevel@tonic-gate 
13787c478bd9Sstevel@tonic-gate char *
13797c478bd9Sstevel@tonic-gate ipcflags(private_t *pri, int arg)
13807c478bd9Sstevel@tonic-gate {
13817c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
13827c478bd9Sstevel@tonic-gate 
13837c478bd9Sstevel@tonic-gate 	if (arg & 0777)
13847c478bd9Sstevel@tonic-gate 		(void) sprintf(str, "0%.3o", arg&0777);
13857c478bd9Sstevel@tonic-gate 	else
13867c478bd9Sstevel@tonic-gate 		*str = '\0';
13877c478bd9Sstevel@tonic-gate 
13887c478bd9Sstevel@tonic-gate 	if (arg & IPC_ALLOC)
13897c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|IPC_ALLOC");
13907c478bd9Sstevel@tonic-gate 	if (arg & IPC_CREAT)
13917c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|IPC_CREAT");
13927c478bd9Sstevel@tonic-gate 	if (arg & IPC_EXCL)
13937c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|IPC_EXCL");
13947c478bd9Sstevel@tonic-gate 	if (arg & IPC_NOWAIT)
13957c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|IPC_NOWAIT");
13967c478bd9Sstevel@tonic-gate 
13977c478bd9Sstevel@tonic-gate 	return (str);
13987c478bd9Sstevel@tonic-gate }
13997c478bd9Sstevel@tonic-gate 
14007c478bd9Sstevel@tonic-gate const char *
14017c478bd9Sstevel@tonic-gate msgflags(private_t *pri, int arg)
14027c478bd9Sstevel@tonic-gate {
14037c478bd9Sstevel@tonic-gate 	char *str;
14047c478bd9Sstevel@tonic-gate 
14057c478bd9Sstevel@tonic-gate 	if (arg == 0 || (arg & ~(IPC_FLAGS|MSG_NOERROR|0777)) != 0)
14067c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
14077c478bd9Sstevel@tonic-gate 
14087c478bd9Sstevel@tonic-gate 	str = ipcflags(pri, arg);
14097c478bd9Sstevel@tonic-gate 
14107c478bd9Sstevel@tonic-gate 	if (arg & MSG_NOERROR)
14117c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|MSG_NOERROR");
14127c478bd9Sstevel@tonic-gate 
14137c478bd9Sstevel@tonic-gate 	if (*str == '|')
14147c478bd9Sstevel@tonic-gate 		str++;
14157c478bd9Sstevel@tonic-gate 	return ((const char *)str);
14167c478bd9Sstevel@tonic-gate }
14177c478bd9Sstevel@tonic-gate 
14187c478bd9Sstevel@tonic-gate const char *
14197c478bd9Sstevel@tonic-gate semflags(private_t *pri, int arg)
14207c478bd9Sstevel@tonic-gate {
14217c478bd9Sstevel@tonic-gate 	char *str;
14227c478bd9Sstevel@tonic-gate 
14237c478bd9Sstevel@tonic-gate 	if (arg == 0 || (arg & ~(IPC_FLAGS|SEM_UNDO|0777)) != 0)
14247c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
14257c478bd9Sstevel@tonic-gate 
14267c478bd9Sstevel@tonic-gate 	str = ipcflags(pri, arg);
14277c478bd9Sstevel@tonic-gate 
14287c478bd9Sstevel@tonic-gate 	if (arg & SEM_UNDO)
14297c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|SEM_UNDO");
14307c478bd9Sstevel@tonic-gate 
14317c478bd9Sstevel@tonic-gate 	if (*str == '|')
14327c478bd9Sstevel@tonic-gate 		str++;
14337c478bd9Sstevel@tonic-gate 	return ((const char *)str);
14347c478bd9Sstevel@tonic-gate }
14357c478bd9Sstevel@tonic-gate 
14367c478bd9Sstevel@tonic-gate const char *
14377c478bd9Sstevel@tonic-gate shmflags(private_t *pri, int arg)
14387c478bd9Sstevel@tonic-gate {
14397c478bd9Sstevel@tonic-gate 	char *str;
14407c478bd9Sstevel@tonic-gate 
14417c478bd9Sstevel@tonic-gate 	if (arg == 0 || (arg & ~(IPC_FLAGS|SHM_RDONLY|SHM_RND|0777)) != 0)
14427c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
14437c478bd9Sstevel@tonic-gate 
14447c478bd9Sstevel@tonic-gate 	str = ipcflags(pri, arg);
14457c478bd9Sstevel@tonic-gate 
14467c478bd9Sstevel@tonic-gate 	if (arg & SHM_RDONLY)
14477c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|SHM_RDONLY");
14487c478bd9Sstevel@tonic-gate 	if (arg & SHM_RND)
14497c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|SHM_RND");
14507c478bd9Sstevel@tonic-gate 
14517c478bd9Sstevel@tonic-gate 	if (*str == '|')
14527c478bd9Sstevel@tonic-gate 		str++;
14537c478bd9Sstevel@tonic-gate 	return ((const char *)str);
14547c478bd9Sstevel@tonic-gate }
14557c478bd9Sstevel@tonic-gate 
14567c478bd9Sstevel@tonic-gate #define	MSGCMDMIN	0
14577c478bd9Sstevel@tonic-gate #define	MSGCMDMAX	IPC_STAT64
14587c478bd9Sstevel@tonic-gate const char *const MSGCMDname[MSGCMDMAX+1] = {
14597c478bd9Sstevel@tonic-gate 	NULL, NULL, NULL, NULL, NULL,
14607c478bd9Sstevel@tonic-gate 	NULL, NULL, NULL, NULL, NULL,
14617c478bd9Sstevel@tonic-gate 	"IPC_RMID",	/* 10 */
14627c478bd9Sstevel@tonic-gate 	"IPC_SET",	/* 11 */
14637c478bd9Sstevel@tonic-gate 	"IPC_STAT",	/* 12 */
14647c478bd9Sstevel@tonic-gate 	"IPC_SET64",	/* 13 */
14657c478bd9Sstevel@tonic-gate 	"IPC_STAT64",	/* 14 */
14667c478bd9Sstevel@tonic-gate };
14677c478bd9Sstevel@tonic-gate 
14687c478bd9Sstevel@tonic-gate #define	SEMCMDMIN	0
14697c478bd9Sstevel@tonic-gate #define	SEMCMDMAX	IPC_STAT64
14707c478bd9Sstevel@tonic-gate const char *const SEMCMDname[SEMCMDMAX+1] = {
14717c478bd9Sstevel@tonic-gate 	NULL,		/* 0 */
14727c478bd9Sstevel@tonic-gate 	NULL,		/* 1 */
14737c478bd9Sstevel@tonic-gate 	NULL,		/* 2 */
14747c478bd9Sstevel@tonic-gate 	"GETNCNT",	/* 3 */
14757c478bd9Sstevel@tonic-gate 	"GETPID",	/* 4 */
14767c478bd9Sstevel@tonic-gate 	"GETVAL",	/* 5 */
14777c478bd9Sstevel@tonic-gate 	"GETALL",	/* 6 */
14787c478bd9Sstevel@tonic-gate 	"GETZCNT",	/* 7 */
14797c478bd9Sstevel@tonic-gate 	"SETVAL",	/* 8 */
14807c478bd9Sstevel@tonic-gate 	"SETALL",	/* 9 */
14817c478bd9Sstevel@tonic-gate 	"IPC_RMID",	/* 10 */
14827c478bd9Sstevel@tonic-gate 	"IPC_SET",	/* 11 */
14837c478bd9Sstevel@tonic-gate 	"IPC_STAT",	/* 12 */
14847c478bd9Sstevel@tonic-gate 	"IPC_SET64",	/* 13 */
14857c478bd9Sstevel@tonic-gate 	"IPC_STAT64",	/* 14 */
14867c478bd9Sstevel@tonic-gate };
14877c478bd9Sstevel@tonic-gate 
14887c478bd9Sstevel@tonic-gate #define	SHMCMDMIN	0
14897c478bd9Sstevel@tonic-gate #define	SHMCMDMAX	IPC_STAT64
14907c478bd9Sstevel@tonic-gate const char *const SHMCMDname[SHMCMDMAX+1] = {
14917c478bd9Sstevel@tonic-gate 	NULL,		/* 0 */
14927c478bd9Sstevel@tonic-gate 	NULL,		/* 1 */
14937c478bd9Sstevel@tonic-gate 	NULL,		/* 2 */
14947c478bd9Sstevel@tonic-gate 	"SHM_LOCK",	/* 3 */
14957c478bd9Sstevel@tonic-gate 	"SHM_UNLOCK",	/* 4 */
14967c478bd9Sstevel@tonic-gate 	NULL, NULL, NULL, NULL, NULL,			/* 5 NULLs */
14977c478bd9Sstevel@tonic-gate 	"IPC_RMID",	/* 10 */
14987c478bd9Sstevel@tonic-gate 	"IPC_SET",	/* 11 */
14997c478bd9Sstevel@tonic-gate 	"IPC_STAT",	/* 12 */
15007c478bd9Sstevel@tonic-gate 	"IPC_SET64",	/* 13 */
15017c478bd9Sstevel@tonic-gate 	"IPC_STAT64",	/* 14 */
15027c478bd9Sstevel@tonic-gate };
15037c478bd9Sstevel@tonic-gate 
15047c478bd9Sstevel@tonic-gate const char *
15057c478bd9Sstevel@tonic-gate msgcmd(int arg)
15067c478bd9Sstevel@tonic-gate {
15077c478bd9Sstevel@tonic-gate 	const char *str = NULL;
15087c478bd9Sstevel@tonic-gate 
15097c478bd9Sstevel@tonic-gate 	if (arg >= MSGCMDMIN && arg <= MSGCMDMAX)
15107c478bd9Sstevel@tonic-gate 		str = MSGCMDname[arg-MSGCMDMIN];
15117c478bd9Sstevel@tonic-gate 	return (str);
15127c478bd9Sstevel@tonic-gate }
15137c478bd9Sstevel@tonic-gate 
15147c478bd9Sstevel@tonic-gate const char *
15157c478bd9Sstevel@tonic-gate semcmd(int arg)
15167c478bd9Sstevel@tonic-gate {
15177c478bd9Sstevel@tonic-gate 	const char *str = NULL;
15187c478bd9Sstevel@tonic-gate 
15197c478bd9Sstevel@tonic-gate 	if (arg >= SEMCMDMIN && arg <= SEMCMDMAX)
15207c478bd9Sstevel@tonic-gate 		str = SEMCMDname[arg-SEMCMDMIN];
15217c478bd9Sstevel@tonic-gate 	return (str);
15227c478bd9Sstevel@tonic-gate }
15237c478bd9Sstevel@tonic-gate 
15247c478bd9Sstevel@tonic-gate const char *
15257c478bd9Sstevel@tonic-gate shmcmd(int arg)
15267c478bd9Sstevel@tonic-gate {
15277c478bd9Sstevel@tonic-gate 	const char *str = NULL;
15287c478bd9Sstevel@tonic-gate 
15297c478bd9Sstevel@tonic-gate 	if (arg >= SHMCMDMIN && arg <= SHMCMDMAX)
15307c478bd9Sstevel@tonic-gate 		str = SHMCMDname[arg-SHMCMDMIN];
15317c478bd9Sstevel@tonic-gate 	return (str);
15327c478bd9Sstevel@tonic-gate }
15337c478bd9Sstevel@tonic-gate 
15347c478bd9Sstevel@tonic-gate const char *
15357c478bd9Sstevel@tonic-gate strrdopt(int arg)	/* streams read option (I_SRDOPT I_GRDOPT) */
15367c478bd9Sstevel@tonic-gate {
15377c478bd9Sstevel@tonic-gate 	const char *str = NULL;
15387c478bd9Sstevel@tonic-gate 
15397c478bd9Sstevel@tonic-gate 	switch (arg) {
15407c478bd9Sstevel@tonic-gate 	case RNORM:	str = "RNORM";		break;
15417c478bd9Sstevel@tonic-gate 	case RMSGD:	str = "RMSGD";		break;
15427c478bd9Sstevel@tonic-gate 	case RMSGN:	str = "RMSGN";		break;
15437c478bd9Sstevel@tonic-gate 	}
15447c478bd9Sstevel@tonic-gate 
15457c478bd9Sstevel@tonic-gate 	return (str);
15467c478bd9Sstevel@tonic-gate }
15477c478bd9Sstevel@tonic-gate 
15487c478bd9Sstevel@tonic-gate /* bit map of streams events (I_SETSIG & I_GETSIG) */
15497c478bd9Sstevel@tonic-gate const char *
15507c478bd9Sstevel@tonic-gate strevents(private_t *pri, int arg)
15517c478bd9Sstevel@tonic-gate {
15527c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
15537c478bd9Sstevel@tonic-gate 
15547c478bd9Sstevel@tonic-gate 	if (arg & ~(S_INPUT|S_HIPRI|S_OUTPUT|S_MSG|S_ERROR|S_HANGUP))
15557c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
15567c478bd9Sstevel@tonic-gate 
15577c478bd9Sstevel@tonic-gate 	*str = '\0';
15587c478bd9Sstevel@tonic-gate 	if (arg & S_INPUT)
15597c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_INPUT");
15607c478bd9Sstevel@tonic-gate 	if (arg & S_HIPRI)
15617c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_HIPRI");
15627c478bd9Sstevel@tonic-gate 	if (arg & S_OUTPUT)
15637c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_OUTPUT");
15647c478bd9Sstevel@tonic-gate 	if (arg & S_MSG)
15657c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_MSG");
15667c478bd9Sstevel@tonic-gate 	if (arg & S_ERROR)
15677c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_ERROR");
15687c478bd9Sstevel@tonic-gate 	if (arg & S_HANGUP)
15697c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_HANGUP");
15707c478bd9Sstevel@tonic-gate 
15717c478bd9Sstevel@tonic-gate 	return ((const char *)(str+1));
15727c478bd9Sstevel@tonic-gate }
15737c478bd9Sstevel@tonic-gate 
15747c478bd9Sstevel@tonic-gate const char *
15757c478bd9Sstevel@tonic-gate tiocflush(private_t *pri, int arg)	/* bit map passsed by TIOCFLUSH */
15767c478bd9Sstevel@tonic-gate {
15777c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
15787c478bd9Sstevel@tonic-gate 
15797c478bd9Sstevel@tonic-gate 	if (arg & ~(FREAD|FWRITE))
15807c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
15817c478bd9Sstevel@tonic-gate 
15827c478bd9Sstevel@tonic-gate 	*str = '\0';
15837c478bd9Sstevel@tonic-gate 	if (arg & FREAD)
15847c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|FREAD");
15857c478bd9Sstevel@tonic-gate 	if (arg & FWRITE)
15867c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|FWRITE");
15877c478bd9Sstevel@tonic-gate 
15887c478bd9Sstevel@tonic-gate 	return ((const char *)(str+1));
15897c478bd9Sstevel@tonic-gate }
15907c478bd9Sstevel@tonic-gate 
15917c478bd9Sstevel@tonic-gate const char *
15927c478bd9Sstevel@tonic-gate strflush(int arg)	/* streams flush option (I_FLUSH) */
15937c478bd9Sstevel@tonic-gate {
15947c478bd9Sstevel@tonic-gate 	const char *str = NULL;
15957c478bd9Sstevel@tonic-gate 
15967c478bd9Sstevel@tonic-gate 	switch (arg) {
15977c478bd9Sstevel@tonic-gate 	case FLUSHR:	str = "FLUSHR";		break;
15987c478bd9Sstevel@tonic-gate 	case FLUSHW:	str = "FLUSHW";		break;
15997c478bd9Sstevel@tonic-gate 	case FLUSHRW:	str = "FLUSHRW";	break;
16007c478bd9Sstevel@tonic-gate 	}
16017c478bd9Sstevel@tonic-gate 
16027c478bd9Sstevel@tonic-gate 	return (str);
16037c478bd9Sstevel@tonic-gate }
16047c478bd9Sstevel@tonic-gate 
16057c478bd9Sstevel@tonic-gate #define	ALL_MOUNT_FLAGS	(MS_RDONLY|MS_FSS|MS_DATA|MS_NOSUID|MS_REMOUNT| \
16067c478bd9Sstevel@tonic-gate 	MS_NOTRUNC|MS_OVERLAY|MS_OPTIONSTR|MS_GLOBAL|MS_FORCE|MS_NOMNTTAB)
16077c478bd9Sstevel@tonic-gate 
16087c478bd9Sstevel@tonic-gate const char *
16097c478bd9Sstevel@tonic-gate mountflags(private_t *pri, int arg)	/* bit map of mount syscall flags */
16107c478bd9Sstevel@tonic-gate {
16117c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
16127c478bd9Sstevel@tonic-gate 	size_t used = 0;
16137c478bd9Sstevel@tonic-gate 
16147c478bd9Sstevel@tonic-gate 	if (arg & ~ALL_MOUNT_FLAGS)
16157c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
16167c478bd9Sstevel@tonic-gate 
16177c478bd9Sstevel@tonic-gate 	*str = '\0';
16187c478bd9Sstevel@tonic-gate 	if (arg & MS_RDONLY)
16197c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_RDONLY", sizeof (pri->code_buf));
16207c478bd9Sstevel@tonic-gate 	if (arg & MS_FSS)
16217c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_FSS", sizeof (pri->code_buf));
16227c478bd9Sstevel@tonic-gate 	if (arg & MS_DATA)
16237c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_DATA", sizeof (pri->code_buf));
16247c478bd9Sstevel@tonic-gate 	if (arg & MS_NOSUID)
16257c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_NOSUID", sizeof (pri->code_buf));
16267c478bd9Sstevel@tonic-gate 	if (arg & MS_REMOUNT)
16277c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_REMOUNT", sizeof (pri->code_buf));
16287c478bd9Sstevel@tonic-gate 	if (arg & MS_NOTRUNC)
16297c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_NOTRUNC", sizeof (pri->code_buf));
16307c478bd9Sstevel@tonic-gate 	if (arg & MS_OVERLAY)
16317c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_OVERLAY", sizeof (pri->code_buf));
16327c478bd9Sstevel@tonic-gate 	if (arg & MS_OPTIONSTR)
16337c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_OPTIONSTR", sizeof (pri->code_buf));
16347c478bd9Sstevel@tonic-gate 	if (arg & MS_GLOBAL)
16357c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_GLOBAL", sizeof (pri->code_buf));
16367c478bd9Sstevel@tonic-gate 	if (arg & MS_FORCE)
16377c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_FORCE", sizeof (pri->code_buf));
16387c478bd9Sstevel@tonic-gate 	if (arg & MS_NOMNTTAB)
16397c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_NOMNTTAB", sizeof (pri->code_buf));
16407c478bd9Sstevel@tonic-gate 
16417c478bd9Sstevel@tonic-gate 	if (used == 0 || used >= sizeof (pri->code_buf))
16427c478bd9Sstevel@tonic-gate 		return ((char *)NULL);			/* use prt_hex() */
16437c478bd9Sstevel@tonic-gate 
16447c478bd9Sstevel@tonic-gate 	return ((const char *)(str+1));
16457c478bd9Sstevel@tonic-gate }
16467c478bd9Sstevel@tonic-gate 
16477c478bd9Sstevel@tonic-gate const char *
16487c478bd9Sstevel@tonic-gate svfsflags(private_t *pri, ulong_t arg)	/* bit map of statvfs syscall flags */
16497c478bd9Sstevel@tonic-gate {
16507c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
16517c478bd9Sstevel@tonic-gate 
16527c478bd9Sstevel@tonic-gate 	if (arg & ~(ST_RDONLY|ST_NOSUID|ST_NOTRUNC)) {
16537c478bd9Sstevel@tonic-gate 		(void) sprintf(str, "0x%lx", arg);
16547c478bd9Sstevel@tonic-gate 		return (str);
16557c478bd9Sstevel@tonic-gate 	}
16567c478bd9Sstevel@tonic-gate 	*str = '\0';
16577c478bd9Sstevel@tonic-gate 	if (arg & ST_RDONLY)
16587c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|ST_RDONLY");
16597c478bd9Sstevel@tonic-gate 	if (arg & ST_NOSUID)
16607c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|ST_NOSUID");
16617c478bd9Sstevel@tonic-gate 	if (arg & ST_NOTRUNC)
16627c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|ST_NOTRUNC");
16637c478bd9Sstevel@tonic-gate 	if (*str == '\0')
16647c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|0");
16657c478bd9Sstevel@tonic-gate 	return ((const char *)(str+1));
16667c478bd9Sstevel@tonic-gate }
16677c478bd9Sstevel@tonic-gate 
16687c478bd9Sstevel@tonic-gate const char *
16697c478bd9Sstevel@tonic-gate fuiname(int arg)	/* fusers() input argument */
16707c478bd9Sstevel@tonic-gate {
16717c478bd9Sstevel@tonic-gate 	const char *str = NULL;
16727c478bd9Sstevel@tonic-gate 
16737c478bd9Sstevel@tonic-gate 	switch (arg) {
16747c478bd9Sstevel@tonic-gate 	case F_FILE_ONLY:	str = "F_FILE_ONLY";		break;
16757c478bd9Sstevel@tonic-gate 	case F_CONTAINED:	str = "F_CONTAINED";		break;
16767c478bd9Sstevel@tonic-gate 	}
16777c478bd9Sstevel@tonic-gate 
16787c478bd9Sstevel@tonic-gate 	return (str);
16797c478bd9Sstevel@tonic-gate }
16807c478bd9Sstevel@tonic-gate 
16817c478bd9Sstevel@tonic-gate const char *
16827c478bd9Sstevel@tonic-gate fuflags(private_t *pri, int arg)	/* fusers() output flags */
16837c478bd9Sstevel@tonic-gate {
16847c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
16857c478bd9Sstevel@tonic-gate 
16867c478bd9Sstevel@tonic-gate 	if (arg & ~(F_CDIR|F_RDIR|F_TEXT|F_MAP|F_OPEN|F_TRACE|F_TTY)) {
16877c478bd9Sstevel@tonic-gate 		(void) sprintf(str, "0x%x", arg);
16887c478bd9Sstevel@tonic-gate 		return (str);
16897c478bd9Sstevel@tonic-gate 	}
16907c478bd9Sstevel@tonic-gate 	*str = '\0';
16917c478bd9Sstevel@tonic-gate 	if (arg & F_CDIR)
16927c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_CDIR");
16937c478bd9Sstevel@tonic-gate 	if (arg & F_RDIR)
16947c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_RDIR");
16957c478bd9Sstevel@tonic-gate 	if (arg & F_TEXT)
16967c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_TEXT");
16977c478bd9Sstevel@tonic-gate 	if (arg & F_MAP)
16987c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_MAP");
16997c478bd9Sstevel@tonic-gate 	if (arg & F_OPEN)
17007c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_OPEN");
17017c478bd9Sstevel@tonic-gate 	if (arg & F_TRACE)
17027c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_TRACE");
17037c478bd9Sstevel@tonic-gate 	if (arg & F_TTY)
17047c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_TTY");
17057c478bd9Sstevel@tonic-gate 	if (*str == '\0')
17067c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|0");
17077c478bd9Sstevel@tonic-gate 	return ((const char *)(str+1));
17087c478bd9Sstevel@tonic-gate }
17097c478bd9Sstevel@tonic-gate 
17107c478bd9Sstevel@tonic-gate 
17117c478bd9Sstevel@tonic-gate const char *
17127c478bd9Sstevel@tonic-gate ipprotos(int arg)	/* IP protocols cf. netinet/in.h */
17137c478bd9Sstevel@tonic-gate {
17147c478bd9Sstevel@tonic-gate 	switch (arg) {
17157c478bd9Sstevel@tonic-gate 	case IPPROTO_IP:	return ("IPPROTO_IP");
17167c478bd9Sstevel@tonic-gate 	case IPPROTO_ICMP:	return ("IPPROTO_ICMP");
17177c478bd9Sstevel@tonic-gate 	case IPPROTO_IGMP:	return ("IPPROTO_IGMP");
17187c478bd9Sstevel@tonic-gate 	case IPPROTO_GGP:	return ("IPPROTO_GGP");
17197c478bd9Sstevel@tonic-gate 	case IPPROTO_ENCAP:	return ("IPPROTO_ENCAP");
17207c478bd9Sstevel@tonic-gate 	case IPPROTO_TCP:	return ("IPPROTO_TCP");
17217c478bd9Sstevel@tonic-gate 	case IPPROTO_EGP:	return ("IPPROTO_EGP");
17227c478bd9Sstevel@tonic-gate 	case IPPROTO_PUP:	return ("IPPROTO_PUP");
17237c478bd9Sstevel@tonic-gate 	case IPPROTO_UDP:	return ("IPPROTO_UDP");
17247c478bd9Sstevel@tonic-gate 	case IPPROTO_IDP:	return ("IPPROTO_IDP");
17257c478bd9Sstevel@tonic-gate 	case IPPROTO_IPV6:	return ("IPPROTO_IPV6");
17267c478bd9Sstevel@tonic-gate 	case IPPROTO_ROUTING:	return ("IPPROTO_ROUTING");
17277c478bd9Sstevel@tonic-gate 	case IPPROTO_FRAGMENT:	return ("IPPROTO_FRAGMENT");
17287c478bd9Sstevel@tonic-gate 	case IPPROTO_RSVP:	return ("IPPROTO_RSVP");
17297c478bd9Sstevel@tonic-gate 	case IPPROTO_ESP:	return ("IPPROTO_ESP");
17307c478bd9Sstevel@tonic-gate 	case IPPROTO_AH:	return ("IPPROTO_AH");
17317c478bd9Sstevel@tonic-gate 	case IPPROTO_ICMPV6:	return ("IPPROTO_ICMPV6");
17327c478bd9Sstevel@tonic-gate 	case IPPROTO_NONE:	return ("IPPROTO_NONE");
17337c478bd9Sstevel@tonic-gate 	case IPPROTO_DSTOPTS:	return ("IPPROTO_DSTOPTS");
17347c478bd9Sstevel@tonic-gate 	case IPPROTO_HELLO:	return ("IPPROTO_HELLO");
17357c478bd9Sstevel@tonic-gate 	case IPPROTO_ND:	return ("IPPROTO_ND");
17367c478bd9Sstevel@tonic-gate 	case IPPROTO_EON:	return ("IPPROTO_EON");
17377c478bd9Sstevel@tonic-gate 	case IPPROTO_PIM:	return ("IPPROTO_PIM");
17387c478bd9Sstevel@tonic-gate 	case IPPROTO_SCTP:	return ("IPPROTO_SCTP");
17397c478bd9Sstevel@tonic-gate 	case IPPROTO_RAW:	return ("IPPROTO_RAW");
17407c478bd9Sstevel@tonic-gate 	default:		return (NULL);
17417c478bd9Sstevel@tonic-gate 	}
17427c478bd9Sstevel@tonic-gate }
1743