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