xref: /titanic_51/usr/src/cmd/truss/codes.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
32*7c478bd9Sstevel@tonic-gate 
33*7c478bd9Sstevel@tonic-gate #include <stdio.h>
34*7c478bd9Sstevel@tonic-gate #include <stdlib.h>
35*7c478bd9Sstevel@tonic-gate #include <unistd.h>
36*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
37*7c478bd9Sstevel@tonic-gate #include <libproc.h>
38*7c478bd9Sstevel@tonic-gate 
39*7c478bd9Sstevel@tonic-gate #include <ctype.h>
40*7c478bd9Sstevel@tonic-gate #include <string.h>
41*7c478bd9Sstevel@tonic-gate #include <sys/dlpi.h>
42*7c478bd9Sstevel@tonic-gate #include <sys/ipc.h>
43*7c478bd9Sstevel@tonic-gate #include <sys/ipc_impl.h>
44*7c478bd9Sstevel@tonic-gate #include <sys/msg.h>
45*7c478bd9Sstevel@tonic-gate #include <sys/sem.h>
46*7c478bd9Sstevel@tonic-gate #include <sys/shm.h>
47*7c478bd9Sstevel@tonic-gate #include <sys/fstyp.h>
48*7c478bd9Sstevel@tonic-gate #if defined(__i386) || defined(__amd64)
49*7c478bd9Sstevel@tonic-gate #include <sys/sysi86.h>
50*7c478bd9Sstevel@tonic-gate #endif /* __i386 */
51*7c478bd9Sstevel@tonic-gate #include <sys/unistd.h>
52*7c478bd9Sstevel@tonic-gate #include <sys/file.h>
53*7c478bd9Sstevel@tonic-gate #include <sys/tiuser.h>
54*7c478bd9Sstevel@tonic-gate #include <sys/timod.h>
55*7c478bd9Sstevel@tonic-gate #include <sys/stream.h>
56*7c478bd9Sstevel@tonic-gate #include <sys/stropts.h>
57*7c478bd9Sstevel@tonic-gate #include <sys/termios.h>
58*7c478bd9Sstevel@tonic-gate #include <sys/termiox.h>
59*7c478bd9Sstevel@tonic-gate #include <sys/jioctl.h>
60*7c478bd9Sstevel@tonic-gate #include <sys/filio.h>
61*7c478bd9Sstevel@tonic-gate #include <fcntl.h>
62*7c478bd9Sstevel@tonic-gate #include <sys/termio.h>
63*7c478bd9Sstevel@tonic-gate #include <sys/stermio.h>
64*7c478bd9Sstevel@tonic-gate #include <sys/ttold.h>
65*7c478bd9Sstevel@tonic-gate #include <sys/lock.h>
66*7c478bd9Sstevel@tonic-gate #include <sys/mount.h>
67*7c478bd9Sstevel@tonic-gate #include <sys/utssys.h>
68*7c478bd9Sstevel@tonic-gate #include <sys/sysconfig.h>
69*7c478bd9Sstevel@tonic-gate #include <sys/statvfs.h>
70*7c478bd9Sstevel@tonic-gate #include <sys/kstat.h>
71*7c478bd9Sstevel@tonic-gate #include <sys/audio.h>
72*7c478bd9Sstevel@tonic-gate #include <sys/mixer.h>
73*7c478bd9Sstevel@tonic-gate #include <sys/vol.h>
74*7c478bd9Sstevel@tonic-gate #include <sys/cpc_impl.h>
75*7c478bd9Sstevel@tonic-gate #include <sys/devpoll.h>
76*7c478bd9Sstevel@tonic-gate #include <sys/strredir.h>
77*7c478bd9Sstevel@tonic-gate #include <sys/sockio.h>
78*7c478bd9Sstevel@tonic-gate #include <netinet/ip_mroute.h>
79*7c478bd9Sstevel@tonic-gate #include <net/if.h>
80*7c478bd9Sstevel@tonic-gate #include <net/if_arp.h>
81*7c478bd9Sstevel@tonic-gate #include <sys/ptyvar.h>
82*7c478bd9Sstevel@tonic-gate #include <sys/des.h>
83*7c478bd9Sstevel@tonic-gate #include <sys/prnio.h>
84*7c478bd9Sstevel@tonic-gate #include <sys/dtrace.h>
85*7c478bd9Sstevel@tonic-gate #include <sys/crypto/ioctladmin.h>
86*7c478bd9Sstevel@tonic-gate #include <sys/crypto/ioctl.h>
87*7c478bd9Sstevel@tonic-gate #include <sys/kbio.h>
88*7c478bd9Sstevel@tonic-gate #include <sys/ptms.h>
89*7c478bd9Sstevel@tonic-gate #include <sys/aggr.h>
90*7c478bd9Sstevel@tonic-gate #include <sys/dld.h>
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate #include "ramdata.h"
93*7c478bd9Sstevel@tonic-gate #include "proto.h"
94*7c478bd9Sstevel@tonic-gate 
95*7c478bd9Sstevel@tonic-gate #define	FCNTLMIN	F_DUPFD
96*7c478bd9Sstevel@tonic-gate #define	FCNTLMAX	44		/* F_SETLK64_NBMAND */
97*7c478bd9Sstevel@tonic-gate const char *const FCNTLname[] = {
98*7c478bd9Sstevel@tonic-gate 	"F_DUPFD",
99*7c478bd9Sstevel@tonic-gate 	"F_GETFD",
100*7c478bd9Sstevel@tonic-gate 	"F_SETFD",
101*7c478bd9Sstevel@tonic-gate 	"F_GETFL",
102*7c478bd9Sstevel@tonic-gate 	"F_SETFL",
103*7c478bd9Sstevel@tonic-gate 	"F_O_GETLK",
104*7c478bd9Sstevel@tonic-gate 	"F_SETLK",
105*7c478bd9Sstevel@tonic-gate 	"F_SETLKW",
106*7c478bd9Sstevel@tonic-gate 	"F_CHKFL",
107*7c478bd9Sstevel@tonic-gate 	"F_DUP2FD",
108*7c478bd9Sstevel@tonic-gate 	"F_ALLOCSP",
109*7c478bd9Sstevel@tonic-gate 	"F_FREESP",
110*7c478bd9Sstevel@tonic-gate 	NULL,		/* 12 */
111*7c478bd9Sstevel@tonic-gate 	NULL,		/* 13 */
112*7c478bd9Sstevel@tonic-gate 	"F_GETLK",
113*7c478bd9Sstevel@tonic-gate 	NULL,		/* 15 */
114*7c478bd9Sstevel@tonic-gate 	NULL,		/* 16 */
115*7c478bd9Sstevel@tonic-gate 	NULL,		/* 17 */
116*7c478bd9Sstevel@tonic-gate 	NULL,		/* 18 */
117*7c478bd9Sstevel@tonic-gate 	NULL,		/* 19 */
118*7c478bd9Sstevel@tonic-gate 	NULL,		/* 20 */
119*7c478bd9Sstevel@tonic-gate 	NULL,		/* 21 */
120*7c478bd9Sstevel@tonic-gate 	NULL,		/* 22 */
121*7c478bd9Sstevel@tonic-gate 	"F_GETOWN",
122*7c478bd9Sstevel@tonic-gate 	"F_SETOWN",
123*7c478bd9Sstevel@tonic-gate 	"F_REVOKE",
124*7c478bd9Sstevel@tonic-gate 	"F_HASREMOTELOCKS",
125*7c478bd9Sstevel@tonic-gate 	"F_FREESP64",
126*7c478bd9Sstevel@tonic-gate 	NULL,		/* 28 */
127*7c478bd9Sstevel@tonic-gate 	NULL,		/* 29 */
128*7c478bd9Sstevel@tonic-gate 	NULL,		/* 30 */
129*7c478bd9Sstevel@tonic-gate 	NULL,		/* 31 */
130*7c478bd9Sstevel@tonic-gate 	NULL,		/* 32 */
131*7c478bd9Sstevel@tonic-gate 	"F_GETLK64",
132*7c478bd9Sstevel@tonic-gate 	"F_SETLK64",
133*7c478bd9Sstevel@tonic-gate 	"F_SETLKW64",
134*7c478bd9Sstevel@tonic-gate 	NULL,		/* 36 */
135*7c478bd9Sstevel@tonic-gate 	NULL,		/* 37 */
136*7c478bd9Sstevel@tonic-gate 	NULL,		/* 38 */
137*7c478bd9Sstevel@tonic-gate 	NULL,		/* 39 */
138*7c478bd9Sstevel@tonic-gate 	"F_SHARE",
139*7c478bd9Sstevel@tonic-gate 	"F_UNSHARE",
140*7c478bd9Sstevel@tonic-gate 	"F_SETLK_NBMAND",
141*7c478bd9Sstevel@tonic-gate 	"F_SHARE_NBMAND",
142*7c478bd9Sstevel@tonic-gate 	"F_SETLK64_NBMAND"
143*7c478bd9Sstevel@tonic-gate };
144*7c478bd9Sstevel@tonic-gate 
145*7c478bd9Sstevel@tonic-gate #define	SYSFSMIN	GETFSIND
146*7c478bd9Sstevel@tonic-gate #define	SYSFSMAX	GETNFSTYP
147*7c478bd9Sstevel@tonic-gate const char *const SYSFSname[] = {
148*7c478bd9Sstevel@tonic-gate 	"GETFSIND",
149*7c478bd9Sstevel@tonic-gate 	"GETFSTYP",
150*7c478bd9Sstevel@tonic-gate 	"GETNFSTYP"
151*7c478bd9Sstevel@tonic-gate };
152*7c478bd9Sstevel@tonic-gate 
153*7c478bd9Sstevel@tonic-gate #define	PLOCKMIN	UNLOCK
154*7c478bd9Sstevel@tonic-gate #define	PLOCKMAX	DATLOCK
155*7c478bd9Sstevel@tonic-gate const char *const PLOCKname[] = {
156*7c478bd9Sstevel@tonic-gate 	"UNLOCK",
157*7c478bd9Sstevel@tonic-gate 	"PROCLOCK",
158*7c478bd9Sstevel@tonic-gate 	"TXTLOCK",
159*7c478bd9Sstevel@tonic-gate 	NULL,
160*7c478bd9Sstevel@tonic-gate 	"DATLOCK"
161*7c478bd9Sstevel@tonic-gate };
162*7c478bd9Sstevel@tonic-gate 
163*7c478bd9Sstevel@tonic-gate #define	SCONFMIN	_CONFIG_NGROUPS
164*7c478bd9Sstevel@tonic-gate #define	SCONFMAX	_CONFIG_CPUID_MAX
165*7c478bd9Sstevel@tonic-gate const char *const SCONFname[] = {
166*7c478bd9Sstevel@tonic-gate 	"_CONFIG_NGROUPS",		/*  2 */
167*7c478bd9Sstevel@tonic-gate 	"_CONFIG_CHILD_MAX",		/*  3 */
168*7c478bd9Sstevel@tonic-gate 	"_CONFIG_OPEN_FILES",		/*  4 */
169*7c478bd9Sstevel@tonic-gate 	"_CONFIG_POSIX_VER",		/*  5 */
170*7c478bd9Sstevel@tonic-gate 	"_CONFIG_PAGESIZE",		/*  6 */
171*7c478bd9Sstevel@tonic-gate 	"_CONFIG_CLK_TCK",		/*  7 */
172*7c478bd9Sstevel@tonic-gate 	"_CONFIG_XOPEN_VER",		/*  8 */
173*7c478bd9Sstevel@tonic-gate 	"_CONFIG_HRESCLK_TCK",		/*  9 */
174*7c478bd9Sstevel@tonic-gate 	"_CONFIG_PROF_TCK",		/* 10 */
175*7c478bd9Sstevel@tonic-gate 	"_CONFIG_NPROC_CONF",		/* 11 */
176*7c478bd9Sstevel@tonic-gate 	"_CONFIG_NPROC_ONLN",		/* 12 */
177*7c478bd9Sstevel@tonic-gate 	"_CONFIG_AIO_LISTIO_MAX",	/* 13 */
178*7c478bd9Sstevel@tonic-gate 	"_CONFIG_AIO_MAX",		/* 14 */
179*7c478bd9Sstevel@tonic-gate 	"_CONFIG_AIO_PRIO_DELTA_MAX",	/* 15 */
180*7c478bd9Sstevel@tonic-gate 	"_CONFIG_DELAYTIMER_MAX",	/* 16 */
181*7c478bd9Sstevel@tonic-gate 	"_CONFIG_MQ_OPEN_MAX",		/* 17 */
182*7c478bd9Sstevel@tonic-gate 	"_CONFIG_MQ_PRIO_MAX",		/* 18 */
183*7c478bd9Sstevel@tonic-gate 	"_CONFIG_RTSIG_MAX",		/* 19 */
184*7c478bd9Sstevel@tonic-gate 	"_CONFIG_SEM_NSEMS_MAX",	/* 20 */
185*7c478bd9Sstevel@tonic-gate 	"_CONFIG_SEM_VALUE_MAX",	/* 21 */
186*7c478bd9Sstevel@tonic-gate 	"_CONFIG_SIGQUEUE_MAX",		/* 22 */
187*7c478bd9Sstevel@tonic-gate 	"_CONFIG_SIGRT_MIN",		/* 23 */
188*7c478bd9Sstevel@tonic-gate 	"_CONFIG_SIGRT_MAX",		/* 24 */
189*7c478bd9Sstevel@tonic-gate 	"_CONFIG_TIMER_MAX",		/* 25 */
190*7c478bd9Sstevel@tonic-gate 	"_CONFIG_PHYS_PAGES",		/* 26 */
191*7c478bd9Sstevel@tonic-gate 	"_CONFIG_AVPHYS_PAGES",		/* 27 */
192*7c478bd9Sstevel@tonic-gate 	"_CONFIG_COHERENCY",		/* 28 */
193*7c478bd9Sstevel@tonic-gate 	"_CONFIG_SPLIT_CACHE",		/* 29 */
194*7c478bd9Sstevel@tonic-gate 	"_CONFIG_ICACHESZ",		/* 30 */
195*7c478bd9Sstevel@tonic-gate 	"_CONFIG_DCACHESZ",		/* 31 */
196*7c478bd9Sstevel@tonic-gate 	"_CONFIG_ICACHELINESZ",		/* 32 */
197*7c478bd9Sstevel@tonic-gate 	"_CONFIG_DCACHELINESZ",		/* 33 */
198*7c478bd9Sstevel@tonic-gate 	"_CONFIG_ICACHEBLKSZ",		/* 34 */
199*7c478bd9Sstevel@tonic-gate 	"_CONFIG_DCACHEBLKSZ",		/* 35 */
200*7c478bd9Sstevel@tonic-gate 	"_CONFIG_DCACHETBLKSZ",		/* 36 */
201*7c478bd9Sstevel@tonic-gate 	"_CONFIG_ICACHE_ASSOC",		/* 37 */
202*7c478bd9Sstevel@tonic-gate 	"_CONFIG_DCACHE_ASSOC",		/* 38 */
203*7c478bd9Sstevel@tonic-gate 	NULL,				/* 39 */
204*7c478bd9Sstevel@tonic-gate 	NULL,				/* 40 */
205*7c478bd9Sstevel@tonic-gate 	NULL,				/* 41 */
206*7c478bd9Sstevel@tonic-gate 	"_CONFIG_MAXPID",		/* 42 */
207*7c478bd9Sstevel@tonic-gate 	"_CONFIG_STACK_PROT",		/* 43 */
208*7c478bd9Sstevel@tonic-gate 	"_CONFIG_NPROC_MAX",		/* 44 */
209*7c478bd9Sstevel@tonic-gate 	"_CONFIG_CPUID_MAX"		/* 45 */
210*7c478bd9Sstevel@tonic-gate };
211*7c478bd9Sstevel@tonic-gate 
212*7c478bd9Sstevel@tonic-gate #define	PATHCONFMIN	_PC_LINK_MAX
213*7c478bd9Sstevel@tonic-gate #define	PATHCONFMAX	_PC_CHOWN_RESTRICTED
214*7c478bd9Sstevel@tonic-gate const char *const PATHCONFname[] = {
215*7c478bd9Sstevel@tonic-gate 	"_PC_LINK_MAX",
216*7c478bd9Sstevel@tonic-gate 	"_PC_MAX_CANON",
217*7c478bd9Sstevel@tonic-gate 	"_PC_MAX_INPUT",
218*7c478bd9Sstevel@tonic-gate 	"_PC_NAME_MAX",
219*7c478bd9Sstevel@tonic-gate 	"_PC_PATH_MAX",
220*7c478bd9Sstevel@tonic-gate 	"_PC_PIPE_BUF",
221*7c478bd9Sstevel@tonic-gate 	"_PC_NO_TRUNC",
222*7c478bd9Sstevel@tonic-gate 	"_PC_VDISABLE",
223*7c478bd9Sstevel@tonic-gate 	"_PC_CHOWN_RESTRICTED"
224*7c478bd9Sstevel@tonic-gate };
225*7c478bd9Sstevel@tonic-gate 
226*7c478bd9Sstevel@tonic-gate const struct ioc {
227*7c478bd9Sstevel@tonic-gate 	uint_t	code;
228*7c478bd9Sstevel@tonic-gate 	const char *name;
229*7c478bd9Sstevel@tonic-gate 	const char *datastruct;
230*7c478bd9Sstevel@tonic-gate } ioc[] = {
231*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCGETA,	"TCGETA",	NULL },
232*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETA,	"TCSETA",	NULL },
233*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETAW,	"TCSETAW",	NULL },
234*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETAF,	"TCSETAF",	NULL },
235*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCFLSH,	"TCFLSH",	NULL },
236*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCKBON,	"TIOCKBON",	NULL },
237*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCKBOF,	"TIOCKBOF",	NULL },
238*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KBENABLED,	"KBENABLED",	NULL },
239*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCGETS,	"TCGETS",	NULL },
240*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETS,	"TCSETS",	NULL },
241*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETSW,	"TCSETSW",	NULL },
242*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETSF,	"TCSETSF",	NULL },
243*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCXONC,	"TCXONC",	NULL },
244*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSBRK,	"TCSBRK",	NULL },
245*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCDSET,	"TCDSET",	NULL },
246*7c478bd9Sstevel@tonic-gate 	{ (uint_t)RTS_TOG,	"RTS_TOG",	NULL },
247*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSWINSZ,	"TIOCSWINSZ",	NULL },
248*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGWINSZ,	"TIOCGWINSZ",	NULL },
249*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGETD,	"TIOCGETD",	NULL },
250*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSETD,	"TIOCSETD",	NULL },
251*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCHPCL,	"TIOCHPCL",	NULL },
252*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGETP,	"TIOCGETP",	NULL },
253*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSETP,	"TIOCSETP",	NULL },
254*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSETN,	"TIOCSETN",	NULL },
255*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCEXCL,	"TIOCEXCL",	NULL },
256*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCNXCL,	"TIOCNXCL",	NULL },
257*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCFLUSH,	"TIOCFLUSH",	NULL },
258*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSETC,	"TIOCSETC",	NULL },
259*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGETC,	"TIOCGETC",	NULL },
260*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGPGRP,	"TIOCGPGRP",	NULL },
261*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSPGRP,	"TIOCSPGRP",	NULL },
262*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGSID,	"TIOCGSID",	NULL },
263*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSTI,	"TIOCSTI",	NULL },
264*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCMSET,	"TIOCMSET",	NULL },
265*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCMBIS,	"TIOCMBIS",	NULL },
266*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCMBIC,	"TIOCMBIC",	NULL },
267*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCMGET,	"TIOCMGET",	NULL },
268*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCREMOTE,	"TIOCREMOTE",	NULL },
269*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSIGNAL,	"TIOCSIGNAL",	NULL },
270*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSTART,	"TIOCSTART",	NULL },
271*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSTOP,	"TIOCSTOP",	NULL },
272*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCNOTTY,	"TIOCNOTTY",	NULL },
273*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCOUTQ,	"TIOCOUTQ",	NULL },
274*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGLTC,	"TIOCGLTC",	NULL },
275*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSLTC,	"TIOCSLTC",	NULL },
276*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCCDTR,	"TIOCCDTR",	NULL },
277*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSDTR,	"TIOCSDTR",	NULL },
278*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCCBRK,	"TIOCCBRK",	NULL },
279*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSBRK,	"TIOCSBRK",	NULL },
280*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCLGET,	"TIOCLGET",	NULL },
281*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCLSET,	"TIOCLSET",	NULL },
282*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCLBIC,	"TIOCLBIC",	NULL },
283*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCLBIS,	"TIOCLBIS",	NULL },
284*7c478bd9Sstevel@tonic-gate 
285*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCPKT,	"TIOCPKT",	NULL },	/* ptyvar.h */
286*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCUCNTL,	"TIOCUCNTL",	NULL },
287*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCTCNTL,	"TIOCTCNTL",	NULL },
288*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCISPACE,	"TIOCISPACE",	NULL },
289*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCISIZE,	"TIOCISIZE",	NULL },
290*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCSSIZE,	"TIOCSSIZE",	"ttysize" },
291*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TIOCGSIZE,	"TIOCGSIZE",	"ttysize" },
292*7c478bd9Sstevel@tonic-gate 
293*7c478bd9Sstevel@tonic-gate 	/*
294*7c478bd9Sstevel@tonic-gate 	 * DLIOCRAW has the same ioctl number as LDCLOSE.  Since the LDIOC
295*7c478bd9Sstevel@tonic-gate 	 * ioctls (for xenix compatibility) are far less likely to be used, we
296*7c478bd9Sstevel@tonic-gate 	 * give preference to DLIOCRAW, which is the only userland ioctl in the
297*7c478bd9Sstevel@tonic-gate 	 * DLIOC family.
298*7c478bd9Sstevel@tonic-gate 	 */
299*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DLIOCRAW,	"DLIOCRAW",	NULL },
300*7c478bd9Sstevel@tonic-gate 
301*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LDOPEN,	"LDOPEN",	NULL },
302*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LDCLOSE,	"LDCLOSE",	NULL },
303*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LDCHG,	"LDCHG",	NULL },
304*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LDGETT,	"LDGETT",	NULL },
305*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LDSETT,	"LDSETT",	NULL },
306*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LDSMAP,	"LDSMAP",	NULL },
307*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LDGMAP,	"LDGMAP",	NULL },
308*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LDNMAP,	"LDNMAP",	NULL },
309*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCGETX,	"TCGETX",	NULL },
310*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETX,	"TCSETX",	NULL },
311*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETXW,	"TCSETXW",	NULL },
312*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TCSETXF,	"TCSETXF",	NULL },
313*7c478bd9Sstevel@tonic-gate 	{ (uint_t)FIORDCHK,	"FIORDCHK",	NULL },
314*7c478bd9Sstevel@tonic-gate 	{ (uint_t)FIOCLEX,	"FIOCLEX",	NULL },
315*7c478bd9Sstevel@tonic-gate 	{ (uint_t)FIONCLEX,	"FIONCLEX",	NULL },
316*7c478bd9Sstevel@tonic-gate 	{ (uint_t)FIONREAD,	"FIONREAD",	NULL },
317*7c478bd9Sstevel@tonic-gate 	{ (uint_t)FIONBIO,	"FIONBIO",	NULL },
318*7c478bd9Sstevel@tonic-gate 	{ (uint_t)FIOASYNC,	"FIOASYNC",	NULL },
319*7c478bd9Sstevel@tonic-gate 	{ (uint_t)FIOSETOWN,	"FIOSETOWN",	NULL },
320*7c478bd9Sstevel@tonic-gate 	{ (uint_t)FIOGETOWN,	"FIOGETOWN",	NULL },
321*7c478bd9Sstevel@tonic-gate #ifdef DIOCGETP
322*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DIOCGETP,	"DIOCGETP",	NULL },
323*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DIOCSETP,	"DIOCSETP",	NULL },
324*7c478bd9Sstevel@tonic-gate #endif
325*7c478bd9Sstevel@tonic-gate #ifdef DIOCGETC
326*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DIOCGETC,	"DIOCGETC",	NULL },
327*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DIOCGETB,	"DIOCGETB",	NULL },
328*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DIOCSETE,	"DIOCSETE",	NULL },
329*7c478bd9Sstevel@tonic-gate #endif
330*7c478bd9Sstevel@tonic-gate #ifdef IFFORMAT
331*7c478bd9Sstevel@tonic-gate 	{ (uint_t)IFFORMAT,	"IFFORMAT",	NULL },
332*7c478bd9Sstevel@tonic-gate 	{ (uint_t)IFBCHECK,	"IFBCHECK",	NULL },
333*7c478bd9Sstevel@tonic-gate 	{ (uint_t)IFCONFIRM,	"IFCONFIRM",	NULL },
334*7c478bd9Sstevel@tonic-gate #endif
335*7c478bd9Sstevel@tonic-gate #ifdef LIOCGETP
336*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LIOCGETP,	"LIOCGETP",	NULL },
337*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LIOCSETP,	"LIOCSETP",	NULL },
338*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LIOCGETS,	"LIOCGETS",	NULL },
339*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LIOCSETS,	"LIOCSETS",	NULL },
340*7c478bd9Sstevel@tonic-gate #endif
341*7c478bd9Sstevel@tonic-gate #ifdef JBOOT
342*7c478bd9Sstevel@tonic-gate 	{ (uint_t)JBOOT,	"JBOOT",	NULL },
343*7c478bd9Sstevel@tonic-gate 	{ (uint_t)JTERM,	"JTERM",	NULL },
344*7c478bd9Sstevel@tonic-gate 	{ (uint_t)JMPX,		"JMPX",	NULL },
345*7c478bd9Sstevel@tonic-gate #ifdef JTIMO
346*7c478bd9Sstevel@tonic-gate 	{ (uint_t)JTIMO,	"JTIMO",	NULL },
347*7c478bd9Sstevel@tonic-gate #endif
348*7c478bd9Sstevel@tonic-gate 	{ (uint_t)JWINSIZE,	"JWINSIZE",	NULL },
349*7c478bd9Sstevel@tonic-gate 	{ (uint_t)JTIMOM,	"JTIMOM",	NULL },
350*7c478bd9Sstevel@tonic-gate 	{ (uint_t)JZOMBOOT,	"JZOMBOOT",	NULL },
351*7c478bd9Sstevel@tonic-gate 	{ (uint_t)JAGENT,	"JAGENT",	NULL },
352*7c478bd9Sstevel@tonic-gate 	{ (uint_t)JTRUN,	"JTRUN",	NULL },
353*7c478bd9Sstevel@tonic-gate 	{ (uint_t)JXTPROTO,	"JXTPROTO",	NULL },
354*7c478bd9Sstevel@tonic-gate #endif
355*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KSTAT_IOC_CHAIN_ID,	"KSTAT_IOC_CHAIN_ID",	NULL },
356*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KSTAT_IOC_READ,	"KSTAT_IOC_READ",	NULL },
357*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KSTAT_IOC_WRITE,	"KSTAT_IOC_WRITE",	NULL },
358*7c478bd9Sstevel@tonic-gate 	{ (uint_t)STGET,	"STGET",	NULL },
359*7c478bd9Sstevel@tonic-gate 	{ (uint_t)STSET,	"STSET",	NULL },
360*7c478bd9Sstevel@tonic-gate 	{ (uint_t)STTHROW,	"STTHROW",	NULL },
361*7c478bd9Sstevel@tonic-gate 	{ (uint_t)STWLINE,	"STWLINE",	NULL },
362*7c478bd9Sstevel@tonic-gate 	{ (uint_t)STTSV,	"STTSV",	NULL },
363*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_NREAD,	"I_NREAD",	NULL },
364*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_PUSH,	"I_PUSH",	NULL },
365*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_POP,	"I_POP",	NULL },
366*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_LOOK,	"I_LOOK",	NULL },
367*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_FLUSH,	"I_FLUSH",	NULL },
368*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_SRDOPT,	"I_SRDOPT",	NULL },
369*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_GRDOPT,	"I_GRDOPT",	NULL },
370*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_STR,	"I_STR",	NULL },
371*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_SETSIG,	"I_SETSIG",	NULL },
372*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_GETSIG,	"I_GETSIG",	NULL },
373*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_FIND,	"I_FIND",	NULL },
374*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_LINK,	"I_LINK",	NULL },
375*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_UNLINK,	"I_UNLINK",	NULL },
376*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_PEEK,	"I_PEEK",	NULL },
377*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_FDINSERT,	"I_FDINSERT",	NULL },
378*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_SENDFD,	"I_SENDFD",	NULL },
379*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_RECVFD,	"I_RECVFD",	NULL },
380*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_SWROPT,	"I_SWROPT",	NULL },
381*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_GWROPT,	"I_GWROPT",	NULL },
382*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_LIST,	"I_LIST",	NULL },
383*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_PLINK,	"I_PLINK",	NULL },
384*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_PUNLINK,	"I_PUNLINK",	NULL },
385*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_FLUSHBAND,	"I_FLUSHBAND",	NULL },
386*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_CKBAND,	"I_CKBAND",	NULL },
387*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_GETBAND,	"I_GETBAND",	NULL },
388*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_ATMARK,	"I_ATMARK",	NULL },
389*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_SETCLTIME,	"I_SETCLTIME",	NULL },
390*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_GETCLTIME,	"I_GETCLTIME",	NULL },
391*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_CANPUT,	"I_CANPUT",	NULL },
392*7c478bd9Sstevel@tonic-gate #ifdef I_ANCHOR
393*7c478bd9Sstevel@tonic-gate 	{ (uint_t)I_ANCHOR,	"I_ANCHOR",	NULL },
394*7c478bd9Sstevel@tonic-gate #endif
395*7c478bd9Sstevel@tonic-gate #ifdef TI_GETINFO
396*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_GETINFO,	"TI_GETINFO",	NULL },
397*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_OPTMGMT,	"TI_OPTMGMT",	NULL },
398*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_BIND,	"TI_BIND",	NULL },
399*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_UNBIND,	"TI_UNBIND",	NULL },
400*7c478bd9Sstevel@tonic-gate #endif
401*7c478bd9Sstevel@tonic-gate #ifdef	TI_CAPABILITY
402*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_CAPABILITY,	"TI_CAPABILITY",	NULL },
403*7c478bd9Sstevel@tonic-gate #endif
404*7c478bd9Sstevel@tonic-gate #ifdef TI_GETMYNAME
405*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_GETMYNAME,		"TI_GETMYNAME",		NULL },
406*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_GETPEERNAME,	"TI_GETPEERNAME",	NULL },
407*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_SETMYNAME,		"TI_SETMYNAME",		NULL },
408*7c478bd9Sstevel@tonic-gate 	{ (uint_t)TI_SETPEERNAME,	"TI_SETPEERNAME",	NULL },
409*7c478bd9Sstevel@tonic-gate #endif
410*7c478bd9Sstevel@tonic-gate #ifdef V_PREAD
411*7c478bd9Sstevel@tonic-gate 	{ (uint_t)V_PREAD,	"V_PREAD",	NULL },
412*7c478bd9Sstevel@tonic-gate 	{ (uint_t)V_PWRITE,	"V_PWRITE",	NULL },
413*7c478bd9Sstevel@tonic-gate 	{ (uint_t)V_PDREAD,	"V_PDREAD",	NULL },
414*7c478bd9Sstevel@tonic-gate 	{ (uint_t)V_PDWRITE,	"V_PDWRITE",	NULL },
415*7c478bd9Sstevel@tonic-gate #if !defined(__i386) && !defined(__amd64)
416*7c478bd9Sstevel@tonic-gate 	{ (uint_t)V_GETSSZ,	"V_GETSSZ",	NULL },
417*7c478bd9Sstevel@tonic-gate #endif /* !__i386 */
418*7c478bd9Sstevel@tonic-gate #endif
419*7c478bd9Sstevel@tonic-gate 	/* audio */
420*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GETINFO,	"AUDIO_GETINFO",	NULL },
421*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_SETINFO,	"AUDIO_SETINFO",	NULL },
422*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_DRAIN,		"AUDIO_DRAIN",		NULL },
423*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GETDEV,		"AUDIO_GETDEV",		NULL },
424*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_DIAG_LOOPBACK,	"AUDIO_DIAG_LOOPBACK",	NULL },
425*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_CH_NUMBER,	"AUDIO_GET_CH_NUMBER",	NULL },
426*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_CH_TYPE,	"AUDIO_GET_CH_TYPE",	NULL },
427*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_NUM_CHS,	"AUDIO_GET_NUM_CHS",	NULL },
428*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_AD_DEV,	"AUDIO_GET_AD_DEV",	NULL },
429*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_APM_DEV,	"AUDIO_GET_APM_DEV",	NULL },
430*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_GET_AS_DEV,	"AUDIO_GET_AS_DEV",	NULL },
431*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXER_MULTIPLE_OPEN,	"AUDIO_MIXER_MULTIPLE_OPEN",
432*7c478bd9Sstevel@tonic-gate 	    NULL },
433*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXER_SINGLE_OPEN,	"AUDIO_MIXER_SINGLE_OPEN",
434*7c478bd9Sstevel@tonic-gate 	    NULL },
435*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXER_GET_SAMPLE_RATES,	"AUDIO_MIXER_GET_SAMPLE_RATES",
436*7c478bd9Sstevel@tonic-gate 	    NULL },
437*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_GETINFO,	"AUDIO_MIXERCTL_GETINFO",
438*7c478bd9Sstevel@tonic-gate 	    NULL },
439*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_SETINFO,	"AUDIO_MIXERCTL_SETINFO",
440*7c478bd9Sstevel@tonic-gate 	    NULL },
441*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_GET_CHINFO,	"AUDIO_MIXERCTL_GET_CHINFO",
442*7c478bd9Sstevel@tonic-gate 	    NULL },
443*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_SET_CHINFO,	"AUDIO_MIXERCTL_SET_CHINFO",
444*7c478bd9Sstevel@tonic-gate 	    NULL },
445*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_GET_MODE,	"AUDIO_MIXERCTL_GET_MODE",
446*7c478bd9Sstevel@tonic-gate 	    NULL },
447*7c478bd9Sstevel@tonic-gate 	{ (uint_t)AUDIO_MIXERCTL_SET_MODE,	"AUDIO_MIXERCTL_SET_MODE",
448*7c478bd9Sstevel@tonic-gate 	    NULL },
449*7c478bd9Sstevel@tonic-gate 	/* volume management (control ioctls) */
450*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCMAP,	"VOLIOCMAP",	NULL },
451*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCUNMAP,	"VOLIOCUNMAP",	NULL },
452*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCEVENT,	"VOLIOCEVENT",	NULL },
453*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCEJECT,	"VOLIOCEJECT",	NULL },
454*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCDGATTR,	"VOLIOCDGATTR",	NULL },
455*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCDSATTR,	"VOLIOCDSATTR",	NULL },
456*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCDCHECK,	"VOLIOCDCHECK",	NULL },
457*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCDINUSE,	"VOLIOCDINUSE",	NULL},
458*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCDAEMON,	"VOLIOCDAEMON",	NULL },
459*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCFLAGS,	"VOLIOCFLAGS",	NULL },
460*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCDROOT,	"VOLIOCDROOT",	NULL },
461*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCDSYMNAME, "VOLIOCDSYMNAME",	NULL },
462*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCDSYMDEV, "VOLIOCDSYMDEV",	NULL },
463*7c478bd9Sstevel@tonic-gate 	/* volume management (user ioctls) */
464*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCINUSE,	"VOLIOCINUSE",	NULL },
465*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCCHECK,	"VOLIOCCHECK",	NULL },
466*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCCANCEL,	"VOLIOCCANCEL",	NULL },
467*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCINFO,	"VOLIOCINFO",	NULL },
468*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCSATTR,	"VOLIOCSATTR",	NULL },
469*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCGATTR,	"VOLIOCGATTR",	NULL },
470*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCROOT,	"VOLIOCROOT",	NULL },
471*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCSYMNAME, "VOLIOCSYMNAME",	NULL },
472*7c478bd9Sstevel@tonic-gate 	{ (uint_t)VOLIOCSYMDEV,	"VOLIOCSYMDEV",	NULL },
473*7c478bd9Sstevel@tonic-gate 	/* STREAMS redirection ioctls */
474*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SRIOCSREDIR,		"SRIOCSREDIR",	NULL },
475*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SRIOCISREDIR,		"SRIOCISREDIR",	NULL },
476*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CPCIO_BIND,		"CPCIO_BIND",		NULL },
477*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CPCIO_SAMPLE,		"CPCIO_SAMPLE",		NULL },
478*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CPCIO_RELE,		"CPCIO_RELE",		NULL },
479*7c478bd9Sstevel@tonic-gate 	/* /dev/poll ioctl() control codes */
480*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DP_POLL,	"DP_POLL",	NULL },
481*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DP_ISPOLLED,	"DP_ISPOLLED",	NULL },
482*7c478bd9Sstevel@tonic-gate 	/* the old /proc ioctl() control codes */
483*7c478bd9Sstevel@tonic-gate #define	PIOC	('q'<<8)
484*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|1),	"PIOCSTATUS",	NULL },
485*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|2),	"PIOCSTOP",	NULL },
486*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|3),	"PIOCWSTOP",	NULL },
487*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|4),	"PIOCRUN",	NULL },
488*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|5),	"PIOCGTRACE",	NULL },
489*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|6),	"PIOCSTRACE",	NULL },
490*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|7),	"PIOCSSIG",	NULL },
491*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|8),	"PIOCKILL",	NULL },
492*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|9),	"PIOCUNKILL",	NULL },
493*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|10),	"PIOCGHOLD",	NULL },
494*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|11),	"PIOCSHOLD",	NULL },
495*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|12),	"PIOCMAXSIG",	NULL },
496*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|13),	"PIOCACTION",	NULL },
497*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|14),	"PIOCGFAULT",	NULL },
498*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|15),	"PIOCSFAULT",	NULL },
499*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|16),	"PIOCCFAULT",	NULL },
500*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|17),	"PIOCGENTRY",	NULL },
501*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|18),	"PIOCSENTRY",	NULL },
502*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|19),	"PIOCGEXIT",	NULL },
503*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|20),	"PIOCSEXIT",	NULL },
504*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|21),	"PIOCSFORK",	NULL },
505*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|22),	"PIOCRFORK",	NULL },
506*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|23),	"PIOCSRLC",	NULL },
507*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|24),	"PIOCRRLC",	NULL },
508*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|25),	"PIOCGREG",	NULL },
509*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|26),	"PIOCSREG",	NULL },
510*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|27),	"PIOCGFPREG",	NULL },
511*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|28),	"PIOCSFPREG",	NULL },
512*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|29),	"PIOCNICE",	NULL },
513*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|30),	"PIOCPSINFO",	NULL },
514*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|31),	"PIOCNMAP",	NULL },
515*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|32),	"PIOCMAP",	NULL },
516*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|33),	"PIOCOPENM",	NULL },
517*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|34),	"PIOCCRED",	NULL },
518*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|35),	"PIOCGROUPS",	NULL },
519*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|36),	"PIOCGETPR",	NULL },
520*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|37),	"PIOCGETU",	NULL },
521*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|38),	"PIOCSET",	NULL },
522*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|39),	"PIOCRESET",	NULL },
523*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|43),	"PIOCUSAGE",	NULL },
524*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|44),	"PIOCOPENPD",	NULL },
525*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|45),	"PIOCLWPIDS",	NULL },
526*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|46),	"PIOCOPENLWP",	NULL },
527*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|47),	"PIOCLSTATUS",	NULL },
528*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|48),	"PIOCLUSAGE",	NULL },
529*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|49),	"PIOCNAUXV",	NULL },
530*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|50),	"PIOCAUXV",	NULL },
531*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|51),	"PIOCGXREGSIZE",	NULL },
532*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|52),	"PIOCGXREG",	NULL },
533*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|53),	"PIOCSXREG",	NULL },
534*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|101),	"PIOCGWIN",	NULL },
535*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|103),	"PIOCNLDT",	NULL },
536*7c478bd9Sstevel@tonic-gate 	{ (uint_t)(PIOC|104),	"PIOCLDT",	NULL },
537*7c478bd9Sstevel@tonic-gate 
538*7c478bd9Sstevel@tonic-gate 	/* ioctl's applicable on sockets */
539*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSHIWAT,	"SIOCSHIWAT",	NULL },
540*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGHIWAT,	"SIOCGHIWAT",	NULL },
541*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLOWAT,	"SIOCSLOWAT",	NULL },
542*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLOWAT,	"SIOCGLOWAT",	NULL },
543*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCATMARK,	"SIOCATMARK",	NULL },
544*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSPGRP,	"SIOCSPGRP",	NULL },
545*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGPGRP,	"SIOCGPGRP",	NULL },
546*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCADDRT,	"SIOCADDRT",	"rtentry" },
547*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCDELRT,	"SIOCDELRT",	"rtentry" },
548*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETVIFCNT,	"SIOCGETVIFCNT", "sioc_vif_req" },
549*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETSGCNT,	"SIOCGETSGCNT",	"sioc_sg_req" },
550*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETLSGCNT,	"SIOCGETLSGCNT", "sioc_lsg_req" },
551*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFADDR,	"SIOCSIFADDR",	"ifreq" },
552*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFADDR,	"SIOCGIFADDR",	"ifreq" },
553*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFDSTADDR,	"SIOCSIFDSTADDR", "ifreq" },
554*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFDSTADDR,	"SIOCGIFDSTADDR", "ifreq" },
555*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFFLAGS,	"SIOCSIFFLAGS",	"ifreq" },
556*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFFLAGS,	"SIOCGIFFLAGS",	"ifreq" },
557*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFMEM,	"SIOCSIFMEM",	"ifreq" },
558*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFMEM,	"SIOCGIFMEM",	"ifreq" },
559*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFCONF,	"SIOCGIFCONF",	"ifconf" },
560*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFMTU,	"SIOCSIFMTU",	"ifreq" },
561*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFMTU,	"SIOCGIFMTU",	"ifreq" },
562*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFBRDADDR,	"SIOCGIFBRDADDR",	"ifreq" },
563*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFBRDADDR,	"SIOCSIFBRDADDR",	"ifreq" },
564*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFNETMASK,	"SIOCGIFNETMASK",	"ifreq" },
565*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFNETMASK,	"SIOCSIFNETMASK",	"ifreq" },
566*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFMETRIC,	"SIOCGIFMETRIC",	"ifreq" },
567*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFMETRIC,	"SIOCSIFMETRIC",	"ifreq" },
568*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSARP,	"SIOCSARP",	"arpreq" },
569*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGARP,	"SIOCGARP",	"arpreq" },
570*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCDARP,	"SIOCDARP",	"arpreq" },
571*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCUPPER,	"SIOCUPPER",	"ifreq" },
572*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLOWER,	"SIOCLOWER",	"ifreq" },
573*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSETSYNC,	"SIOCSETSYNC",	"ifreq" },
574*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETSYNC,	"SIOCGETSYNC",	"ifreq" },
575*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSSDSTATS,	"SIOCSSDSTATS",	"ifreq" },
576*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSSESTATS,	"SIOCSSESTATS",	"ifreq" },
577*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSPROMISC,	"SIOCSPROMISC",	NULL },
578*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCADDMULTI,	"SIOCADDMULTI",	"ifreq" },
579*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCDELMULTI,	"SIOCDELMULTI",	"ifreq" },
580*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETNAME,	"SIOCGETNAME",	"sockaddr" },
581*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGETPEER,	"SIOCGETPEER",	"sockaddr" },
582*7c478bd9Sstevel@tonic-gate 	{ (uint_t)IF_UNITSEL,	"IF_UNITSEL",	NULL },
583*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCXPROTO,	"SIOCXPROTO",	NULL },
584*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCIFDETACH,	"SIOCIFDETACH",	"ifreq" },
585*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGENPSTATS,	"SIOCGENPSTATS",	"ifreq" },
586*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCX25XMT,	"SIOCX25XMT",	"ifreq" },
587*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCX25RCV,	"SIOCX25RCV",	"ifreq" },
588*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCX25TBL,	"SIOCX25TBL",	"ifreq" },
589*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLGETREQ,	"SIOCSLGETREQ",	"ifreq" },
590*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLSTAT,	"SIOCSLSTAT",	"ifreq" },
591*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFNAME,	"SIOCSIFNAME",	"ifreq" },
592*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGENADDR,	"SIOCGENADDR",	"ifreq" },
593*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFNUM,	"SIOCGIFNUM",	NULL },
594*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFMUXID,	"SIOCGIFMUXID",	"ifreq" },
595*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFMUXID,	"SIOCSIFMUXID",	"ifreq" },
596*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIFINDEX,	"SIOCGIFINDEX",	"ifreq" },
597*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIFINDEX,	"SIOCSIFINDEX",	"ifreq" },
598*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFREMOVEIF,	"SIOCLIFREMOVEIF",	"lifreq" },
599*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFADDIF,		"SIOCLIFADDIF",		"lifreq" },
600*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFADDR,		"SIOCSLIFADDR",		"lifreq" },
601*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFADDR,		"SIOCGLIFADDR",		"lifreq" },
602*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFDSTADDR,	"SIOCSLIFDSTADDR",	"lifreq" },
603*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFDSTADDR,	"SIOCGLIFDSTADDR",	"lifreq" },
604*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFFLAGS,	"SIOCSLIFFLAGS",	"lifreq" },
605*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFFLAGS,	"SIOCGLIFFLAGS",	"lifreq" },
606*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFCONF,		"SIOCGLIFCONF",		"lifconf" },
607*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFMTU,		"SIOCSLIFMTU",		"lifreq" },
608*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFMTU,		"SIOCGLIFMTU",		"lifreq" },
609*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFBRDADDR,	"SIOCGLIFBRDADDR",	"lifreq" },
610*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFBRDADDR,	"SIOCSLIFBRDADDR",	"lifreq" },
611*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFNETMASK,	"SIOCGLIFNETMASK",	"lifreq" },
612*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFNETMASK,	"SIOCSLIFNETMASK",	"lifreq" },
613*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFMETRIC,	"SIOCGLIFMETRIC",	"lifreq" },
614*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFMETRIC,	"SIOCSLIFMETRIC",	"lifreq" },
615*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFNAME,		"SIOCSLIFNAME",		"lifreq" },
616*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFNUM,		"SIOCGLIFNUM",		"lifnum" },
617*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFMUXID,	"SIOCGLIFMUXID",	"lifreq" },
618*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFMUXID,	"SIOCSLIFMUXID",	"lifreq" },
619*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFINDEX,	"SIOCGLIFINDEX",	"lifreq" },
620*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFINDEX,	"SIOCSLIFINDEX",	"lifreq" },
621*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFTOKEN,	"SIOCSLIFTOKEN",	"lifreq" },
622*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFTOKEN,	"SIOCGLIFTOKEN",	"lifreq" },
623*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFSUBNET,	"SIOCSLIFSUBNET",	"lifreq" },
624*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFSUBNET,	"SIOCGLIFSUBNET",	"lifreq" },
625*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFLNKINFO,	"SIOCSLIFLNKINFO",	"lifreq" },
626*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFLNKINFO,	"SIOCGLIFLNKINFO",	"lifreq" },
627*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFDELND,		"SIOCLIFDELND",		"lifreq" },
628*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFGETND,		"SIOCLIFGETND",		"lifreq" },
629*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFSETND,		"SIOCLIFSETND",		"lifreq" },
630*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCTMYADDR,		"SIOCTMYADDR",	"sioc_addrreq" },
631*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCTONLINK,		"SIOCTONLINK",	"sioc_addrreq" },
632*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCTMYSITE,		"SIOCTMYSITE",	"sioc_addrreq" },
633*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGTUNPARAM,	"SIOCGTUNPARAM",	"iftun_req" },
634*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSTUNPARAM,	"SIOCSTUNPARAM",	"iftun_req" },
635*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCFIPSECONFIG,	"SIOCFIPSECONFIG",	NULL },
636*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIPSECONFIG,	"SIOCSIPSECONFIG",	NULL },
637*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCDIPSECONFIG,	"SIOCDIPSECONFIG",	NULL },
638*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIPSECONFIG,	"SIOCLIPSECONFIG",	NULL },
639*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFFAILOVER,	"SIOCLIFFAILOVER",	"lifreq" },
640*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCLIFFAILBACK,	"SIOCLIFFAILBACK",	"lifreq" },
641*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFGROUPNAME,	"SIOCSLIFGROUPNAME",	"lifreq" },
642*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFGROUPNAME,	"SIOCGLIFGROUPNAME",	"lifreq" },
643*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFOINDEX,	"SIOCGLIFOINDEX",	"lifreq" },
644*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFOINDEX,	"SIOCSLIFOINDEX",	"lifreq" },
645*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGDSTINFO,		"SIOCGDSTINFO",		NULL },
646*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIP6ADDRPOLICY,	"SIOCGIP6ADDRPOLICY",	NULL },
647*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIP6ADDRPOLICY,	"SIOCSIP6ADDRPOLICY", 	NULL },
648*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSXARP,		"SIOCSXARP",		"xarpreq" },
649*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGXARP,		"SIOCGXARP",		"xarpreq" },
650*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCDXARP,		"SIOCDXARP",		"xarpreq" },
651*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFZONE,		"SIOCGLIFZONE",		"lifreq" },
652*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFZONE,		"SIOCSLIFZONE",		"lifreq" },
653*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSCTPSOPT,		"SIOCSCTPSOPT",		NULL },
654*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSCTPGOPT,		"SIOCSCTPGOPT",		NULL },
655*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSCTPPEELOFF,	"SIOPCSCTPPEELOFF",	"int" },
656*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFUSESRC,	"SIOCGLIFUSESRC",	"lifreq" },
657*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSLIFUSESRC,	"SIOCSLIFUSESRC",	"lifreq" },
658*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGLIFSRCOF,	"SIOCGLIFSRCOF",	"lifsrcof" },
659*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGMSFILTER,	"SIOCGMSFILTER",    "group_filter" },
660*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSMSFILTER,	"SIOCSMSFILTER",    "group_filter" },
661*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCGIPMSFILTER,	"SIOCGIPMSFILTER",  "ip_msfilter" },
662*7c478bd9Sstevel@tonic-gate 	{ (uint_t)SIOCSIPMSFILTER,	"SIOCSIPMSFILTER",  "ip_msfilter" },
663*7c478bd9Sstevel@tonic-gate 
664*7c478bd9Sstevel@tonic-gate 	/* DES encryption */
665*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DESIOCBLOCK,	"DESIOCBLOCK", 	"desparams" },
666*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DESIOCQUICK,	"DESIOCQUICK", 	"desparams" },
667*7c478bd9Sstevel@tonic-gate 
668*7c478bd9Sstevel@tonic-gate 	/* Printing system */
669*7c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_IFCAP,	"PRNIOC_GET_IFCAP", 	NULL },
670*7c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_SET_IFCAP,	"PRNIOC_SET_IFCAP", 	NULL },
671*7c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_IFINFO,	"PRNIOC_GET_IFINFO",
672*7c478bd9Sstevel@tonic-gate 	    "prn_interface_info" },
673*7c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_STATUS,	"PRNIOC_GET_STATUS", 	NULL },
674*7c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_1284_DEVID,	"PRNIOC_GET_1284_DEVID",
675*7c478bd9Sstevel@tonic-gate 	    "prn_1284_device_id" },
676*7c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_1284_STATUS,
677*7c478bd9Sstevel@tonic-gate 	    "PRNIOC_GET_IFCANIOC_GET_1284_STATUS", NULL },
678*7c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_GET_TIMEOUTS,	"PRNIOC_GET_TIMEOUTS",
679*7c478bd9Sstevel@tonic-gate 	    "prn_timeouts" },
680*7c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_SET_TIMEOUTS,	"PRNIOC_SET_TIMEOUTS",
681*7c478bd9Sstevel@tonic-gate 	    "prn_timeouts" },
682*7c478bd9Sstevel@tonic-gate 	{ (uint_t)PRNIOC_RESET,	"PRNIOC_RESET", 	NULL },
683*7c478bd9Sstevel@tonic-gate 
684*7c478bd9Sstevel@tonic-gate 	/* DTrace */
685*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_PROVIDER,	"DTRACEIOC_PROVIDER",	NULL },
686*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_PROBES,	"DTRACEIOC_PROBES",	NULL },
687*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_BUFSNAP,	"DTRACEIOC_BUFSNAP",	NULL },
688*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_PROBEMATCH,	"DTRACEIOC_PROBEMATCH",	NULL },
689*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_ENABLE,	"DTRACEIOC_ENABLE",	NULL },
690*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_AGGSNAP,	"DTRACEIOC_AGGSNAP",	NULL },
691*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_EPROBE,	"DTRACEIOC_EPROBE",	NULL },
692*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_PROBEARG,   "DTRACEIOC_PROBEARG",   NULL },
693*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_CONF,	"DTRACEIOC_CONF",	NULL },
694*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_STATUS,	"DTRACEIOC_STATUS",	NULL },
695*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_GO,		"DTRACEIOC_GO",		NULL },
696*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_STOP,	"DTRACEIOC_STOP",	NULL },
697*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_AGGDESC,	"DTRACEIOC_AGGDESC",	NULL },
698*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_FORMAT,	"DTRACEIOC_FORMAT",	NULL },
699*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_DOFGET,	"DTRACEIOC_DOFGET",	NULL },
700*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEIOC_REPLICATE,	"DTRACEIOC_REPLICATE",	NULL },
701*7c478bd9Sstevel@tonic-gate 
702*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEHIOC_ADD,	"DTRACEHIOC_ADD",	NULL },
703*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEHIOC_REMOVE,	"DTRACEHIOC_REMOVE",	NULL },
704*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DTRACEHIOC_ADDDOF,	"DTRACEHIOC_ADDDOF",	NULL },
705*7c478bd9Sstevel@tonic-gate 
706*7c478bd9Sstevel@tonic-gate 	/* /dev/cryptoadm ioctl() control codes */
707*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_VERSION,	"CRYPTO_GET_VERSION",	NULL },
708*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_DEV_LIST,	"CRYPTO_GET_DEV_LIST",	NULL },
709*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_SOFT_LIST,	"CRYPTO_GET_SOFT_LIST",	NULL },
710*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_DEV_INFO,	"CRYPTO_GET_DEV_INFO",	NULL },
711*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_SOFT_INFO,	"CRYPTO_GET_SOFT_INFO",	NULL },
712*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOAD_DEV_DISABLED,	"CRYPTO_LOAD_DEV_DISABLED",
713*7c478bd9Sstevel@tonic-gate 	    NULL },
714*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOAD_SOFT_DISABLED,	"CRYPTO_LOAD_SOFT_DISABLED",
715*7c478bd9Sstevel@tonic-gate 	    NULL },
716*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_UNLOAD_SOFT_MODULE,	"CRYPTO_UNLOAD_SOFT_MODULE",
717*7c478bd9Sstevel@tonic-gate 	    NULL },
718*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOAD_SOFT_CONFIG,	"CRYPTO_LOAD_SOFT_CONFIG",
719*7c478bd9Sstevel@tonic-gate 	    NULL },
720*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_POOL_CREATE,	"CRYPTO_POOL_CREATE",	NULL },
721*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_POOL_WAIT,	"CRYPTO_POOL_WAIT",	NULL },
722*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_POOL_RUN,	"CRYPTO_POOL_RUN",	NULL },
723*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOAD_DOOR,	"CRYPTO_LOAD_DOOR",	NULL },
724*7c478bd9Sstevel@tonic-gate 
725*7c478bd9Sstevel@tonic-gate 	/* /dev/crypto ioctl() control codes */
726*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_FUNCTION_LIST,	"CRYPTO_GET_FUNCTION_LIST",
727*7c478bd9Sstevel@tonic-gate 	    NULL },
728*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_MECHANISM_NUMBER,	"CRYPTO_GET_MECHANISM_NUMBER",
729*7c478bd9Sstevel@tonic-gate 	    NULL },
730*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OPEN_SESSION,	"CRYPTO_OPEN_SESSION",	NULL },
731*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_CLOSE_SESSION,	"CRYPTO_CLOSE_SESSION",	NULL },
732*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_CLOSE_ALL_SESSIONS,	"CRYPTO_CLOSE_ALL_SESSIONS",
733*7c478bd9Sstevel@tonic-gate 	    NULL },
734*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOGIN,		"CRYPTO_LOGIN",		NULL },
735*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_LOGOUT,	"CRYPTO_LOGOUT",	NULL },
736*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_ENCRYPT,	"CRYPTO_ENCRYPT",	NULL },
737*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_ENCRYPT_INIT,	"CRYPTO_ENCRYPT_INIT",	NULL },
738*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_ENCRYPT_UPDATE,	"CRYPTO_ENCRYPT_UPDATE",
739*7c478bd9Sstevel@tonic-gate 	    NULL },
740*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_ENCRYPT_FINAL,	"CRYPTO_ENCRYPT_FINAL",	NULL },
741*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT,	"CRYPTO_DECRYPT",	NULL },
742*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT_INIT,	"CRYPTO_DECRYPT_INIT",	NULL },
743*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT_UPDATE,	"CRYPTO_DECRYPT_UPDATE",
744*7c478bd9Sstevel@tonic-gate 	    NULL },
745*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT_FINAL,	"CRYPTO_DECRYPT_FINAL",	NULL },
746*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST,	"CRYPTO_DIGEST",	NULL },
747*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST_INIT,	"CRYPTO_DIGEST_INIT",	NULL },
748*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST_UPDATE,	"CRYPTO_DIGEST_UPDATE",	NULL },
749*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST_KEY,	"CRYPTO_DIGEST_KEY",	NULL },
750*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST_FINAL,	"CRYPTO_DIGEST_FINAL",	NULL },
751*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_MAC,		"CRYPTO_MAC",		NULL },
752*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_MAC_INIT,	"CRYPTO_MAC_INIT",	NULL },
753*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_MAC_UPDATE,	"CRYPTO_MAC_UPDATE",	NULL },
754*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_MAC_FINAL,	"CRYPTO_MAC_FINAL",	NULL },
755*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN,		"CRYPTO_SIGN",		NULL },
756*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_INIT,	"CRYPTO_SIGN_INIT",	NULL },
757*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_UPDATE,	"CRYPTO_SIGN_UPDATE",	NULL },
758*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_FINAL,	"CRYPTO_SIGN_FINAL",	NULL },
759*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_RECOVER_INIT,	"CRYPTO_SIGN_RECOVER_INIT",
760*7c478bd9Sstevel@tonic-gate 	    NULL },
761*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_RECOVER,	"CRYPTO_SIGN_RECOVER",	NULL },
762*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY,	"CRYPTO_VERIFY",	NULL },
763*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY_INIT,	"CRYPTO_VERIFY_INIT",	NULL },
764*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY_UPDATE,	"CRYPTO_VERIFY_UPDATE",	NULL },
765*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY_FINAL,	"CRYPTO_VERIFY_FINAL",	NULL },
766*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY_RECOVER_INIT,	"CRYPTO_VERIFY_RECOVER_INIT",
767*7c478bd9Sstevel@tonic-gate 	    NULL },
768*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_VERIFY_RECOVER,	"CRYPTO_VERIFY_RECOVER",
769*7c478bd9Sstevel@tonic-gate 	    NULL },
770*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DIGEST_ENCRYPT_UPDATE,	"CRYPTO_DIGEST_ENCRYPT_UPDATE",
771*7c478bd9Sstevel@tonic-gate 	    NULL },
772*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT_DIGEST_UPDATE,	"CRYPTO_DECRYPT_DIGEST_UPDATE",
773*7c478bd9Sstevel@tonic-gate 	    NULL },
774*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SIGN_ENCRYPT_UPDATE,	"CRYPTO_SIGN_ENCRYPT_UPDATE",
775*7c478bd9Sstevel@tonic-gate 	    NULL },
776*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DECRYPT_VERIFY_UPDATE,	"CRYPTO_DECRYPT_VERIFY_UPDATE",
777*7c478bd9Sstevel@tonic-gate 	    NULL },
778*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SEED_RANDOM,	"CRYPTO_SEED_RANDOM",	NULL },
779*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GENERATE_RANDOM,	"CRYPTO_GENERATE_RANDOM",
780*7c478bd9Sstevel@tonic-gate 	    NULL },
781*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_CREATE,	"CRYPTO_OBJECT_CREATE",	NULL },
782*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_COPY,	"CRYPTO_OBJECT_COPY",	NULL },
783*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_DESTROY,	"CRYPTO_OBJECT_DESTROY",
784*7c478bd9Sstevel@tonic-gate 	    NULL },
785*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE,
786*7c478bd9Sstevel@tonic-gate 	    "CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE",	NULL },
787*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_GET_SIZE, "CRYPTO_OBJECT_GET_SIZE",	NULL },
788*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE,
789*7c478bd9Sstevel@tonic-gate 	    "CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE",	NULL },
790*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_FIND_INIT,	"CRYPTO_OBJECT_FIND_INIT",
791*7c478bd9Sstevel@tonic-gate 	    NULL },
792*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_FIND_UPDATE,	"CRYPTO_OBJECT_FIND_UPDATE",
793*7c478bd9Sstevel@tonic-gate 	    NULL },
794*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_OBJECT_FIND_FINAL,	"CRYPTO_OBJECT_FIND_FINAL",
795*7c478bd9Sstevel@tonic-gate 	    NULL },
796*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GENERATE_KEY,	"CRYPTO_GENERATE_KEY",	NULL },
797*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GENERATE_KEY_PAIR,	"CRYPTO_GENERATE_KEY_PAIR",
798*7c478bd9Sstevel@tonic-gate 	    NULL },
799*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_WRAP_KEY,	"CRYPTO_WRAP_KEY",	NULL },
800*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_UNWRAP_KEY,	"CRYPTO_UNWRAP_KEY",	NULL },
801*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_DERIVE_KEY,	"CRYPTO_DERIVE_KEY",	NULL },
802*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_PROVIDER_LIST,	"CRYPTO_GET_PROVIDER_LIST",
803*7c478bd9Sstevel@tonic-gate 	    NULL },
804*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_PROVIDER_INFO,	"CRYPTO_GET_PROVIDER_INFO",
805*7c478bd9Sstevel@tonic-gate 	    NULL },
806*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_PROVIDER_MECHANISMS,
807*7c478bd9Sstevel@tonic-gate 	    "CRYPTO_GET_PROVIDER_MECHANISMS",	NULL },
808*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_GET_PROVIDER_MECHANISM_INFO,
809*7c478bd9Sstevel@tonic-gate 	    "CRYPTO_GET_PROVIDER_MECHANISM_INFO",	NULL },
810*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_INIT_TOKEN,	"CRYPTO_INIT_TOKEN",	NULL },
811*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_INIT_PIN,	"CRYPTO_INIT_PIN",	NULL },
812*7c478bd9Sstevel@tonic-gate 	{ (uint_t)CRYPTO_SET_PIN,	"CRYPTO_SET_PIN",	NULL },
813*7c478bd9Sstevel@tonic-gate 
814*7c478bd9Sstevel@tonic-gate 	/* kbio ioctls */
815*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCTRANS,		"KIOCTRANS",	NULL },
816*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGTRANS,		"KIOCGTRANS",	NULL },
817*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCTRANSABLE,	"KIOCTRANSABLE",	NULL },
818*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGTRANSABLE,	"KIOCGTRANSABLE",	NULL },
819*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSETKEY,		"KIOCSETKEY",	NULL },
820*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGETKEY,		"KIOCGETKEY",	NULL },
821*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCCMD,		"KIOCCMD",	NULL },
822*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCTYPE,		"KIOCTYPE",	NULL },
823*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSDIRECT,		"KIOCSDIRECT",	NULL },
824*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGDIRECT,		"KIOCGDIRECT",	NULL },
825*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSKEY,		"KIOCSKEY",	NULL },
826*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGKEY,		"KIOCGKEY",	NULL },
827*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSLED,		"KIOCSLED",	NULL },
828*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGLED,		"KIOCGLED",	NULL },
829*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSCOMPAT,		"KIOCSCOMPAT",	NULL },
830*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGCOMPAT,		"KIOCGCOMPAT",	NULL },
831*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSLAYOUT,		"KIOCSLAYOUT",	NULL },
832*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCLAYOUT,		"KIOCLAYOUT",	NULL },
833*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSKABORTEN,	"KIOCSKABORTEN",	NULL },
834*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGRPTDELAY,	"KIOCGRPTDELAY",	NULL },
835*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSRPTDELAY,	"KIOCSRPTDELAY",	NULL },
836*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCGRPTRATE,		"KIOCGRPTRATE",	NULL },
837*7c478bd9Sstevel@tonic-gate 	{ (uint_t)KIOCSRPTRATE,		"KIOCSRPTRATE",	NULL },
838*7c478bd9Sstevel@tonic-gate 
839*7c478bd9Sstevel@tonic-gate 	/* ptm/pts driver I_STR ioctls */
840*7c478bd9Sstevel@tonic-gate 	{ (uint_t)ISPTM,		"ISPTM",		NULL},
841*7c478bd9Sstevel@tonic-gate 	{ (uint_t)UNLKPT,		"UNLKPT",		NULL},
842*7c478bd9Sstevel@tonic-gate 	{ (uint_t)PTSSTTY,		"PTSSTTY",		NULL},
843*7c478bd9Sstevel@tonic-gate 	{ (uint_t)ZONEPT,		"ZONEPT",		NULL},
844*7c478bd9Sstevel@tonic-gate 
845*7c478bd9Sstevel@tonic-gate 	/* aggr link aggregation pseudo driver ioctls */
846*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_CREATE,		"LAIOC_CREATE",		"laioc_create"},
847*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_DELETE,		"LAIOC_DELETE",		"laioc_delete"},
848*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_INFO,		"LAIOC_INFO",		"laioc_info"},
849*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_ADD,		"LAIOC_ADD",
850*7c478bd9Sstevel@tonic-gate 	    "laioc_add_rem"},
851*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_REMOVE,		"LAIOC_REMOVE",
852*7c478bd9Sstevel@tonic-gate 	    "laioc_add_rem"},
853*7c478bd9Sstevel@tonic-gate 	{ (uint_t)LAIOC_MODIFY,		"LAIOC_MODIFY",		"laioc_modify"},
854*7c478bd9Sstevel@tonic-gate 
855*7c478bd9Sstevel@tonic-gate 	/* dld data-link configuration ioctls */
856*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DLDIOCCREATE,		"DLDIOCCREATE",
857*7c478bd9Sstevel@tonic-gate 	    "dld_ioc_create"},
858*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DLDIOCDESTROY,	"DLDIOCDESTROY",
859*7c478bd9Sstevel@tonic-gate 	    "dld_ioc_destroy"},
860*7c478bd9Sstevel@tonic-gate 	{ (uint_t)DLDIOCATTR,		"DLDIOCATTR",		"dld_ioc_attr"},
861*7c478bd9Sstevel@tonic-gate 
862*7c478bd9Sstevel@tonic-gate 	{ (uint_t)0, NULL, NULL	}
863*7c478bd9Sstevel@tonic-gate };
864*7c478bd9Sstevel@tonic-gate 
865*7c478bd9Sstevel@tonic-gate 
866*7c478bd9Sstevel@tonic-gate void
867*7c478bd9Sstevel@tonic-gate ioctl_ioccom(char *buf, size_t size, uint_t code, int nbytes, int x, int y)
868*7c478bd9Sstevel@tonic-gate {
869*7c478bd9Sstevel@tonic-gate 	const char *inoutstr;
870*7c478bd9Sstevel@tonic-gate 
871*7c478bd9Sstevel@tonic-gate 	if (code & IOC_VOID)
872*7c478bd9Sstevel@tonic-gate 		inoutstr = "";
873*7c478bd9Sstevel@tonic-gate 	else if ((code & IOC_INOUT) == IOC_INOUT)
874*7c478bd9Sstevel@tonic-gate 		inoutstr = "WR";
875*7c478bd9Sstevel@tonic-gate 	else
876*7c478bd9Sstevel@tonic-gate 		inoutstr = code & IOC_IN ? "W" : "R";
877*7c478bd9Sstevel@tonic-gate 
878*7c478bd9Sstevel@tonic-gate 	if (isascii(x) && isprint(x))
879*7c478bd9Sstevel@tonic-gate 		(void) snprintf(buf, size, "_IO%sN('%c', %d, %d)", inoutstr,
880*7c478bd9Sstevel@tonic-gate 		    x, y, nbytes);
881*7c478bd9Sstevel@tonic-gate 	else
882*7c478bd9Sstevel@tonic-gate 		(void) snprintf(buf, size, "_IO%sN(0x%x, %d, %d)", inoutstr,
883*7c478bd9Sstevel@tonic-gate 		    x, y, nbytes);
884*7c478bd9Sstevel@tonic-gate }
885*7c478bd9Sstevel@tonic-gate 
886*7c478bd9Sstevel@tonic-gate 
887*7c478bd9Sstevel@tonic-gate const char *
888*7c478bd9Sstevel@tonic-gate ioctlname(private_t *pri, uint_t code)
889*7c478bd9Sstevel@tonic-gate {
890*7c478bd9Sstevel@tonic-gate 	const struct ioc *ip;
891*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
892*7c478bd9Sstevel@tonic-gate 
893*7c478bd9Sstevel@tonic-gate 	for (ip = &ioc[0]; ip->name; ip++) {
894*7c478bd9Sstevel@tonic-gate 		if (code == ip->code) {
895*7c478bd9Sstevel@tonic-gate 			str = ip->name;
896*7c478bd9Sstevel@tonic-gate 			break;
897*7c478bd9Sstevel@tonic-gate 		}
898*7c478bd9Sstevel@tonic-gate 	}
899*7c478bd9Sstevel@tonic-gate 
900*7c478bd9Sstevel@tonic-gate 	/*
901*7c478bd9Sstevel@tonic-gate 	 * Developers hide ascii ioctl names in the ioctl subcode; for example
902*7c478bd9Sstevel@tonic-gate 	 * 0x445210 should be printed 'D'<<16|'R'<<8|10.  We allow for all
903*7c478bd9Sstevel@tonic-gate 	 * three high order bytes (called hi, mid and lo) to contain ascii
904*7c478bd9Sstevel@tonic-gate 	 * characters.
905*7c478bd9Sstevel@tonic-gate 	 */
906*7c478bd9Sstevel@tonic-gate 	if (str == NULL) {
907*7c478bd9Sstevel@tonic-gate 		int c_hi = code >> 24;
908*7c478bd9Sstevel@tonic-gate 		int c_mid = (code >> 16) & 0xff;
909*7c478bd9Sstevel@tonic-gate 		int c_mid_nm = (code >> 16);
910*7c478bd9Sstevel@tonic-gate 		int c_lo = (code >> 8) & 0xff;
911*7c478bd9Sstevel@tonic-gate 		int c_lo_nm = code >> 8;
912*7c478bd9Sstevel@tonic-gate 
913*7c478bd9Sstevel@tonic-gate 		if (isascii(c_lo) && isprint(c_lo) &&
914*7c478bd9Sstevel@tonic-gate 		    isascii(c_mid) && isprint(c_mid) &&
915*7c478bd9Sstevel@tonic-gate 		    isascii(c_hi) && isprint(c_hi))
916*7c478bd9Sstevel@tonic-gate 			(void) sprintf(pri->code_buf,
917*7c478bd9Sstevel@tonic-gate 			    "(('%c'<<24)|('%c'<<16)|('%c'<<8)|%d)",
918*7c478bd9Sstevel@tonic-gate 			    c_hi, c_mid, c_lo, code & 0xff);
919*7c478bd9Sstevel@tonic-gate 		else if (isascii(c_lo) && isprint(c_lo) &&
920*7c478bd9Sstevel@tonic-gate 		    isascii(c_mid_nm) && isprint(c_mid_nm))
921*7c478bd9Sstevel@tonic-gate 			(void) sprintf(pri->code_buf,
922*7c478bd9Sstevel@tonic-gate 			    "(('%c'<<16)|('%c'<<8)|%d)", c_mid, c_lo,
923*7c478bd9Sstevel@tonic-gate 			    code & 0xff);
924*7c478bd9Sstevel@tonic-gate 		else if (isascii(c_lo_nm) && isprint(c_lo_nm))
925*7c478bd9Sstevel@tonic-gate 			(void) sprintf(pri->code_buf, "(('%c'<<8)|%d)",
926*7c478bd9Sstevel@tonic-gate 				c_lo_nm, code & 0xff);
927*7c478bd9Sstevel@tonic-gate 		else if (code & (IOC_VOID|IOC_INOUT))
928*7c478bd9Sstevel@tonic-gate 			ioctl_ioccom(pri->code_buf, sizeof (pri->code_buf),
929*7c478bd9Sstevel@tonic-gate 			    code, c_mid, c_lo, code & 0xff);
930*7c478bd9Sstevel@tonic-gate 		else
931*7c478bd9Sstevel@tonic-gate 			(void) sprintf(pri->code_buf, "0x%.4X", code);
932*7c478bd9Sstevel@tonic-gate 		str = (const char *)pri->code_buf;
933*7c478bd9Sstevel@tonic-gate 	}
934*7c478bd9Sstevel@tonic-gate 
935*7c478bd9Sstevel@tonic-gate 	return (str);
936*7c478bd9Sstevel@tonic-gate }
937*7c478bd9Sstevel@tonic-gate 
938*7c478bd9Sstevel@tonic-gate 
939*7c478bd9Sstevel@tonic-gate const char *
940*7c478bd9Sstevel@tonic-gate ioctldatastruct(uint_t code)
941*7c478bd9Sstevel@tonic-gate {
942*7c478bd9Sstevel@tonic-gate 	const struct ioc *ip;
943*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
944*7c478bd9Sstevel@tonic-gate 
945*7c478bd9Sstevel@tonic-gate 	for (ip = &ioc[0]; ip->name != NULL; ip++) {
946*7c478bd9Sstevel@tonic-gate 		if (code == ip->code) {
947*7c478bd9Sstevel@tonic-gate 			str = ip->datastruct;
948*7c478bd9Sstevel@tonic-gate 			break;
949*7c478bd9Sstevel@tonic-gate 		}
950*7c478bd9Sstevel@tonic-gate 	}
951*7c478bd9Sstevel@tonic-gate 	return (str);
952*7c478bd9Sstevel@tonic-gate }
953*7c478bd9Sstevel@tonic-gate 
954*7c478bd9Sstevel@tonic-gate 
955*7c478bd9Sstevel@tonic-gate const char *
956*7c478bd9Sstevel@tonic-gate fcntlname(int code)
957*7c478bd9Sstevel@tonic-gate {
958*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
959*7c478bd9Sstevel@tonic-gate 
960*7c478bd9Sstevel@tonic-gate 	if (code >= FCNTLMIN && code <= FCNTLMAX)
961*7c478bd9Sstevel@tonic-gate 		str = FCNTLname[code-FCNTLMIN];
962*7c478bd9Sstevel@tonic-gate 	return (str);
963*7c478bd9Sstevel@tonic-gate }
964*7c478bd9Sstevel@tonic-gate 
965*7c478bd9Sstevel@tonic-gate const char *
966*7c478bd9Sstevel@tonic-gate sfsname(int code)
967*7c478bd9Sstevel@tonic-gate {
968*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
969*7c478bd9Sstevel@tonic-gate 
970*7c478bd9Sstevel@tonic-gate 	if (code >= SYSFSMIN && code <= SYSFSMAX)
971*7c478bd9Sstevel@tonic-gate 		str = SYSFSname[code-SYSFSMIN];
972*7c478bd9Sstevel@tonic-gate 	return (str);
973*7c478bd9Sstevel@tonic-gate }
974*7c478bd9Sstevel@tonic-gate 
975*7c478bd9Sstevel@tonic-gate const char *
976*7c478bd9Sstevel@tonic-gate plockname(int code)
977*7c478bd9Sstevel@tonic-gate {
978*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
979*7c478bd9Sstevel@tonic-gate 
980*7c478bd9Sstevel@tonic-gate 	if (code >= PLOCKMIN && code <= PLOCKMAX)
981*7c478bd9Sstevel@tonic-gate 		str = PLOCKname[code-PLOCKMIN];
982*7c478bd9Sstevel@tonic-gate 	return (str);
983*7c478bd9Sstevel@tonic-gate }
984*7c478bd9Sstevel@tonic-gate 
985*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
986*7c478bd9Sstevel@tonic-gate const char *
987*7c478bd9Sstevel@tonic-gate si86name(int code)
988*7c478bd9Sstevel@tonic-gate {
989*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
990*7c478bd9Sstevel@tonic-gate 
991*7c478bd9Sstevel@tonic-gate #if defined(__i386) || defined(__amd64)
992*7c478bd9Sstevel@tonic-gate 	switch (code) {
993*7c478bd9Sstevel@tonic-gate 	case SI86SWPI:		str = "SI86SWPI";	break;
994*7c478bd9Sstevel@tonic-gate 	case SI86SYM:		str = "SI86SYM";	break;
995*7c478bd9Sstevel@tonic-gate 	case SI86CONF:		str = "SI86CONF";	break;
996*7c478bd9Sstevel@tonic-gate 	case SI86BOOT:		str = "SI86BOOT";	break;
997*7c478bd9Sstevel@tonic-gate 	case SI86AUTO:		str = "SI86AUTO";	break;
998*7c478bd9Sstevel@tonic-gate 	case SI86EDT:		str = "SI86EDT";	break;
999*7c478bd9Sstevel@tonic-gate 	case SI86SWAP:		str = "SI86SWAP";	break;
1000*7c478bd9Sstevel@tonic-gate 	case SI86FPHW:		str = "SI86FPHW";	break;
1001*7c478bd9Sstevel@tonic-gate 	case SI86FPSTART:	str = "SI86FPSTART";	break;
1002*7c478bd9Sstevel@tonic-gate 	case GRNON:		str = "GRNON";		break;
1003*7c478bd9Sstevel@tonic-gate 	case GRNFLASH:		str = "GRNFLASH";	break;
1004*7c478bd9Sstevel@tonic-gate 	case STIME:		str = "STIME";		break;
1005*7c478bd9Sstevel@tonic-gate 	case SETNAME:		str = "SETNAME";	break;
1006*7c478bd9Sstevel@tonic-gate 	case RNVR:		str = "RNVR";		break;
1007*7c478bd9Sstevel@tonic-gate 	case WNVR:		str = "WNVR";		break;
1008*7c478bd9Sstevel@tonic-gate 	case RTODC:		str = "RTODC";		break;
1009*7c478bd9Sstevel@tonic-gate 	case CHKSER:		str = "CHKSER";		break;
1010*7c478bd9Sstevel@tonic-gate 	case SI86NVPRT:		str = "SI86NVPRT";	break;
1011*7c478bd9Sstevel@tonic-gate 	case SANUPD:		str = "SANUPD";		break;
1012*7c478bd9Sstevel@tonic-gate 	case SI86KSTR:		str = "SI86KSTR";	break;
1013*7c478bd9Sstevel@tonic-gate 	case SI86MEM:		str = "SI86MEM";	break;
1014*7c478bd9Sstevel@tonic-gate 	case SI86TODEMON:	str = "SI86TODEMON";	break;
1015*7c478bd9Sstevel@tonic-gate 	case SI86CCDEMON:	str = "SI86CCDEMON";	break;
1016*7c478bd9Sstevel@tonic-gate 	case SI86CACHE:		str = "SI86CACHE";	break;
1017*7c478bd9Sstevel@tonic-gate 	case SI86DELMEM:	str = "SI86DELMEM";	break;
1018*7c478bd9Sstevel@tonic-gate 	case SI86ADDMEM:	str = "SI86ADDMEM";	break;
1019*7c478bd9Sstevel@tonic-gate /* 71 through 74 reserved for VPIX */
1020*7c478bd9Sstevel@tonic-gate 	case SI86V86: 		str = "SI86V86";	break;
1021*7c478bd9Sstevel@tonic-gate 	case SI86SLTIME:	str = "SI86SLTIME";	break;
1022*7c478bd9Sstevel@tonic-gate 	case SI86DSCR:		str = "SI86DSCR";	break;
1023*7c478bd9Sstevel@tonic-gate 	case RDUBLK:		str = "RDUBLK";		break;
1024*7c478bd9Sstevel@tonic-gate /* NFA entry point */
1025*7c478bd9Sstevel@tonic-gate 	case SI86NFA:		str = "SI86NFA";	break;
1026*7c478bd9Sstevel@tonic-gate 	case SI86VM86:		str = "SI86VM86";	break;
1027*7c478bd9Sstevel@tonic-gate 	case SI86VMENABLE:	str = "SI86VMENABLE";	break;
1028*7c478bd9Sstevel@tonic-gate 	case SI86LIMUSER:	str = "SI86LIMUSER";	break;
1029*7c478bd9Sstevel@tonic-gate 	case SI86RDID: 		str = "SI86RDID";	break;
1030*7c478bd9Sstevel@tonic-gate 	case SI86RDBOOT:	str = "SI86RDBOOT";	break;
1031*7c478bd9Sstevel@tonic-gate /* Merged Product defines */
1032*7c478bd9Sstevel@tonic-gate 	case SI86SHFIL:		str = "SI86SHFIL";	break;
1033*7c478bd9Sstevel@tonic-gate 	case SI86PCHRGN:	str = "SI86PCHRGN";	break;
1034*7c478bd9Sstevel@tonic-gate 	case SI86BADVISE:	str = "SI86BADVISE";	break;
1035*7c478bd9Sstevel@tonic-gate 	case SI86SHRGN:		str = "SI86SHRGN";	break;
1036*7c478bd9Sstevel@tonic-gate 	case SI86CHIDT:		str = "SI86CHIDT";	break;
1037*7c478bd9Sstevel@tonic-gate 	case SI86EMULRDA: 	str = "SI86EMULRDA";	break;
1038*7c478bd9Sstevel@tonic-gate 	}
1039*7c478bd9Sstevel@tonic-gate #endif /* __i386 */
1040*7c478bd9Sstevel@tonic-gate 
1041*7c478bd9Sstevel@tonic-gate 	return (str);
1042*7c478bd9Sstevel@tonic-gate }
1043*7c478bd9Sstevel@tonic-gate 
1044*7c478bd9Sstevel@tonic-gate const char *
1045*7c478bd9Sstevel@tonic-gate utscode(int code)
1046*7c478bd9Sstevel@tonic-gate {
1047*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
1048*7c478bd9Sstevel@tonic-gate 
1049*7c478bd9Sstevel@tonic-gate 	switch (code) {
1050*7c478bd9Sstevel@tonic-gate 	case UTS_UNAME:		str = "UNAME";	break;
1051*7c478bd9Sstevel@tonic-gate 	case UTS_USTAT:		str = "USTAT";	break;
1052*7c478bd9Sstevel@tonic-gate 	case UTS_FUSERS:	str = "FUSERS";	break;
1053*7c478bd9Sstevel@tonic-gate 	}
1054*7c478bd9Sstevel@tonic-gate 
1055*7c478bd9Sstevel@tonic-gate 	return (str);
1056*7c478bd9Sstevel@tonic-gate }
1057*7c478bd9Sstevel@tonic-gate 
1058*7c478bd9Sstevel@tonic-gate const char *
1059*7c478bd9Sstevel@tonic-gate sconfname(int code)
1060*7c478bd9Sstevel@tonic-gate {
1061*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
1062*7c478bd9Sstevel@tonic-gate 
1063*7c478bd9Sstevel@tonic-gate 	if (code >= SCONFMIN && code <= SCONFMAX)
1064*7c478bd9Sstevel@tonic-gate 		str = SCONFname[code-SCONFMIN];
1065*7c478bd9Sstevel@tonic-gate 	return (str);
1066*7c478bd9Sstevel@tonic-gate }
1067*7c478bd9Sstevel@tonic-gate 
1068*7c478bd9Sstevel@tonic-gate const char *
1069*7c478bd9Sstevel@tonic-gate pathconfname(int code)
1070*7c478bd9Sstevel@tonic-gate {
1071*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
1072*7c478bd9Sstevel@tonic-gate 
1073*7c478bd9Sstevel@tonic-gate 	if (code >= PATHCONFMIN && code <= PATHCONFMAX)
1074*7c478bd9Sstevel@tonic-gate 		str = PATHCONFname[code-PATHCONFMIN];
1075*7c478bd9Sstevel@tonic-gate 	return (str);
1076*7c478bd9Sstevel@tonic-gate }
1077*7c478bd9Sstevel@tonic-gate 
1078*7c478bd9Sstevel@tonic-gate const char *
1079*7c478bd9Sstevel@tonic-gate sigarg(private_t *pri, int arg)
1080*7c478bd9Sstevel@tonic-gate {
1081*7c478bd9Sstevel@tonic-gate 	char *str = NULL;
1082*7c478bd9Sstevel@tonic-gate 	int sig = (arg & SIGNO_MASK);
1083*7c478bd9Sstevel@tonic-gate 
1084*7c478bd9Sstevel@tonic-gate 	str = pri->code_buf;
1085*7c478bd9Sstevel@tonic-gate 	arg &= ~SIGNO_MASK;
1086*7c478bd9Sstevel@tonic-gate 	if (arg & ~(SIGDEFER|SIGHOLD|SIGRELSE|SIGIGNORE|SIGPAUSE))
1087*7c478bd9Sstevel@tonic-gate 		(void) snprintf(pri->code_buf, sizeof (pri->code_buf),
1088*7c478bd9Sstevel@tonic-gate 		    "%s|0x%X", signame(pri, sig), arg);
1089*7c478bd9Sstevel@tonic-gate 	else {
1090*7c478bd9Sstevel@tonic-gate 		(void) strcpy(str, signame(pri, sig));
1091*7c478bd9Sstevel@tonic-gate 		if (arg & SIGDEFER)
1092*7c478bd9Sstevel@tonic-gate 			(void) strcat(str, "|SIGDEFER");
1093*7c478bd9Sstevel@tonic-gate 		if (arg & SIGHOLD)
1094*7c478bd9Sstevel@tonic-gate 			(void) strcat(str, "|SIGHOLD");
1095*7c478bd9Sstevel@tonic-gate 		if (arg & SIGRELSE)
1096*7c478bd9Sstevel@tonic-gate 			(void) strcat(str, "|SIGRELSE");
1097*7c478bd9Sstevel@tonic-gate 		if (arg & SIGIGNORE)
1098*7c478bd9Sstevel@tonic-gate 			(void) strcat(str, "|SIGIGNORE");
1099*7c478bd9Sstevel@tonic-gate 		if (arg & SIGPAUSE)
1100*7c478bd9Sstevel@tonic-gate 			(void) strcat(str, "|SIGPAUSE");
1101*7c478bd9Sstevel@tonic-gate 	}
1102*7c478bd9Sstevel@tonic-gate 
1103*7c478bd9Sstevel@tonic-gate 	return ((const char *)str);
1104*7c478bd9Sstevel@tonic-gate }
1105*7c478bd9Sstevel@tonic-gate 
1106*7c478bd9Sstevel@tonic-gate #define	ALL_O_FLAGS \
1107*7c478bd9Sstevel@tonic-gate 	(O_NDELAY|O_APPEND|O_SYNC|O_DSYNC|O_NONBLOCK|O_CREAT|O_TRUNC\
1108*7c478bd9Sstevel@tonic-gate 	|O_EXCL|O_NOCTTY|O_LARGEFILE|O_RSYNC|O_XATTR|O_NOFOLLOW|O_NOLINKS)
1109*7c478bd9Sstevel@tonic-gate 
1110*7c478bd9Sstevel@tonic-gate const char *
1111*7c478bd9Sstevel@tonic-gate openarg(private_t *pri, int arg)
1112*7c478bd9Sstevel@tonic-gate {
1113*7c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
1114*7c478bd9Sstevel@tonic-gate 
1115*7c478bd9Sstevel@tonic-gate 	switch (arg & ~ALL_O_FLAGS) {
1116*7c478bd9Sstevel@tonic-gate 	default:
1117*7c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
1118*7c478bd9Sstevel@tonic-gate 	case O_RDONLY:
1119*7c478bd9Sstevel@tonic-gate 		(void) strcpy(str, "O_RDONLY");
1120*7c478bd9Sstevel@tonic-gate 		break;
1121*7c478bd9Sstevel@tonic-gate 	case O_WRONLY:
1122*7c478bd9Sstevel@tonic-gate 		(void) strcpy(str, "O_WRONLY");
1123*7c478bd9Sstevel@tonic-gate 		break;
1124*7c478bd9Sstevel@tonic-gate 	case O_RDWR:
1125*7c478bd9Sstevel@tonic-gate 		(void) strcpy(str, "O_RDWR");
1126*7c478bd9Sstevel@tonic-gate 		break;
1127*7c478bd9Sstevel@tonic-gate 	}
1128*7c478bd9Sstevel@tonic-gate 
1129*7c478bd9Sstevel@tonic-gate 	if (arg & O_NDELAY)
1130*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_NDELAY", sizeof (pri->code_buf));
1131*7c478bd9Sstevel@tonic-gate 	if (arg & O_APPEND)
1132*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_APPEND", sizeof (pri->code_buf));
1133*7c478bd9Sstevel@tonic-gate 	if (arg & O_SYNC)
1134*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_SYNC", sizeof (pri->code_buf));
1135*7c478bd9Sstevel@tonic-gate 	if (arg & O_DSYNC)
1136*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_DSYNC", sizeof (pri->code_buf));
1137*7c478bd9Sstevel@tonic-gate 	if (arg & O_NONBLOCK)
1138*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_NONBLOCK", sizeof (pri->code_buf));
1139*7c478bd9Sstevel@tonic-gate 	if (arg & O_CREAT)
1140*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_CREAT", sizeof (pri->code_buf));
1141*7c478bd9Sstevel@tonic-gate 	if (arg & O_TRUNC)
1142*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_TRUNC", sizeof (pri->code_buf));
1143*7c478bd9Sstevel@tonic-gate 	if (arg & O_EXCL)
1144*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_EXCL", sizeof (pri->code_buf));
1145*7c478bd9Sstevel@tonic-gate 	if (arg & O_NOCTTY)
1146*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_NOCTTY", sizeof (pri->code_buf));
1147*7c478bd9Sstevel@tonic-gate 	if (arg & O_LARGEFILE)
1148*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_LARGEFILE", sizeof (pri->code_buf));
1149*7c478bd9Sstevel@tonic-gate 	if (arg & O_RSYNC)
1150*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_RSYNC", sizeof (pri->code_buf));
1151*7c478bd9Sstevel@tonic-gate 	if (arg & O_XATTR)
1152*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_XATTR", sizeof (pri->code_buf));
1153*7c478bd9Sstevel@tonic-gate 	if (arg & O_NOFOLLOW)
1154*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_NOFOLLOW", sizeof (pri->code_buf));
1155*7c478bd9Sstevel@tonic-gate 	if (arg & O_NOLINKS)
1156*7c478bd9Sstevel@tonic-gate 		(void) strlcat(str, "|O_NOLINKS", sizeof (pri->code_buf));
1157*7c478bd9Sstevel@tonic-gate 
1158*7c478bd9Sstevel@tonic-gate 	return ((const char *)str);
1159*7c478bd9Sstevel@tonic-gate }
1160*7c478bd9Sstevel@tonic-gate 
1161*7c478bd9Sstevel@tonic-gate const char *
1162*7c478bd9Sstevel@tonic-gate whencearg(int arg)
1163*7c478bd9Sstevel@tonic-gate {
1164*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
1165*7c478bd9Sstevel@tonic-gate 
1166*7c478bd9Sstevel@tonic-gate 	switch (arg) {
1167*7c478bd9Sstevel@tonic-gate 	case SEEK_SET:	str = "SEEK_SET";	break;
1168*7c478bd9Sstevel@tonic-gate 	case SEEK_CUR:	str = "SEEK_CUR";	break;
1169*7c478bd9Sstevel@tonic-gate 	case SEEK_END:	str = "SEEK_END";	break;
1170*7c478bd9Sstevel@tonic-gate 	case SEEK_DATA:	str = "SEEK_DATA";	break;
1171*7c478bd9Sstevel@tonic-gate 	case SEEK_HOLE:	str = "SEEK_HOLE";	break;
1172*7c478bd9Sstevel@tonic-gate 	}
1173*7c478bd9Sstevel@tonic-gate 
1174*7c478bd9Sstevel@tonic-gate 	return (str);
1175*7c478bd9Sstevel@tonic-gate }
1176*7c478bd9Sstevel@tonic-gate 
1177*7c478bd9Sstevel@tonic-gate #define	IPC_FLAGS	(IPC_ALLOC|IPC_CREAT|IPC_EXCL|IPC_NOWAIT)
1178*7c478bd9Sstevel@tonic-gate 
1179*7c478bd9Sstevel@tonic-gate char *
1180*7c478bd9Sstevel@tonic-gate ipcflags(private_t *pri, int arg)
1181*7c478bd9Sstevel@tonic-gate {
1182*7c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
1183*7c478bd9Sstevel@tonic-gate 
1184*7c478bd9Sstevel@tonic-gate 	if (arg & 0777)
1185*7c478bd9Sstevel@tonic-gate 		(void) sprintf(str, "0%.3o", arg&0777);
1186*7c478bd9Sstevel@tonic-gate 	else
1187*7c478bd9Sstevel@tonic-gate 		*str = '\0';
1188*7c478bd9Sstevel@tonic-gate 
1189*7c478bd9Sstevel@tonic-gate 	if (arg & IPC_ALLOC)
1190*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|IPC_ALLOC");
1191*7c478bd9Sstevel@tonic-gate 	if (arg & IPC_CREAT)
1192*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|IPC_CREAT");
1193*7c478bd9Sstevel@tonic-gate 	if (arg & IPC_EXCL)
1194*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|IPC_EXCL");
1195*7c478bd9Sstevel@tonic-gate 	if (arg & IPC_NOWAIT)
1196*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|IPC_NOWAIT");
1197*7c478bd9Sstevel@tonic-gate 
1198*7c478bd9Sstevel@tonic-gate 	return (str);
1199*7c478bd9Sstevel@tonic-gate }
1200*7c478bd9Sstevel@tonic-gate 
1201*7c478bd9Sstevel@tonic-gate const char *
1202*7c478bd9Sstevel@tonic-gate msgflags(private_t *pri, int arg)
1203*7c478bd9Sstevel@tonic-gate {
1204*7c478bd9Sstevel@tonic-gate 	char *str;
1205*7c478bd9Sstevel@tonic-gate 
1206*7c478bd9Sstevel@tonic-gate 	if (arg == 0 || (arg & ~(IPC_FLAGS|MSG_NOERROR|0777)) != 0)
1207*7c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
1208*7c478bd9Sstevel@tonic-gate 
1209*7c478bd9Sstevel@tonic-gate 	str = ipcflags(pri, arg);
1210*7c478bd9Sstevel@tonic-gate 
1211*7c478bd9Sstevel@tonic-gate 	if (arg & MSG_NOERROR)
1212*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|MSG_NOERROR");
1213*7c478bd9Sstevel@tonic-gate 
1214*7c478bd9Sstevel@tonic-gate 	if (*str == '|')
1215*7c478bd9Sstevel@tonic-gate 		str++;
1216*7c478bd9Sstevel@tonic-gate 	return ((const char *)str);
1217*7c478bd9Sstevel@tonic-gate }
1218*7c478bd9Sstevel@tonic-gate 
1219*7c478bd9Sstevel@tonic-gate const char *
1220*7c478bd9Sstevel@tonic-gate semflags(private_t *pri, int arg)
1221*7c478bd9Sstevel@tonic-gate {
1222*7c478bd9Sstevel@tonic-gate 	char *str;
1223*7c478bd9Sstevel@tonic-gate 
1224*7c478bd9Sstevel@tonic-gate 	if (arg == 0 || (arg & ~(IPC_FLAGS|SEM_UNDO|0777)) != 0)
1225*7c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
1226*7c478bd9Sstevel@tonic-gate 
1227*7c478bd9Sstevel@tonic-gate 	str = ipcflags(pri, arg);
1228*7c478bd9Sstevel@tonic-gate 
1229*7c478bd9Sstevel@tonic-gate 	if (arg & SEM_UNDO)
1230*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|SEM_UNDO");
1231*7c478bd9Sstevel@tonic-gate 
1232*7c478bd9Sstevel@tonic-gate 	if (*str == '|')
1233*7c478bd9Sstevel@tonic-gate 		str++;
1234*7c478bd9Sstevel@tonic-gate 	return ((const char *)str);
1235*7c478bd9Sstevel@tonic-gate }
1236*7c478bd9Sstevel@tonic-gate 
1237*7c478bd9Sstevel@tonic-gate const char *
1238*7c478bd9Sstevel@tonic-gate shmflags(private_t *pri, int arg)
1239*7c478bd9Sstevel@tonic-gate {
1240*7c478bd9Sstevel@tonic-gate 	char *str;
1241*7c478bd9Sstevel@tonic-gate 
1242*7c478bd9Sstevel@tonic-gate 	if (arg == 0 || (arg & ~(IPC_FLAGS|SHM_RDONLY|SHM_RND|0777)) != 0)
1243*7c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
1244*7c478bd9Sstevel@tonic-gate 
1245*7c478bd9Sstevel@tonic-gate 	str = ipcflags(pri, arg);
1246*7c478bd9Sstevel@tonic-gate 
1247*7c478bd9Sstevel@tonic-gate 	if (arg & SHM_RDONLY)
1248*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|SHM_RDONLY");
1249*7c478bd9Sstevel@tonic-gate 	if (arg & SHM_RND)
1250*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|SHM_RND");
1251*7c478bd9Sstevel@tonic-gate 
1252*7c478bd9Sstevel@tonic-gate 	if (*str == '|')
1253*7c478bd9Sstevel@tonic-gate 		str++;
1254*7c478bd9Sstevel@tonic-gate 	return ((const char *)str);
1255*7c478bd9Sstevel@tonic-gate }
1256*7c478bd9Sstevel@tonic-gate 
1257*7c478bd9Sstevel@tonic-gate #define	MSGCMDMIN	0
1258*7c478bd9Sstevel@tonic-gate #define	MSGCMDMAX	IPC_STAT64
1259*7c478bd9Sstevel@tonic-gate const char *const MSGCMDname[MSGCMDMAX+1] = {
1260*7c478bd9Sstevel@tonic-gate 	NULL, NULL, NULL, NULL, NULL,
1261*7c478bd9Sstevel@tonic-gate 	NULL, NULL, NULL, NULL, NULL,
1262*7c478bd9Sstevel@tonic-gate 	"IPC_RMID",	/* 10 */
1263*7c478bd9Sstevel@tonic-gate 	"IPC_SET",	/* 11 */
1264*7c478bd9Sstevel@tonic-gate 	"IPC_STAT",	/* 12 */
1265*7c478bd9Sstevel@tonic-gate 	"IPC_SET64",	/* 13 */
1266*7c478bd9Sstevel@tonic-gate 	"IPC_STAT64",	/* 14 */
1267*7c478bd9Sstevel@tonic-gate };
1268*7c478bd9Sstevel@tonic-gate 
1269*7c478bd9Sstevel@tonic-gate #define	SEMCMDMIN	0
1270*7c478bd9Sstevel@tonic-gate #define	SEMCMDMAX	IPC_STAT64
1271*7c478bd9Sstevel@tonic-gate const char *const SEMCMDname[SEMCMDMAX+1] = {
1272*7c478bd9Sstevel@tonic-gate 	NULL,		/* 0 */
1273*7c478bd9Sstevel@tonic-gate 	NULL,		/* 1 */
1274*7c478bd9Sstevel@tonic-gate 	NULL,		/* 2 */
1275*7c478bd9Sstevel@tonic-gate 	"GETNCNT",	/* 3 */
1276*7c478bd9Sstevel@tonic-gate 	"GETPID",	/* 4 */
1277*7c478bd9Sstevel@tonic-gate 	"GETVAL",	/* 5 */
1278*7c478bd9Sstevel@tonic-gate 	"GETALL",	/* 6 */
1279*7c478bd9Sstevel@tonic-gate 	"GETZCNT",	/* 7 */
1280*7c478bd9Sstevel@tonic-gate 	"SETVAL",	/* 8 */
1281*7c478bd9Sstevel@tonic-gate 	"SETALL",	/* 9 */
1282*7c478bd9Sstevel@tonic-gate 	"IPC_RMID",	/* 10 */
1283*7c478bd9Sstevel@tonic-gate 	"IPC_SET",	/* 11 */
1284*7c478bd9Sstevel@tonic-gate 	"IPC_STAT",	/* 12 */
1285*7c478bd9Sstevel@tonic-gate 	"IPC_SET64",	/* 13 */
1286*7c478bd9Sstevel@tonic-gate 	"IPC_STAT64",	/* 14 */
1287*7c478bd9Sstevel@tonic-gate };
1288*7c478bd9Sstevel@tonic-gate 
1289*7c478bd9Sstevel@tonic-gate #define	SHMCMDMIN	0
1290*7c478bd9Sstevel@tonic-gate #define	SHMCMDMAX	IPC_STAT64
1291*7c478bd9Sstevel@tonic-gate const char *const SHMCMDname[SHMCMDMAX+1] = {
1292*7c478bd9Sstevel@tonic-gate 	NULL,		/* 0 */
1293*7c478bd9Sstevel@tonic-gate 	NULL,		/* 1 */
1294*7c478bd9Sstevel@tonic-gate 	NULL,		/* 2 */
1295*7c478bd9Sstevel@tonic-gate 	"SHM_LOCK",	/* 3 */
1296*7c478bd9Sstevel@tonic-gate 	"SHM_UNLOCK",	/* 4 */
1297*7c478bd9Sstevel@tonic-gate 	NULL, NULL, NULL, NULL, NULL,			/* 5 NULLs */
1298*7c478bd9Sstevel@tonic-gate 	"IPC_RMID",	/* 10 */
1299*7c478bd9Sstevel@tonic-gate 	"IPC_SET",	/* 11 */
1300*7c478bd9Sstevel@tonic-gate 	"IPC_STAT",	/* 12 */
1301*7c478bd9Sstevel@tonic-gate 	"IPC_SET64",	/* 13 */
1302*7c478bd9Sstevel@tonic-gate 	"IPC_STAT64",	/* 14 */
1303*7c478bd9Sstevel@tonic-gate };
1304*7c478bd9Sstevel@tonic-gate 
1305*7c478bd9Sstevel@tonic-gate const char *
1306*7c478bd9Sstevel@tonic-gate msgcmd(int arg)
1307*7c478bd9Sstevel@tonic-gate {
1308*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
1309*7c478bd9Sstevel@tonic-gate 
1310*7c478bd9Sstevel@tonic-gate 	if (arg >= MSGCMDMIN && arg <= MSGCMDMAX)
1311*7c478bd9Sstevel@tonic-gate 		str = MSGCMDname[arg-MSGCMDMIN];
1312*7c478bd9Sstevel@tonic-gate 	return (str);
1313*7c478bd9Sstevel@tonic-gate }
1314*7c478bd9Sstevel@tonic-gate 
1315*7c478bd9Sstevel@tonic-gate const char *
1316*7c478bd9Sstevel@tonic-gate semcmd(int arg)
1317*7c478bd9Sstevel@tonic-gate {
1318*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
1319*7c478bd9Sstevel@tonic-gate 
1320*7c478bd9Sstevel@tonic-gate 	if (arg >= SEMCMDMIN && arg <= SEMCMDMAX)
1321*7c478bd9Sstevel@tonic-gate 		str = SEMCMDname[arg-SEMCMDMIN];
1322*7c478bd9Sstevel@tonic-gate 	return (str);
1323*7c478bd9Sstevel@tonic-gate }
1324*7c478bd9Sstevel@tonic-gate 
1325*7c478bd9Sstevel@tonic-gate const char *
1326*7c478bd9Sstevel@tonic-gate shmcmd(int arg)
1327*7c478bd9Sstevel@tonic-gate {
1328*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
1329*7c478bd9Sstevel@tonic-gate 
1330*7c478bd9Sstevel@tonic-gate 	if (arg >= SHMCMDMIN && arg <= SHMCMDMAX)
1331*7c478bd9Sstevel@tonic-gate 		str = SHMCMDname[arg-SHMCMDMIN];
1332*7c478bd9Sstevel@tonic-gate 	return (str);
1333*7c478bd9Sstevel@tonic-gate }
1334*7c478bd9Sstevel@tonic-gate 
1335*7c478bd9Sstevel@tonic-gate const char *
1336*7c478bd9Sstevel@tonic-gate strrdopt(int arg)	/* streams read option (I_SRDOPT I_GRDOPT) */
1337*7c478bd9Sstevel@tonic-gate {
1338*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
1339*7c478bd9Sstevel@tonic-gate 
1340*7c478bd9Sstevel@tonic-gate 	switch (arg) {
1341*7c478bd9Sstevel@tonic-gate 	case RNORM:	str = "RNORM";		break;
1342*7c478bd9Sstevel@tonic-gate 	case RMSGD:	str = "RMSGD";		break;
1343*7c478bd9Sstevel@tonic-gate 	case RMSGN:	str = "RMSGN";		break;
1344*7c478bd9Sstevel@tonic-gate 	}
1345*7c478bd9Sstevel@tonic-gate 
1346*7c478bd9Sstevel@tonic-gate 	return (str);
1347*7c478bd9Sstevel@tonic-gate }
1348*7c478bd9Sstevel@tonic-gate 
1349*7c478bd9Sstevel@tonic-gate /* bit map of streams events (I_SETSIG & I_GETSIG) */
1350*7c478bd9Sstevel@tonic-gate const char *
1351*7c478bd9Sstevel@tonic-gate strevents(private_t *pri, int arg)
1352*7c478bd9Sstevel@tonic-gate {
1353*7c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
1354*7c478bd9Sstevel@tonic-gate 
1355*7c478bd9Sstevel@tonic-gate 	if (arg & ~(S_INPUT|S_HIPRI|S_OUTPUT|S_MSG|S_ERROR|S_HANGUP))
1356*7c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
1357*7c478bd9Sstevel@tonic-gate 
1358*7c478bd9Sstevel@tonic-gate 	*str = '\0';
1359*7c478bd9Sstevel@tonic-gate 	if (arg & S_INPUT)
1360*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_INPUT");
1361*7c478bd9Sstevel@tonic-gate 	if (arg & S_HIPRI)
1362*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_HIPRI");
1363*7c478bd9Sstevel@tonic-gate 	if (arg & S_OUTPUT)
1364*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_OUTPUT");
1365*7c478bd9Sstevel@tonic-gate 	if (arg & S_MSG)
1366*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_MSG");
1367*7c478bd9Sstevel@tonic-gate 	if (arg & S_ERROR)
1368*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_ERROR");
1369*7c478bd9Sstevel@tonic-gate 	if (arg & S_HANGUP)
1370*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|S_HANGUP");
1371*7c478bd9Sstevel@tonic-gate 
1372*7c478bd9Sstevel@tonic-gate 	return ((const char *)(str+1));
1373*7c478bd9Sstevel@tonic-gate }
1374*7c478bd9Sstevel@tonic-gate 
1375*7c478bd9Sstevel@tonic-gate const char *
1376*7c478bd9Sstevel@tonic-gate tiocflush(private_t *pri, int arg)	/* bit map passsed by TIOCFLUSH */
1377*7c478bd9Sstevel@tonic-gate {
1378*7c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
1379*7c478bd9Sstevel@tonic-gate 
1380*7c478bd9Sstevel@tonic-gate 	if (arg & ~(FREAD|FWRITE))
1381*7c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
1382*7c478bd9Sstevel@tonic-gate 
1383*7c478bd9Sstevel@tonic-gate 	*str = '\0';
1384*7c478bd9Sstevel@tonic-gate 	if (arg & FREAD)
1385*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|FREAD");
1386*7c478bd9Sstevel@tonic-gate 	if (arg & FWRITE)
1387*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|FWRITE");
1388*7c478bd9Sstevel@tonic-gate 
1389*7c478bd9Sstevel@tonic-gate 	return ((const char *)(str+1));
1390*7c478bd9Sstevel@tonic-gate }
1391*7c478bd9Sstevel@tonic-gate 
1392*7c478bd9Sstevel@tonic-gate const char *
1393*7c478bd9Sstevel@tonic-gate strflush(int arg)	/* streams flush option (I_FLUSH) */
1394*7c478bd9Sstevel@tonic-gate {
1395*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
1396*7c478bd9Sstevel@tonic-gate 
1397*7c478bd9Sstevel@tonic-gate 	switch (arg) {
1398*7c478bd9Sstevel@tonic-gate 	case FLUSHR:	str = "FLUSHR";		break;
1399*7c478bd9Sstevel@tonic-gate 	case FLUSHW:	str = "FLUSHW";		break;
1400*7c478bd9Sstevel@tonic-gate 	case FLUSHRW:	str = "FLUSHRW";	break;
1401*7c478bd9Sstevel@tonic-gate 	}
1402*7c478bd9Sstevel@tonic-gate 
1403*7c478bd9Sstevel@tonic-gate 	return (str);
1404*7c478bd9Sstevel@tonic-gate }
1405*7c478bd9Sstevel@tonic-gate 
1406*7c478bd9Sstevel@tonic-gate #define	ALL_MOUNT_FLAGS	(MS_RDONLY|MS_FSS|MS_DATA|MS_NOSUID|MS_REMOUNT| \
1407*7c478bd9Sstevel@tonic-gate 	MS_NOTRUNC|MS_OVERLAY|MS_OPTIONSTR|MS_GLOBAL|MS_FORCE|MS_NOMNTTAB)
1408*7c478bd9Sstevel@tonic-gate 
1409*7c478bd9Sstevel@tonic-gate const char *
1410*7c478bd9Sstevel@tonic-gate mountflags(private_t *pri, int arg)	/* bit map of mount syscall flags */
1411*7c478bd9Sstevel@tonic-gate {
1412*7c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
1413*7c478bd9Sstevel@tonic-gate 	size_t used = 0;
1414*7c478bd9Sstevel@tonic-gate 
1415*7c478bd9Sstevel@tonic-gate 	if (arg & ~ALL_MOUNT_FLAGS)
1416*7c478bd9Sstevel@tonic-gate 		return ((char *)NULL);
1417*7c478bd9Sstevel@tonic-gate 
1418*7c478bd9Sstevel@tonic-gate 	*str = '\0';
1419*7c478bd9Sstevel@tonic-gate 	if (arg & MS_RDONLY)
1420*7c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_RDONLY", sizeof (pri->code_buf));
1421*7c478bd9Sstevel@tonic-gate 	if (arg & MS_FSS)
1422*7c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_FSS", sizeof (pri->code_buf));
1423*7c478bd9Sstevel@tonic-gate 	if (arg & MS_DATA)
1424*7c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_DATA", sizeof (pri->code_buf));
1425*7c478bd9Sstevel@tonic-gate 	if (arg & MS_NOSUID)
1426*7c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_NOSUID", sizeof (pri->code_buf));
1427*7c478bd9Sstevel@tonic-gate 	if (arg & MS_REMOUNT)
1428*7c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_REMOUNT", sizeof (pri->code_buf));
1429*7c478bd9Sstevel@tonic-gate 	if (arg & MS_NOTRUNC)
1430*7c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_NOTRUNC", sizeof (pri->code_buf));
1431*7c478bd9Sstevel@tonic-gate 	if (arg & MS_OVERLAY)
1432*7c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_OVERLAY", sizeof (pri->code_buf));
1433*7c478bd9Sstevel@tonic-gate 	if (arg & MS_OPTIONSTR)
1434*7c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_OPTIONSTR", sizeof (pri->code_buf));
1435*7c478bd9Sstevel@tonic-gate 	if (arg & MS_GLOBAL)
1436*7c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_GLOBAL", sizeof (pri->code_buf));
1437*7c478bd9Sstevel@tonic-gate 	if (arg & MS_FORCE)
1438*7c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_FORCE", sizeof (pri->code_buf));
1439*7c478bd9Sstevel@tonic-gate 	if (arg & MS_NOMNTTAB)
1440*7c478bd9Sstevel@tonic-gate 		used = strlcat(str, "|MS_NOMNTTAB", sizeof (pri->code_buf));
1441*7c478bd9Sstevel@tonic-gate 
1442*7c478bd9Sstevel@tonic-gate 	if (used == 0 || used >= sizeof (pri->code_buf))
1443*7c478bd9Sstevel@tonic-gate 		return ((char *)NULL);			/* use prt_hex() */
1444*7c478bd9Sstevel@tonic-gate 
1445*7c478bd9Sstevel@tonic-gate 	return ((const char *)(str+1));
1446*7c478bd9Sstevel@tonic-gate }
1447*7c478bd9Sstevel@tonic-gate 
1448*7c478bd9Sstevel@tonic-gate const char *
1449*7c478bd9Sstevel@tonic-gate svfsflags(private_t *pri, ulong_t arg)	/* bit map of statvfs syscall flags */
1450*7c478bd9Sstevel@tonic-gate {
1451*7c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
1452*7c478bd9Sstevel@tonic-gate 
1453*7c478bd9Sstevel@tonic-gate 	if (arg & ~(ST_RDONLY|ST_NOSUID|ST_NOTRUNC)) {
1454*7c478bd9Sstevel@tonic-gate 		(void) sprintf(str, "0x%lx", arg);
1455*7c478bd9Sstevel@tonic-gate 		return (str);
1456*7c478bd9Sstevel@tonic-gate 	}
1457*7c478bd9Sstevel@tonic-gate 	*str = '\0';
1458*7c478bd9Sstevel@tonic-gate 	if (arg & ST_RDONLY)
1459*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|ST_RDONLY");
1460*7c478bd9Sstevel@tonic-gate 	if (arg & ST_NOSUID)
1461*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|ST_NOSUID");
1462*7c478bd9Sstevel@tonic-gate 	if (arg & ST_NOTRUNC)
1463*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|ST_NOTRUNC");
1464*7c478bd9Sstevel@tonic-gate 	if (*str == '\0')
1465*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|0");
1466*7c478bd9Sstevel@tonic-gate 	return ((const char *)(str+1));
1467*7c478bd9Sstevel@tonic-gate }
1468*7c478bd9Sstevel@tonic-gate 
1469*7c478bd9Sstevel@tonic-gate const char *
1470*7c478bd9Sstevel@tonic-gate fuiname(int arg)	/* fusers() input argument */
1471*7c478bd9Sstevel@tonic-gate {
1472*7c478bd9Sstevel@tonic-gate 	const char *str = NULL;
1473*7c478bd9Sstevel@tonic-gate 
1474*7c478bd9Sstevel@tonic-gate 	switch (arg) {
1475*7c478bd9Sstevel@tonic-gate 	case F_FILE_ONLY:	str = "F_FILE_ONLY";		break;
1476*7c478bd9Sstevel@tonic-gate 	case F_CONTAINED:	str = "F_CONTAINED";		break;
1477*7c478bd9Sstevel@tonic-gate 	}
1478*7c478bd9Sstevel@tonic-gate 
1479*7c478bd9Sstevel@tonic-gate 	return (str);
1480*7c478bd9Sstevel@tonic-gate }
1481*7c478bd9Sstevel@tonic-gate 
1482*7c478bd9Sstevel@tonic-gate const char *
1483*7c478bd9Sstevel@tonic-gate fuflags(private_t *pri, int arg)	/* fusers() output flags */
1484*7c478bd9Sstevel@tonic-gate {
1485*7c478bd9Sstevel@tonic-gate 	char *str = pri->code_buf;
1486*7c478bd9Sstevel@tonic-gate 
1487*7c478bd9Sstevel@tonic-gate 	if (arg & ~(F_CDIR|F_RDIR|F_TEXT|F_MAP|F_OPEN|F_TRACE|F_TTY)) {
1488*7c478bd9Sstevel@tonic-gate 		(void) sprintf(str, "0x%x", arg);
1489*7c478bd9Sstevel@tonic-gate 		return (str);
1490*7c478bd9Sstevel@tonic-gate 	}
1491*7c478bd9Sstevel@tonic-gate 	*str = '\0';
1492*7c478bd9Sstevel@tonic-gate 	if (arg & F_CDIR)
1493*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_CDIR");
1494*7c478bd9Sstevel@tonic-gate 	if (arg & F_RDIR)
1495*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_RDIR");
1496*7c478bd9Sstevel@tonic-gate 	if (arg & F_TEXT)
1497*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_TEXT");
1498*7c478bd9Sstevel@tonic-gate 	if (arg & F_MAP)
1499*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_MAP");
1500*7c478bd9Sstevel@tonic-gate 	if (arg & F_OPEN)
1501*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_OPEN");
1502*7c478bd9Sstevel@tonic-gate 	if (arg & F_TRACE)
1503*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_TRACE");
1504*7c478bd9Sstevel@tonic-gate 	if (arg & F_TTY)
1505*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|F_TTY");
1506*7c478bd9Sstevel@tonic-gate 	if (*str == '\0')
1507*7c478bd9Sstevel@tonic-gate 		(void) strcat(str, "|0");
1508*7c478bd9Sstevel@tonic-gate 	return ((const char *)(str+1));
1509*7c478bd9Sstevel@tonic-gate }
1510*7c478bd9Sstevel@tonic-gate 
1511*7c478bd9Sstevel@tonic-gate 
1512*7c478bd9Sstevel@tonic-gate const char *
1513*7c478bd9Sstevel@tonic-gate ipprotos(int arg)	/* IP protocols cf. netinet/in.h */
1514*7c478bd9Sstevel@tonic-gate {
1515*7c478bd9Sstevel@tonic-gate 	switch (arg) {
1516*7c478bd9Sstevel@tonic-gate 	case IPPROTO_IP:	return ("IPPROTO_IP");
1517*7c478bd9Sstevel@tonic-gate 	case IPPROTO_ICMP:	return ("IPPROTO_ICMP");
1518*7c478bd9Sstevel@tonic-gate 	case IPPROTO_IGMP:	return ("IPPROTO_IGMP");
1519*7c478bd9Sstevel@tonic-gate 	case IPPROTO_GGP:	return ("IPPROTO_GGP");
1520*7c478bd9Sstevel@tonic-gate 	case IPPROTO_ENCAP:	return ("IPPROTO_ENCAP");
1521*7c478bd9Sstevel@tonic-gate 	case IPPROTO_TCP:	return ("IPPROTO_TCP");
1522*7c478bd9Sstevel@tonic-gate 	case IPPROTO_EGP:	return ("IPPROTO_EGP");
1523*7c478bd9Sstevel@tonic-gate 	case IPPROTO_PUP:	return ("IPPROTO_PUP");
1524*7c478bd9Sstevel@tonic-gate 	case IPPROTO_UDP:	return ("IPPROTO_UDP");
1525*7c478bd9Sstevel@tonic-gate 	case IPPROTO_IDP:	return ("IPPROTO_IDP");
1526*7c478bd9Sstevel@tonic-gate 	case IPPROTO_IPV6:	return ("IPPROTO_IPV6");
1527*7c478bd9Sstevel@tonic-gate 	case IPPROTO_ROUTING:	return ("IPPROTO_ROUTING");
1528*7c478bd9Sstevel@tonic-gate 	case IPPROTO_FRAGMENT:	return ("IPPROTO_FRAGMENT");
1529*7c478bd9Sstevel@tonic-gate 	case IPPROTO_RSVP:	return ("IPPROTO_RSVP");
1530*7c478bd9Sstevel@tonic-gate 	case IPPROTO_ESP:	return ("IPPROTO_ESP");
1531*7c478bd9Sstevel@tonic-gate 	case IPPROTO_AH:	return ("IPPROTO_AH");
1532*7c478bd9Sstevel@tonic-gate 	case IPPROTO_ICMPV6:	return ("IPPROTO_ICMPV6");
1533*7c478bd9Sstevel@tonic-gate 	case IPPROTO_NONE:	return ("IPPROTO_NONE");
1534*7c478bd9Sstevel@tonic-gate 	case IPPROTO_DSTOPTS:	return ("IPPROTO_DSTOPTS");
1535*7c478bd9Sstevel@tonic-gate 	case IPPROTO_HELLO:	return ("IPPROTO_HELLO");
1536*7c478bd9Sstevel@tonic-gate 	case IPPROTO_ND:	return ("IPPROTO_ND");
1537*7c478bd9Sstevel@tonic-gate 	case IPPROTO_EON:	return ("IPPROTO_EON");
1538*7c478bd9Sstevel@tonic-gate 	case IPPROTO_PIM:	return ("IPPROTO_PIM");
1539*7c478bd9Sstevel@tonic-gate 	case IPPROTO_SCTP:	return ("IPPROTO_SCTP");
1540*7c478bd9Sstevel@tonic-gate 	case IPPROTO_RAW:	return ("IPPROTO_RAW");
1541*7c478bd9Sstevel@tonic-gate 	default:		return (NULL);
1542*7c478bd9Sstevel@tonic-gate 	}
1543*7c478bd9Sstevel@tonic-gate }
1544