xref: /titanic_52/usr/src/cmd/truss/codes.c (revision 3c112a2b34403220c06c3e2fcac403358cfba168)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
26 /*	  All Rights Reserved  	*/
27 
28 
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <unistd.h>
32 #include <sys/types.h>
33 #include <libproc.h>
34 
35 #include <ctype.h>
36 #include <string.h>
37 #include <sys/dlpi.h>
38 #include <sys/ipc.h>
39 #include <sys/ipc_impl.h>
40 #include <sys/msg.h>
41 #include <sys/sem.h>
42 #include <sys/shm.h>
43 #include <sys/fstyp.h>
44 #if defined(__i386) || defined(__amd64)
45 #include <sys/sysi86.h>
46 #endif /* __i386 */
47 #include <sys/unistd.h>
48 #include <sys/file.h>
49 #include <sys/tiuser.h>
50 #include <sys/timod.h>
51 #include <sys/stream.h>
52 #include <sys/stropts.h>
53 #include <sys/termios.h>
54 #include <sys/termiox.h>
55 #include <sys/jioctl.h>
56 #include <sys/filio.h>
57 #include <fcntl.h>
58 #include <sys/termio.h>
59 #include <sys/stermio.h>
60 #include <sys/ttold.h>
61 #include <sys/mount.h>
62 #include <sys/utssys.h>
63 #include <sys/sysconfig.h>
64 #include <sys/statvfs.h>
65 #include <sys/kstat.h>
66 #include <sys/audio.h>
67 #include <sys/mixer.h>
68 #include <sys/cpc_impl.h>
69 #include <sys/devpoll.h>
70 #include <sys/strredir.h>
71 #include <sys/sockio.h>
72 #include <netinet/ip_mroute.h>
73 #include <net/if.h>
74 #include <net/if_arp.h>
75 #include <sys/ptyvar.h>
76 #include <sys/des.h>
77 #include <sys/prnio.h>
78 #include <sys/dtrace.h>
79 #include <sys/crypto/ioctladmin.h>
80 #include <sys/crypto/ioctl.h>
81 #include <sys/kbio.h>
82 #include <sys/ptms.h>
83 #include <sys/aggr.h>
84 #include <sys/dld.h>
85 #include <net/simnet.h>
86 #include <sys/vnic.h>
87 #include <sys/fs/zfs.h>
88 #include <inet/kssl/kssl.h>
89 #include <sys/dkio.h>
90 #include <sys/fdio.h>
91 #include <sys/cdio.h>
92 #include <sys/scsi/impl/uscsi.h>
93 #include <sys/devinfo_impl.h>
94 #include <sys/dumpadm.h>
95 #include <sys/mntio.h>
96 #include <inet/iptun.h>
97 #include <sys/zcons.h>
98 #include <sys/usb/clients/hid/hid.h>
99 #include <sys/pm.h>
100 #include <sys/soundcard.h>
101 
102 #include "ramdata.h"
103 #include "proto.h"
104 
105 #define	FCNTLMIN	F_DUPFD
106 #define	FCNTLMAX	F_BADFD
107 const char *const FCNTLname[] = {
108 	"F_DUPFD",
109 	"F_GETFD",
110 	"F_SETFD",
111 	"F_GETFL",
112 	"F_SETFL",
113 	"F_O_GETLK",
114 	"F_SETLK",
115 	"F_SETLKW",
116 	"F_CHKFL",
117 	"F_DUP2FD",
118 	"F_ALLOCSP",
119 	"F_FREESP",
120 	NULL,		/* 12 */
121 	NULL,		/* 13 */
122 	"F_GETLK",
123 	NULL,		/* 15 */
124 	NULL,		/* 16 */
125 	NULL,		/* 17 */
126 	NULL,		/* 18 */
127 	NULL,		/* 19 */
128 	NULL,		/* 20 */
129 	NULL,		/* 21 */
130 	NULL,		/* 22 */
131 	"F_GETOWN",
132 	"F_SETOWN",
133 	"F_REVOKE",
134 	"F_HASREMOTELOCKS",
135 	"F_FREESP64",
136 	NULL,		/* 28 */
137 	NULL,		/* 29 */
138 	NULL,		/* 30 */
139 	NULL,		/* 31 */
140 	NULL,		/* 32 */
141 	"F_GETLK64",
142 	"F_SETLK64",
143 	"F_SETLKW64",
144 	NULL,		/* 36 */
145 	NULL,		/* 37 */
146 	NULL,		/* 38 */
147 	NULL,		/* 39 */
148 	"F_SHARE",
149 	"F_UNSHARE",
150 	"F_SETLK_NBMAND",
151 	"F_SHARE_NBMAND",
152 	"F_SETLK64_NBMAND",
153 	NULL,		/* 45 */
154 	"F_BADFD"
155 };
156 
157 #define	SYSFSMIN	GETFSIND
158 #define	SYSFSMAX	GETNFSTYP
159 const char *const SYSFSname[] = {
160 	"GETFSIND",
161 	"GETFSTYP",
162 	"GETNFSTYP"
163 };
164 
165 #define	SCONFMIN	_CONFIG_NGROUPS
166 #define	SCONFMAX	_CONFIG_EPHID_MAX
167 const char *const SCONFname[] = {
168 	"_CONFIG_NGROUPS",		/*  2 */
169 	"_CONFIG_CHILD_MAX",		/*  3 */
170 	"_CONFIG_OPEN_FILES",		/*  4 */
171 	"_CONFIG_POSIX_VER",		/*  5 */
172 	"_CONFIG_PAGESIZE",		/*  6 */
173 	"_CONFIG_CLK_TCK",		/*  7 */
174 	"_CONFIG_XOPEN_VER",		/*  8 */
175 	"_CONFIG_HRESCLK_TCK",		/*  9 */
176 	"_CONFIG_PROF_TCK",		/* 10 */
177 	"_CONFIG_NPROC_CONF",		/* 11 */
178 	"_CONFIG_NPROC_ONLN",		/* 12 */
179 	"_CONFIG_AIO_LISTIO_MAX",	/* 13 */
180 	"_CONFIG_AIO_MAX",		/* 14 */
181 	"_CONFIG_AIO_PRIO_DELTA_MAX",	/* 15 */
182 	"_CONFIG_DELAYTIMER_MAX",	/* 16 */
183 	"_CONFIG_MQ_OPEN_MAX",		/* 17 */
184 	"_CONFIG_MQ_PRIO_MAX",		/* 18 */
185 	"_CONFIG_RTSIG_MAX",		/* 19 */
186 	"_CONFIG_SEM_NSEMS_MAX",	/* 20 */
187 	"_CONFIG_SEM_VALUE_MAX",	/* 21 */
188 	"_CONFIG_SIGQUEUE_MAX",		/* 22 */
189 	"_CONFIG_SIGRT_MIN",		/* 23 */
190 	"_CONFIG_SIGRT_MAX",		/* 24 */
191 	"_CONFIG_TIMER_MAX",		/* 25 */
192 	"_CONFIG_PHYS_PAGES",		/* 26 */
193 	"_CONFIG_AVPHYS_PAGES",		/* 27 */
194 	"_CONFIG_COHERENCY",		/* 28 */
195 	"_CONFIG_SPLIT_CACHE",		/* 29 */
196 	"_CONFIG_ICACHESZ",		/* 30 */
197 	"_CONFIG_DCACHESZ",		/* 31 */
198 	"_CONFIG_ICACHELINESZ",		/* 32 */
199 	"_CONFIG_DCACHELINESZ",		/* 33 */
200 	"_CONFIG_ICACHEBLKSZ",		/* 34 */
201 	"_CONFIG_DCACHEBLKSZ",		/* 35 */
202 	"_CONFIG_DCACHETBLKSZ",		/* 36 */
203 	"_CONFIG_ICACHE_ASSOC",		/* 37 */
204 	"_CONFIG_DCACHE_ASSOC",		/* 38 */
205 	NULL,				/* 39 */
206 	NULL,				/* 40 */
207 	NULL,				/* 41 */
208 	"_CONFIG_MAXPID",		/* 42 */
209 	"_CONFIG_STACK_PROT",		/* 43 */
210 	"_CONFIG_NPROC_MAX",		/* 44 */
211 	"_CONFIG_CPUID_MAX",		/* 45 */
212 	"_CONFIG_SYMLOOP_MAX",		/* 46 */
213 	"_CONFIG_EPHID_MAX",		/* 47 */
214 };
215 
216 #define	PATHCONFMIN	_PC_LINK_MAX
217 #define	PATHCONFMAX	_PC_XATTR_EXISTS
218 const char *const PATHCONFname[] = {
219 	"_PC_LINK_MAX",			/*  1 */
220 	"_PC_MAX_CANON",		/*  2 */
221 	"_PC_MAX_INPUT",		/*  3 */
222 	"_PC_NAME_MAX",			/*  4 */
223 	"_PC_PATH_MAX",			/*  5 */
224 	"_PC_PIPE_BUF",			/*  6 */
225 	"_PC_NO_TRUNC",			/*  7 */
226 	"_PC_VDISABLE",			/*  8 */
227 	"_PC_CHOWN_RESTRICTED",		/*  9 */
228 	"_PC_ASYNC_IO",			/* 10 */
229 	"_PC_PRIO_IO",			/* 11 */
230 	"_PC_SYNC_IO",			/* 12 */
231 	"_PC_ALLOC_SIZE_MIN",		/* 13 */
232 	"_PC_REC_INCR_XFER_SIZE",	/* 14 */
233 	"_PC_REC_MAX_XFER_SIZE",	/* 15 */
234 	"_PC_REC_MIN_XFER_SIZE",	/* 16 */
235 	"_PC_REC_XFER_ALIGN",		/* 17 */
236 	"_PC_SYMLINK_MAX",		/* 18 */
237 	"_PC_2_SYMLINKS",		/* 19 */
238 	"_PC_ACL_ENABLED",		/* 20 */
239 	"_PC_MIN_HOLE_SIZE",		/* 21 */
240 	"_PC_CASE_BEHAVIOR",		/* 22 */
241 	"_PC_SATTR_ENABLED",		/* 23 */
242 	"_PC_SATTR_EXISTS",		/* 24 */
243 	"_PC_ACCESS_FILTERING",		/* 25 */
244 	"_PC_TIMESTAMP_RESOLUTION",	/* 26 */
245 	NULL,				/* 27 */
246 	NULL,				/* 28 */
247 	NULL,				/* 29 */
248 	NULL,				/* 30 */
249 	NULL,				/* 31 */
250 	NULL,				/* 32 */
251 	NULL,				/* 33 */
252 	NULL,				/* 34 */
253 	NULL,				/* 35 */
254 	NULL,				/* 36 */
255 	NULL,				/* 37 */
256 	NULL,				/* 38 */
257 	NULL,				/* 39 */
258 	NULL,				/* 40 */
259 	NULL,				/* 41 */
260 	NULL,				/* 42 */
261 	NULL,				/* 43 */
262 	NULL,				/* 44 */
263 	NULL,				/* 45 */
264 	NULL,				/* 46 */
265 	NULL,				/* 47 */
266 	NULL,				/* 48 */
267 	NULL,				/* 49 */
268 	NULL,				/* 50 */
269 	NULL,				/* 51 */
270 	NULL,				/* 52 */
271 	NULL,				/* 53 */
272 	NULL,				/* 54 */
273 	NULL,				/* 55 */
274 	NULL,				/* 56 */
275 	NULL,				/* 57 */
276 	NULL,				/* 58 */
277 	NULL,				/* 59 */
278 	NULL,				/* 60 */
279 	NULL,				/* 61 */
280 	NULL,				/* 62 */
281 	NULL,				/* 63 */
282 	NULL,				/* 64 */
283 	NULL,				/* 65 */
284 	NULL,				/* 66 */
285 	"_PC_FILESIZEBITS",		/* 67 */
286 	NULL,				/* 68 */
287 	NULL,				/* 69 */
288 	NULL,				/* 70 */
289 	NULL,				/* 71 */
290 	NULL,				/* 72 */
291 	NULL,				/* 73 */
292 	NULL,				/* 74 */
293 	NULL,				/* 75 */
294 	NULL,				/* 76 */
295 	NULL,				/* 77 */
296 	NULL,				/* 78 */
297 	NULL,				/* 79 */
298 	NULL,				/* 80 */
299 	NULL,				/* 81 */
300 	NULL,				/* 82 */
301 	NULL,				/* 83 */
302 	NULL,				/* 84 */
303 	NULL,				/* 85 */
304 	NULL,				/* 86 */
305 	NULL,				/* 87 */
306 	NULL,				/* 88 */
307 	NULL,				/* 89 */
308 	NULL,				/* 90 */
309 	NULL,				/* 91 */
310 	NULL,				/* 92 */
311 	NULL,				/* 93 */
312 	NULL,				/* 94 */
313 	NULL,				/* 95 */
314 	NULL,				/* 96 */
315 	NULL,				/* 97 */
316 	NULL,				/* 98 */
317 	NULL,				/* 99 */
318 	"_PC_XATTR_ENABLED",		/* 100 */
319 	"_PC_XATTR_EXISTS",		/* 101, _PC_LAST */
320 };
321 
322 const struct ioc {
323 	uint_t	code;
324 	const char *name;
325 	const char *datastruct;
326 } ioc[] = {
327 	{ (uint_t)TCGETA,	"TCGETA",	NULL },
328 	{ (uint_t)TCSETA,	"TCSETA",	NULL },
329 	{ (uint_t)TCSETAW,	"TCSETAW",	NULL },
330 	{ (uint_t)TCSETAF,	"TCSETAF",	NULL },
331 	{ (uint_t)TCFLSH,	"TCFLSH",	NULL },
332 	{ (uint_t)TIOCKBON,	"TIOCKBON",	NULL },
333 	{ (uint_t)TIOCKBOF,	"TIOCKBOF",	NULL },
334 	{ (uint_t)KBENABLED,	"KBENABLED",	NULL },
335 	{ (uint_t)TCGETS,	"TCGETS",	NULL },
336 	{ (uint_t)TCSETS,	"TCSETS",	NULL },
337 	{ (uint_t)TCSETSW,	"TCSETSW",	NULL },
338 	{ (uint_t)TCSETSF,	"TCSETSF",	NULL },
339 	{ (uint_t)TCXONC,	"TCXONC",	NULL },
340 	{ (uint_t)TCSBRK,	"TCSBRK",	NULL },
341 	{ (uint_t)TCDSET,	"TCDSET",	NULL },
342 	{ (uint_t)RTS_TOG,	"RTS_TOG",	NULL },
343 	{ (uint_t)TIOCSWINSZ,	"TIOCSWINSZ",	NULL },
344 	{ (uint_t)TIOCGWINSZ,	"TIOCGWINSZ",	NULL },
345 	{ (uint_t)TIOCGETD,	"TIOCGETD",	NULL },
346 	{ (uint_t)TIOCSETD,	"TIOCSETD",	NULL },
347 	{ (uint_t)TIOCHPCL,	"TIOCHPCL",	NULL },
348 	{ (uint_t)TIOCGETP,	"TIOCGETP",	NULL },
349 	{ (uint_t)TIOCSETP,	"TIOCSETP",	NULL },
350 	{ (uint_t)TIOCSETN,	"TIOCSETN",	NULL },
351 	{ (uint_t)TIOCEXCL,	"TIOCEXCL",	NULL },
352 	{ (uint_t)TIOCNXCL,	"TIOCNXCL",	NULL },
353 	{ (uint_t)TIOCFLUSH,	"TIOCFLUSH",	NULL },
354 	{ (uint_t)TIOCSETC,	"TIOCSETC",	NULL },
355 	{ (uint_t)TIOCGETC,	"TIOCGETC",	NULL },
356 	{ (uint_t)TIOCGPGRP,	"TIOCGPGRP",	NULL },
357 	{ (uint_t)TIOCSPGRP,	"TIOCSPGRP",	NULL },
358 	{ (uint_t)TIOCGSID,	"TIOCGSID",	NULL },
359 	{ (uint_t)TIOCSTI,	"TIOCSTI",	NULL },
360 	{ (uint_t)TIOCMSET,	"TIOCMSET",	NULL },
361 	{ (uint_t)TIOCMBIS,	"TIOCMBIS",	NULL },
362 	{ (uint_t)TIOCMBIC,	"TIOCMBIC",	NULL },
363 	{ (uint_t)TIOCMGET,	"TIOCMGET",	NULL },
364 	{ (uint_t)TIOCREMOTE,	"TIOCREMOTE",	NULL },
365 	{ (uint_t)TIOCSIGNAL,	"TIOCSIGNAL",	NULL },
366 	{ (uint_t)TIOCSTART,	"TIOCSTART",	NULL },
367 	{ (uint_t)TIOCSTOP,	"TIOCSTOP",	NULL },
368 	{ (uint_t)TIOCNOTTY,	"TIOCNOTTY",	NULL },
369 	{ (uint_t)TIOCSCTTY,	"TIOCSCTTY",	NULL },
370 	{ (uint_t)TIOCOUTQ,	"TIOCOUTQ",	NULL },
371 	{ (uint_t)TIOCGLTC,	"TIOCGLTC",	NULL },
372 	{ (uint_t)TIOCSLTC,	"TIOCSLTC",	NULL },
373 	{ (uint_t)TIOCCDTR,	"TIOCCDTR",	NULL },
374 	{ (uint_t)TIOCSDTR,	"TIOCSDTR",	NULL },
375 	{ (uint_t)TIOCCBRK,	"TIOCCBRK",	NULL },
376 	{ (uint_t)TIOCSBRK,	"TIOCSBRK",	NULL },
377 	{ (uint_t)TIOCLGET,	"TIOCLGET",	NULL },
378 	{ (uint_t)TIOCLSET,	"TIOCLSET",	NULL },
379 	{ (uint_t)TIOCLBIC,	"TIOCLBIC",	NULL },
380 	{ (uint_t)TIOCLBIS,	"TIOCLBIS",	NULL },
381 
382 	{ (uint_t)TIOCSILOOP,	"TIOCSILOOP",	NULL },
383 	{ (uint_t)TIOCCILOOP,	"TIOCSILOOP",	NULL },
384 
385 	{ (uint_t)TIOCGPPS,	"TIOCGPPS",	NULL },
386 	{ (uint_t)TIOCSPPS,	"TIOCSPPS",	NULL },
387 	{ (uint_t)TIOCGPPSEV,	"TIOCGPPSEV",	NULL },
388 
389 	{ (uint_t)TIOCPKT,	"TIOCPKT",	NULL },	/* ptyvar.h */
390 	{ (uint_t)TIOCUCNTL,	"TIOCUCNTL",	NULL },
391 	{ (uint_t)TIOCTCNTL,	"TIOCTCNTL",	NULL },
392 	{ (uint_t)TIOCISPACE,	"TIOCISPACE",	NULL },
393 	{ (uint_t)TIOCISIZE,	"TIOCISIZE",	NULL },
394 	{ (uint_t)TIOCSSIZE,	"TIOCSSIZE",	"ttysize" },
395 	{ (uint_t)TIOCGSIZE,	"TIOCGSIZE",	"ttysize" },
396 
397 	/*
398 	 * Unfortunately, the DLIOC and LDIOC codes overlap.  Since the LDIOC
399 	 * ioctls (for xenix compatibility) are far less likely to be used, we
400 	 * give preference to DLIOC.
401 	 */
402 	{ (uint_t)DLIOCRAW,	"DLIOCRAW",	NULL },
403 	{ (uint_t)DLIOCNATIVE,	"DLIOCNATIVE",	NULL },
404 	{ (uint_t)DLIOCIPNETINFO, "DLIOCIPNETINFO", NULL},
405 	{ (uint_t)DLIOCLOWLINK,	"DLIOCLOWLINK",	NULL },
406 
407 	{ (uint_t)LDOPEN,	"LDOPEN",	NULL },
408 	{ (uint_t)LDCLOSE,	"LDCLOSE",	NULL },
409 	{ (uint_t)LDCHG,	"LDCHG",	NULL },
410 	{ (uint_t)LDGETT,	"LDGETT",	NULL },
411 	{ (uint_t)LDSETT,	"LDSETT",	NULL },
412 	{ (uint_t)LDSMAP,	"LDSMAP",	NULL },
413 	{ (uint_t)LDGMAP,	"LDGMAP",	NULL },
414 	{ (uint_t)LDNMAP,	"LDNMAP",	NULL },
415 	{ (uint_t)TCGETX,	"TCGETX",	NULL },
416 	{ (uint_t)TCSETX,	"TCSETX",	NULL },
417 	{ (uint_t)TCSETXW,	"TCSETXW",	NULL },
418 	{ (uint_t)TCSETXF,	"TCSETXF",	NULL },
419 	{ (uint_t)FIORDCHK,	"FIORDCHK",	NULL },
420 	{ (uint_t)FIOCLEX,	"FIOCLEX",	NULL },
421 	{ (uint_t)FIONCLEX,	"FIONCLEX",	NULL },
422 	{ (uint_t)FIONREAD,	"FIONREAD",	NULL },
423 	{ (uint_t)FIONBIO,	"FIONBIO",	NULL },
424 	{ (uint_t)FIOASYNC,	"FIOASYNC",	NULL },
425 	{ (uint_t)FIOSETOWN,	"FIOSETOWN",	NULL },
426 	{ (uint_t)FIOGETOWN,	"FIOGETOWN",	NULL },
427 #ifdef DIOCGETP
428 	{ (uint_t)DIOCGETP,	"DIOCGETP",	NULL },
429 	{ (uint_t)DIOCSETP,	"DIOCSETP",	NULL },
430 #endif
431 #ifdef DIOCGETC
432 	{ (uint_t)DIOCGETC,	"DIOCGETC",	NULL },
433 	{ (uint_t)DIOCGETB,	"DIOCGETB",	NULL },
434 	{ (uint_t)DIOCSETE,	"DIOCSETE",	NULL },
435 #endif
436 #ifdef IFFORMAT
437 	{ (uint_t)IFFORMAT,	"IFFORMAT",	NULL },
438 	{ (uint_t)IFBCHECK,	"IFBCHECK",	NULL },
439 	{ (uint_t)IFCONFIRM,	"IFCONFIRM",	NULL },
440 #endif
441 #ifdef LIOCGETP
442 	{ (uint_t)LIOCGETP,	"LIOCGETP",	NULL },
443 	{ (uint_t)LIOCSETP,	"LIOCSETP",	NULL },
444 	{ (uint_t)LIOCGETS,	"LIOCGETS",	NULL },
445 	{ (uint_t)LIOCSETS,	"LIOCSETS",	NULL },
446 #endif
447 #ifdef JBOOT
448 	{ (uint_t)JBOOT,	"JBOOT",	NULL },
449 	{ (uint_t)JTERM,	"JTERM",	NULL },
450 	{ (uint_t)JMPX,		"JMPX",	NULL },
451 #ifdef JTIMO
452 	{ (uint_t)JTIMO,	"JTIMO",	NULL },
453 #endif
454 	{ (uint_t)JWINSIZE,	"JWINSIZE",	NULL },
455 	{ (uint_t)JTIMOM,	"JTIMOM",	NULL },
456 	{ (uint_t)JZOMBOOT,	"JZOMBOOT",	NULL },
457 	{ (uint_t)JAGENT,	"JAGENT",	NULL },
458 	{ (uint_t)JTRUN,	"JTRUN",	NULL },
459 	{ (uint_t)JXTPROTO,	"JXTPROTO",	NULL },
460 #endif
461 	{ (uint_t)KSTAT_IOC_CHAIN_ID,	"KSTAT_IOC_CHAIN_ID",	NULL },
462 	{ (uint_t)KSTAT_IOC_READ,	"KSTAT_IOC_READ",	NULL },
463 	{ (uint_t)KSTAT_IOC_WRITE,	"KSTAT_IOC_WRITE",	NULL },
464 	{ (uint_t)STGET,	"STGET",	NULL },
465 	{ (uint_t)STSET,	"STSET",	NULL },
466 	{ (uint_t)STTHROW,	"STTHROW",	NULL },
467 	{ (uint_t)STWLINE,	"STWLINE",	NULL },
468 	{ (uint_t)STTSV,	"STTSV",	NULL },
469 	{ (uint_t)I_NREAD,	"I_NREAD",	NULL },
470 	{ (uint_t)I_PUSH,	"I_PUSH",	NULL },
471 	{ (uint_t)I_POP,	"I_POP",	NULL },
472 	{ (uint_t)I_LOOK,	"I_LOOK",	NULL },
473 	{ (uint_t)I_FLUSH,	"I_FLUSH",	NULL },
474 	{ (uint_t)I_SRDOPT,	"I_SRDOPT",	NULL },
475 	{ (uint_t)I_GRDOPT,	"I_GRDOPT",	NULL },
476 	{ (uint_t)I_STR,	"I_STR",	NULL },
477 	{ (uint_t)I_SETSIG,	"I_SETSIG",	NULL },
478 	{ (uint_t)I_GETSIG,	"I_GETSIG",	NULL },
479 	{ (uint_t)I_FIND,	"I_FIND",	NULL },
480 	{ (uint_t)I_LINK,	"I_LINK",	NULL },
481 	{ (uint_t)I_UNLINK,	"I_UNLINK",	NULL },
482 	{ (uint_t)I_PEEK,	"I_PEEK",	NULL },
483 	{ (uint_t)I_FDINSERT,	"I_FDINSERT",	NULL },
484 	{ (uint_t)I_SENDFD,	"I_SENDFD",	NULL },
485 	{ (uint_t)I_RECVFD,	"I_RECVFD",	NULL },
486 	{ (uint_t)I_SWROPT,	"I_SWROPT",	NULL },
487 	{ (uint_t)I_GWROPT,	"I_GWROPT",	NULL },
488 	{ (uint_t)I_LIST,	"I_LIST",	NULL },
489 	{ (uint_t)I_PLINK,	"I_PLINK",	NULL },
490 	{ (uint_t)I_PUNLINK,	"I_PUNLINK",	NULL },
491 	{ (uint_t)I_FLUSHBAND,	"I_FLUSHBAND",	NULL },
492 	{ (uint_t)I_CKBAND,	"I_CKBAND",	NULL },
493 	{ (uint_t)I_GETBAND,	"I_GETBAND",	NULL },
494 	{ (uint_t)I_ATMARK,	"I_ATMARK",	NULL },
495 	{ (uint_t)I_SETCLTIME,	"I_SETCLTIME",	NULL },
496 	{ (uint_t)I_GETCLTIME,	"I_GETCLTIME",	NULL },
497 	{ (uint_t)I_CANPUT,	"I_CANPUT",	NULL },
498 	{ (uint_t)I_ANCHOR,	"I_ANCHOR",	NULL },
499 	{ (uint_t)_I_CMD,	"_I_CMD",	NULL },
500 #ifdef TI_GETINFO
501 	{ (uint_t)TI_GETINFO,	"TI_GETINFO",	NULL },
502 	{ (uint_t)TI_OPTMGMT,	"TI_OPTMGMT",	NULL },
503 	{ (uint_t)TI_BIND,	"TI_BIND",	NULL },
504 	{ (uint_t)TI_UNBIND,	"TI_UNBIND",	NULL },
505 #endif
506 #ifdef	TI_CAPABILITY
507 	{ (uint_t)TI_CAPABILITY,	"TI_CAPABILITY",	NULL },
508 #endif
509 #ifdef TI_GETMYNAME
510 	{ (uint_t)TI_GETMYNAME,		"TI_GETMYNAME",		NULL },
511 	{ (uint_t)TI_GETPEERNAME,	"TI_GETPEERNAME",	NULL },
512 	{ (uint_t)TI_SETMYNAME,		"TI_SETMYNAME",		NULL },
513 	{ (uint_t)TI_SETPEERNAME,	"TI_SETPEERNAME",	NULL },
514 #endif
515 #ifdef V_PREAD
516 	{ (uint_t)V_PREAD,	"V_PREAD",	NULL },
517 	{ (uint_t)V_PWRITE,	"V_PWRITE",	NULL },
518 	{ (uint_t)V_PDREAD,	"V_PDREAD",	NULL },
519 	{ (uint_t)V_PDWRITE,	"V_PDWRITE",	NULL },
520 #if !defined(__i386) && !defined(__amd64)
521 	{ (uint_t)V_GETSSZ,	"V_GETSSZ",	NULL },
522 #endif /* !__i386 */
523 #endif
524 	/* audio */
525 	{ (uint_t)AUDIO_GETINFO,	"AUDIO_GETINFO",	NULL },
526 	{ (uint_t)AUDIO_SETINFO,	"AUDIO_SETINFO",	NULL },
527 	{ (uint_t)AUDIO_DRAIN,		"AUDIO_DRAIN",		NULL },
528 	{ (uint_t)AUDIO_GETDEV,		"AUDIO_GETDEV",		NULL },
529 	{ (uint_t)AUDIO_DIAG_LOOPBACK,	"AUDIO_DIAG_LOOPBACK",	NULL },
530 	{ (uint_t)AUDIO_GET_CH_NUMBER,	"AUDIO_GET_CH_NUMBER",	NULL },
531 	{ (uint_t)AUDIO_GET_CH_TYPE,	"AUDIO_GET_CH_TYPE",	NULL },
532 	{ (uint_t)AUDIO_GET_NUM_CHS,	"AUDIO_GET_NUM_CHS",	NULL },
533 	{ (uint_t)AUDIO_GET_AD_DEV,	"AUDIO_GET_AD_DEV",	NULL },
534 	{ (uint_t)AUDIO_GET_APM_DEV,	"AUDIO_GET_APM_DEV",	NULL },
535 	{ (uint_t)AUDIO_GET_AS_DEV,	"AUDIO_GET_AS_DEV",	NULL },
536 	{ (uint_t)AUDIO_MIXER_MULTIPLE_OPEN,	"AUDIO_MIXER_MULTIPLE_OPEN",
537 	    NULL },
538 	{ (uint_t)AUDIO_MIXER_SINGLE_OPEN,	"AUDIO_MIXER_SINGLE_OPEN",
539 	    NULL },
540 	{ (uint_t)AUDIO_MIXER_GET_SAMPLE_RATES,	"AUDIO_MIXER_GET_SAMPLE_RATES",
541 	    NULL },
542 	{ (uint_t)AUDIO_MIXERCTL_GETINFO,	"AUDIO_MIXERCTL_GETINFO",
543 	    NULL },
544 	{ (uint_t)AUDIO_MIXERCTL_SETINFO,	"AUDIO_MIXERCTL_SETINFO",
545 	    NULL },
546 	{ (uint_t)AUDIO_MIXERCTL_GET_CHINFO,	"AUDIO_MIXERCTL_GET_CHINFO",
547 	    NULL },
548 	{ (uint_t)AUDIO_MIXERCTL_SET_CHINFO,	"AUDIO_MIXERCTL_SET_CHINFO",
549 	    NULL },
550 	{ (uint_t)AUDIO_MIXERCTL_GET_MODE,	"AUDIO_MIXERCTL_GET_MODE",
551 	    NULL },
552 	{ (uint_t)AUDIO_MIXERCTL_SET_MODE,	"AUDIO_MIXERCTL_SET_MODE",
553 	    NULL },
554 	/* new style Boomer (OSS) ioctls */
555 	{ (uint_t)SNDCTL_SYSINFO,	"SNDCTL_SYSINFO",	NULL },
556 	{ (uint_t)SNDCTL_AUDIOINFO,	"SNDCTL_AUDIOINFO",	NULL },
557 	{ (uint_t)SNDCTL_AUDIOINFO_EX,	"SNDCTL_AUDIOINFO_EX",	NULL },
558 	{ (uint_t)SNDCTL_MIXERINFO,	"SNDCTL_MIXERINFO",	NULL },
559 	{ (uint_t)SNDCTL_CARDINFO,	"SNDCTL_CARDINFO",	NULL },
560 	{ (uint_t)SNDCTL_ENGINEINFO,	"SNDCTL_ENGINEINFO",	NULL },
561 	{ (uint_t)SNDCTL_MIX_NRMIX,	"SNDCTL_MIX_NRMIX",	NULL },
562 	{ (uint_t)SNDCTL_MIX_NREXT,	"SNDCTL_MIX_NREXT",	NULL },
563 	{ (uint_t)SNDCTL_MIX_EXTINFO,	"SNDCTL_MIX_EXTINFO",	NULL },
564 	{ (uint_t)SNDCTL_MIX_READ,	"SNDCTL_MIX_READ",	NULL },
565 	{ (uint_t)SNDCTL_MIX_WRITE,	"SNDCTL_MIX_WRITE",	NULL },
566 	{ (uint_t)SNDCTL_MIX_ENUMINFO,	"SNDCTL_MIX_ENUMINFO",	NULL },
567 	{ (uint_t)SNDCTL_MIX_DESCRIPTION,	"SNDCTL_MIX_DESCRIPTION",
568 	    NULL },
569 	{ (uint_t)SNDCTL_SETSONG,	"SNDCTL_SETSONG",	NULL },
570 	{ (uint_t)SNDCTL_GETSONG,	"SNDCTL_GETSONG",	NULL },
571 	{ (uint_t)SNDCTL_SETNAME,	"SNDCTL_SETNAME",	NULL },
572 	{ (uint_t)SNDCTL_SETLABEL,	"SNDCTL_SETLABEL",	NULL },
573 	{ (uint_t)SNDCTL_GETLABEL,	"SNDCTL_GETLABEL",	NULL },
574 	{ (uint_t)SNDCTL_DSP_HALT,	"SNDCTL_DSP_HALT",	NULL },
575 	{ (uint_t)SNDCTL_DSP_RESET,	"SNDCTL_DSP_RESET",	NULL },
576 	{ (uint_t)SNDCTL_DSP_SYNC,	"SNDCTL_DSP_SYNC",	NULL },
577 	{ (uint_t)SNDCTL_DSP_SPEED,	"SNDCTL_DSP_SPEED",	NULL },
578 	{ (uint_t)SNDCTL_DSP_STEREO,	"SNDCTL_DSP_STEREO",	NULL },
579 	{ (uint_t)SNDCTL_DSP_GETBLKSIZE,	"SNDCTL_DSP_GETBLKSIZE",
580 	    NULL },
581 	{ (uint_t)SNDCTL_DSP_SAMPLESIZE,	"SNDCTL_DSP_SAMPLESIZE",
582 	    NULL },
583 	{ (uint_t)SNDCTL_DSP_CHANNELS,	"SNDCTL_DSP_CHANNELS",  NULL },
584 	{ (uint_t)SNDCTL_DSP_POST,	"SNDCTL_DSP_POST",	NULL },
585 	{ (uint_t)SNDCTL_DSP_SUBDIVIDE,	"SNDCTL_DSP_SUBDIVIDE",	NULL },
586 	{ (uint_t)SNDCTL_DSP_SETFRAGMENT,	"SNDCTL_DSP_SETFRAGMENT",
587 	    NULL },
588 	{ (uint_t)SNDCTL_DSP_GETFMTS,	"SNDCTL_DSP_GETFMTS",	NULL },
589 	{ (uint_t)SNDCTL_DSP_SETFMT,	"SNDCTL_DSP_SETFMT",	NULL },
590 	{ (uint_t)SNDCTL_DSP_GETOSPACE,	"SNDCTL_DSP_GETOSPACE",	NULL },
591 	{ (uint_t)SNDCTL_DSP_GETISPACE,	"SNDCTL_DSP_GETISPACE",	NULL },
592 	{ (uint_t)SNDCTL_DSP_GETCAPS,	"SNDCTL_DSP_CAPS",	NULL },
593 	{ (uint_t)SNDCTL_DSP_GETTRIGGER,	"SNDCTL_DSP_GETTRIGGER",
594 	    NULL },
595 	{ (uint_t)SNDCTL_DSP_SETTRIGGER,	"SNDCTL_DSP_SETTRIGGER",
596 	    NULL },
597 	{ (uint_t)SNDCTL_DSP_GETIPTR,	"SNDCTL_DSP_GETIPTR",	NULL },
598 	{ (uint_t)SNDCTL_DSP_GETOPTR,	"SNDCTL_DSP_GETOPTR",	NULL },
599 	{ (uint_t)SNDCTL_DSP_SETSYNCRO,	"SNDCTL_DSP_SETSYNCRO",	NULL },
600 	{ (uint_t)SNDCTL_DSP_SETDUPLEX,	"SNDCTL_DSP_SETDUPLEX",	NULL },
601 	{ (uint_t)SNDCTL_DSP_PROFILE,	"SNDCTL_DSP_PROFILE",	NULL },
602 	{ (uint_t)SNDCTL_DSP_GETODELAY,	"SNDCTL_DSP_GETODELAY",	NULL },
603 	{ (uint_t)SNDCTL_DSP_GETPLAYVOL,	"SNDCTL_DSP_GETPLAYVOL",
604 	    NULL },
605 	{ (uint_t)SNDCTL_DSP_SETPLAYVOL,	"SNDCTL_DSP_SETPLAYVOL",
606 	    NULL },
607 	{ (uint_t)SNDCTL_DSP_GETERROR,	"SNDCTL_DSP_GETERROR",	NULL },
608 	{ (uint_t)SNDCTL_DSP_READCTL,	"SNDCTL_DSP_READCTL",	NULL },
609 	{ (uint_t)SNDCTL_DSP_WRITECTL,	"SNDCTL_DSP_WRITECTL",	NULL },
610 	{ (uint_t)SNDCTL_DSP_SYNCGROUP,	"SNDCTL_DSP_SYNCGROUP",	NULL },
611 	{ (uint_t)SNDCTL_DSP_SYNCSTART,	"SNDCTL_DSP_SYNCSTART",	NULL },
612 	{ (uint_t)SNDCTL_DSP_COOKEDMODE,	"SNDCTL_DSP_COOKEDMODE",
613 	    NULL },
614 	{ (uint_t)SNDCTL_DSP_SILENCE,	"SNDCTL_DSP_SILENCE",	NULL },
615 	{ (uint_t)SNDCTL_DSP_SKIP,	"SNDCTL_DSP_SKIP",	NULL },
616 	{ (uint_t)SNDCTL_DSP_HALT_INPUT,	"SNDCTL_DSP_HALT_INPUT",
617 	    NULL },
618 	{ (uint_t)SNDCTL_DSP_HALT_OUTPUT,	"SNDCTL_DSP_HALT_OUTPUT",
619 	    NULL },
620 	{ (uint_t)SNDCTL_DSP_LOW_WATER,	"SNDCTL_DSP_LOW_WATER",	NULL },
621 	{ (uint_t)SNDCTL_DSP_CURRENT_OPTR,	"SNDCTL_DSP_CURRENT_OPTR",
622 	    NULL },
623 	{ (uint_t)SNDCTL_DSP_CURRENT_IPTR,	"SNDCTL_DSP_CURRENT_IPTR",
624 	    NULL },
625 	{ (uint_t)SNDCTL_DSP_GET_RECSRC_NAMES,	"SNDCTL_DSP_GET_RECSRC_NAMES",
626 	    NULL },
627 	{ (uint_t)SNDCTL_DSP_GET_RECSRC,	"SNDCTL_DSP_GET_RECSRC",
628 	    NULL },
629 	{ (uint_t)SNDCTL_DSP_SET_RECSRC,	"SNDCTL_DSP_SET_RECSRC",
630 	    NULL },
631 	{ (uint_t)SNDCTL_DSP_GET_PLAYTGT_NAMES,	"SNDCTL_DSP_GET_PLAYTGT_NAMES",
632 	    NULL },
633 	{ (uint_t)SNDCTL_DSP_GET_PLAYTGT,	"SNDCTL_DSP_GET_PLAYTGT",
634 	    NULL },
635 	{ (uint_t)SNDCTL_DSP_SET_PLAYTGT,	"SNDCTL_DSP_SET_PLAYTGT",
636 	    NULL },
637 	{ (uint_t)SNDCTL_DSP_GETRECVOL,		"SNDCTL_DSP_GETRECVOL",
638 	    NULL },
639 	{ (uint_t)SNDCTL_DSP_SETRECVOL,		"SNDCTL_DSP_SETRECVOL",
640 	    NULL },
641 	{ (uint_t)SNDCTL_DSP_GET_CHNORDER,	"SNDCTL_DSP_GET_CHNORDER",
642 	    NULL },
643 	{ (uint_t)SNDCTL_DSP_SET_CHNORDER,	"SNDCTL_DSP_SET_CHNORDER",
644 	    NULL },
645 	{ (uint_t)SNDCTL_DSP_GETIPEAKS,	"SNDCTL_DSP_GETIPEAKS",	NULL },
646 	{ (uint_t)SNDCTL_DSP_GETOPEAKS,	"SNDCTL_DSP_GETOPEAKS",	NULL },
647 	{ (uint_t)SNDCTL_DSP_POLICY,	"SNDCTL_DSP_POLICY",	NULL },
648 	{ (uint_t)SNDCTL_DSP_GETCHANNELMASK,	"SNDCTL_DSP_GETCHANNELMASK",
649 	    NULL },
650 	{ (uint_t)SNDCTL_DSP_BIND_CHANNEL,	"SNDCTL_DSP_BIND_CHANNEL",
651 	    NULL },
652 	{ (uint_t)SOUND_MIXER_READ_VOLUME,	"SOUND_MIXER_READ_VOLUME",
653 	    NULL },
654 	{ (uint_t)SOUND_MIXER_READ_OGAIN,	"SOUND_MIXER_READ_OGAIN",
655 	    NULL },
656 	{ (uint_t)SOUND_MIXER_READ_PCM,	"SOUND_MIXER_READ_PCM",	NULL },
657 	{ (uint_t)SOUND_MIXER_READ_IGAIN,	"SOUND_MIXER_READ_IGAIN",
658 	    NULL },
659 	{ (uint_t)SOUND_MIXER_READ_RECLEV,	"SOUND_MIXER_READ_RECLEV",
660 	    NULL },
661 	{ (uint_t)SOUND_MIXER_READ_RECSRC,	"SOUND_MIXER_READ_RECSRC",
662 	    NULL },
663 	{ (uint_t)SOUND_MIXER_READ_DEVMASK,	"SOUND_MIXER_READ_DEVMASK",
664 	    NULL },
665 	{ (uint_t)SOUND_MIXER_READ_RECMASK,	"SOUND_MIXER_READ_RECMASK",
666 	    NULL },
667 	{ (uint_t)SOUND_MIXER_READ_CAPS,	"SOUND_MIXER_READ_CAPS",
668 	    NULL },
669 	{ (uint_t)SOUND_MIXER_READ_STEREODEVS,	"SOUND_MIXER_READ_STEREODEVS",
670 	    NULL },
671 	{ (uint_t)SOUND_MIXER_READ_RECGAIN,	"SOUND_MIXER_READ_RECGAIN",
672 	    NULL },
673 	{ (uint_t)SOUND_MIXER_READ_MONGAIN,	"SOUND_MIXER_READ_MONGAIN",
674 	    NULL },
675 	{ (uint_t)SOUND_MIXER_WRITE_VOLUME,	"SOUND_MIXER_WRITE_VOLUME",
676 	    NULL },
677 	{ (uint_t)SOUND_MIXER_WRITE_OGAIN,	"SOUND_MIXER_WRITE_OGAIN",
678 	    NULL },
679 	{ (uint_t)SOUND_MIXER_WRITE_PCM,	"SOUND_MIXER_WRITE_PCM",
680 	    NULL },
681 	{ (uint_t)SOUND_MIXER_WRITE_IGAIN,	"SOUND_MIXER_WRITE_IGAIN",
682 	    NULL },
683 	{ (uint_t)SOUND_MIXER_WRITE_RECLEV,	"SOUND_MIXER_WRITE_RECLEV",
684 	    NULL },
685 	{ (uint_t)SOUND_MIXER_WRITE_RECSRC,	"SOUND_MIXER_WRITE_RECSRC",
686 	    NULL },
687 	{ (uint_t)SOUND_MIXER_WRITE_RECGAIN,	"SOUND_MIXER_WRITE_RECGAIN",
688 	    NULL },
689 	{ (uint_t)SOUND_MIXER_WRITE_MONGAIN,	"SOUND_MIXER_WRITE_MONGAIN",
690 	    NULL },
691 
692 	/* STREAMS redirection ioctls */
693 	{ (uint_t)SRIOCSREDIR,		"SRIOCSREDIR",	NULL },
694 	{ (uint_t)SRIOCISREDIR,		"SRIOCISREDIR",	NULL },
695 	{ (uint_t)CPCIO_BIND,		"CPCIO_BIND",		NULL },
696 	{ (uint_t)CPCIO_SAMPLE,		"CPCIO_SAMPLE",		NULL },
697 	{ (uint_t)CPCIO_RELE,		"CPCIO_RELE",		NULL },
698 	/* /dev/poll ioctl() control codes */
699 	{ (uint_t)DP_POLL,	"DP_POLL",	NULL },
700 	{ (uint_t)DP_ISPOLLED,	"DP_ISPOLLED",	NULL },
701 	/* the old /proc ioctl() control codes */
702 #define	PIOC	('q'<<8)
703 	{ (uint_t)(PIOC|1),	"PIOCSTATUS",	NULL },
704 	{ (uint_t)(PIOC|2),	"PIOCSTOP",	NULL },
705 	{ (uint_t)(PIOC|3),	"PIOCWSTOP",	NULL },
706 	{ (uint_t)(PIOC|4),	"PIOCRUN",	NULL },
707 	{ (uint_t)(PIOC|5),	"PIOCGTRACE",	NULL },
708 	{ (uint_t)(PIOC|6),	"PIOCSTRACE",	NULL },
709 	{ (uint_t)(PIOC|7),	"PIOCSSIG",	NULL },
710 	{ (uint_t)(PIOC|8),	"PIOCKILL",	NULL },
711 	{ (uint_t)(PIOC|9),	"PIOCUNKILL",	NULL },
712 	{ (uint_t)(PIOC|10),	"PIOCGHOLD",	NULL },
713 	{ (uint_t)(PIOC|11),	"PIOCSHOLD",	NULL },
714 	{ (uint_t)(PIOC|12),	"PIOCMAXSIG",	NULL },
715 	{ (uint_t)(PIOC|13),	"PIOCACTION",	NULL },
716 	{ (uint_t)(PIOC|14),	"PIOCGFAULT",	NULL },
717 	{ (uint_t)(PIOC|15),	"PIOCSFAULT",	NULL },
718 	{ (uint_t)(PIOC|16),	"PIOCCFAULT",	NULL },
719 	{ (uint_t)(PIOC|17),	"PIOCGENTRY",	NULL },
720 	{ (uint_t)(PIOC|18),	"PIOCSENTRY",	NULL },
721 	{ (uint_t)(PIOC|19),	"PIOCGEXIT",	NULL },
722 	{ (uint_t)(PIOC|20),	"PIOCSEXIT",	NULL },
723 	{ (uint_t)(PIOC|21),	"PIOCSFORK",	NULL },
724 	{ (uint_t)(PIOC|22),	"PIOCRFORK",	NULL },
725 	{ (uint_t)(PIOC|23),	"PIOCSRLC",	NULL },
726 	{ (uint_t)(PIOC|24),	"PIOCRRLC",	NULL },
727 	{ (uint_t)(PIOC|25),	"PIOCGREG",	NULL },
728 	{ (uint_t)(PIOC|26),	"PIOCSREG",	NULL },
729 	{ (uint_t)(PIOC|27),	"PIOCGFPREG",	NULL },
730 	{ (uint_t)(PIOC|28),	"PIOCSFPREG",	NULL },
731 	{ (uint_t)(PIOC|29),	"PIOCNICE",	NULL },
732 	{ (uint_t)(PIOC|30),	"PIOCPSINFO",	NULL },
733 	{ (uint_t)(PIOC|31),	"PIOCNMAP",	NULL },
734 	{ (uint_t)(PIOC|32),	"PIOCMAP",	NULL },
735 	{ (uint_t)(PIOC|33),	"PIOCOPENM",	NULL },
736 	{ (uint_t)(PIOC|34),	"PIOCCRED",	NULL },
737 	{ (uint_t)(PIOC|35),	"PIOCGROUPS",	NULL },
738 	{ (uint_t)(PIOC|36),	"PIOCGETPR",	NULL },
739 	{ (uint_t)(PIOC|37),	"PIOCGETU",	NULL },
740 	{ (uint_t)(PIOC|38),	"PIOCSET",	NULL },
741 	{ (uint_t)(PIOC|39),	"PIOCRESET",	NULL },
742 	{ (uint_t)(PIOC|43),	"PIOCUSAGE",	NULL },
743 	{ (uint_t)(PIOC|44),	"PIOCOPENPD",	NULL },
744 	{ (uint_t)(PIOC|45),	"PIOCLWPIDS",	NULL },
745 	{ (uint_t)(PIOC|46),	"PIOCOPENLWP",	NULL },
746 	{ (uint_t)(PIOC|47),	"PIOCLSTATUS",	NULL },
747 	{ (uint_t)(PIOC|48),	"PIOCLUSAGE",	NULL },
748 	{ (uint_t)(PIOC|49),	"PIOCNAUXV",	NULL },
749 	{ (uint_t)(PIOC|50),	"PIOCAUXV",	NULL },
750 	{ (uint_t)(PIOC|51),	"PIOCGXREGSIZE",	NULL },
751 	{ (uint_t)(PIOC|52),	"PIOCGXREG",	NULL },
752 	{ (uint_t)(PIOC|53),	"PIOCSXREG",	NULL },
753 	{ (uint_t)(PIOC|101),	"PIOCGWIN",	NULL },
754 	{ (uint_t)(PIOC|103),	"PIOCNLDT",	NULL },
755 	{ (uint_t)(PIOC|104),	"PIOCLDT",	NULL },
756 
757 	/* ioctl's applicable on sockets */
758 	{ (uint_t)SIOCSHIWAT,	"SIOCSHIWAT",	NULL },
759 	{ (uint_t)SIOCGHIWAT,	"SIOCGHIWAT",	NULL },
760 	{ (uint_t)SIOCSLOWAT,	"SIOCSLOWAT",	NULL },
761 	{ (uint_t)SIOCGLOWAT,	"SIOCGLOWAT",	NULL },
762 	{ (uint_t)SIOCATMARK,	"SIOCATMARK",	NULL },
763 	{ (uint_t)SIOCSPGRP,	"SIOCSPGRP",	NULL },
764 	{ (uint_t)SIOCGPGRP,	"SIOCGPGRP",	NULL },
765 	{ (uint_t)SIOCADDRT,	"SIOCADDRT",	"rtentry" },
766 	{ (uint_t)SIOCDELRT,	"SIOCDELRT",	"rtentry" },
767 	{ (uint_t)SIOCGETVIFCNT,	"SIOCGETVIFCNT", "sioc_vif_req" },
768 	{ (uint_t)SIOCGETSGCNT,	"SIOCGETSGCNT",	"sioc_sg_req" },
769 	{ (uint_t)SIOCGETLSGCNT,	"SIOCGETLSGCNT", "sioc_lsg_req" },
770 	{ (uint_t)SIOCSIFADDR,	"SIOCSIFADDR",	"ifreq" },
771 	{ (uint_t)SIOCGIFADDR,	"SIOCGIFADDR",	"ifreq" },
772 	{ (uint_t)SIOCSIFDSTADDR,	"SIOCSIFDSTADDR", "ifreq" },
773 	{ (uint_t)SIOCGIFDSTADDR,	"SIOCGIFDSTADDR", "ifreq" },
774 	{ (uint_t)SIOCSIFFLAGS,	"SIOCSIFFLAGS",	"ifreq" },
775 	{ (uint_t)SIOCGIFFLAGS,	"SIOCGIFFLAGS",	"ifreq" },
776 	{ (uint_t)SIOCSIFMEM,	"SIOCSIFMEM",	"ifreq" },
777 	{ (uint_t)SIOCGIFMEM,	"SIOCGIFMEM",	"ifreq" },
778 	{ (uint_t)SIOCGIFCONF,	"SIOCGIFCONF",	"ifconf" },
779 	{ (uint_t)SIOCSIFMTU,	"SIOCSIFMTU",	"ifreq" },
780 	{ (uint_t)SIOCGIFMTU,	"SIOCGIFMTU",	"ifreq" },
781 	{ (uint_t)SIOCGIFBRDADDR,	"SIOCGIFBRDADDR",	"ifreq" },
782 	{ (uint_t)SIOCSIFBRDADDR,	"SIOCSIFBRDADDR",	"ifreq" },
783 	{ (uint_t)SIOCGIFNETMASK,	"SIOCGIFNETMASK",	"ifreq" },
784 	{ (uint_t)SIOCSIFNETMASK,	"SIOCSIFNETMASK",	"ifreq" },
785 	{ (uint_t)SIOCGIFMETRIC,	"SIOCGIFMETRIC",	"ifreq" },
786 	{ (uint_t)SIOCSIFMETRIC,	"SIOCSIFMETRIC",	"ifreq" },
787 	{ (uint_t)SIOCSARP,	"SIOCSARP",	"arpreq" },
788 	{ (uint_t)SIOCGARP,	"SIOCGARP",	"arpreq" },
789 	{ (uint_t)SIOCDARP,	"SIOCDARP",	"arpreq" },
790 	{ (uint_t)SIOCUPPER,	"SIOCUPPER",	"ifreq" },
791 	{ (uint_t)SIOCLOWER,	"SIOCLOWER",	"ifreq" },
792 	{ (uint_t)SIOCSETSYNC,	"SIOCSETSYNC",	"ifreq" },
793 	{ (uint_t)SIOCGETSYNC,	"SIOCGETSYNC",	"ifreq" },
794 	{ (uint_t)SIOCSSDSTATS,	"SIOCSSDSTATS",	"ifreq" },
795 	{ (uint_t)SIOCSSESTATS,	"SIOCSSESTATS",	"ifreq" },
796 	{ (uint_t)SIOCSPROMISC,	"SIOCSPROMISC",	NULL },
797 	{ (uint_t)SIOCADDMULTI,	"SIOCADDMULTI",	"ifreq" },
798 	{ (uint_t)SIOCDELMULTI,	"SIOCDELMULTI",	"ifreq" },
799 	{ (uint_t)SIOCGETNAME,	"SIOCGETNAME",	"sockaddr" },
800 	{ (uint_t)SIOCGETPEER,	"SIOCGETPEER",	"sockaddr" },
801 	{ (uint_t)IF_UNITSEL,	"IF_UNITSEL",	NULL },
802 	{ (uint_t)SIOCXPROTO,	"SIOCXPROTO",	NULL },
803 	{ (uint_t)SIOCIFDETACH,	"SIOCIFDETACH",	"ifreq" },
804 	{ (uint_t)SIOCGENPSTATS,	"SIOCGENPSTATS",	"ifreq" },
805 	{ (uint_t)SIOCX25XMT,	"SIOCX25XMT",	"ifreq" },
806 	{ (uint_t)SIOCX25RCV,	"SIOCX25RCV",	"ifreq" },
807 	{ (uint_t)SIOCX25TBL,	"SIOCX25TBL",	"ifreq" },
808 	{ (uint_t)SIOCSLGETREQ,	"SIOCSLGETREQ",	"ifreq" },
809 	{ (uint_t)SIOCSLSTAT,	"SIOCSLSTAT",	"ifreq" },
810 	{ (uint_t)SIOCSIFNAME,	"SIOCSIFNAME",	"ifreq" },
811 	{ (uint_t)SIOCGENADDR,	"SIOCGENADDR",	"ifreq" },
812 	{ (uint_t)SIOCGIFNUM,	"SIOCGIFNUM",	NULL },
813 	{ (uint_t)SIOCGIFMUXID,	"SIOCGIFMUXID",	"ifreq" },
814 	{ (uint_t)SIOCSIFMUXID,	"SIOCSIFMUXID",	"ifreq" },
815 	{ (uint_t)SIOCGIFINDEX,	"SIOCGIFINDEX",	"ifreq" },
816 	{ (uint_t)SIOCSIFINDEX,	"SIOCSIFINDEX",	"ifreq" },
817 	{ (uint_t)SIOCLIFREMOVEIF,	"SIOCLIFREMOVEIF",	"lifreq" },
818 	{ (uint_t)SIOCLIFADDIF,		"SIOCLIFADDIF",		"lifreq" },
819 	{ (uint_t)SIOCSLIFADDR,		"SIOCSLIFADDR",		"lifreq" },
820 	{ (uint_t)SIOCGLIFADDR,		"SIOCGLIFADDR",		"lifreq" },
821 	{ (uint_t)SIOCSLIFDSTADDR,	"SIOCSLIFDSTADDR",	"lifreq" },
822 	{ (uint_t)SIOCGLIFDSTADDR,	"SIOCGLIFDSTADDR",	"lifreq" },
823 	{ (uint_t)SIOCSLIFFLAGS,	"SIOCSLIFFLAGS",	"lifreq" },
824 	{ (uint_t)SIOCGLIFFLAGS,	"SIOCGLIFFLAGS",	"lifreq" },
825 	{ (uint_t)SIOCGLIFCONF,		"SIOCGLIFCONF",		"lifconf" },
826 	{ (uint_t)SIOCSLIFMTU,		"SIOCSLIFMTU",		"lifreq" },
827 	{ (uint_t)SIOCGLIFMTU,		"SIOCGLIFMTU",		"lifreq" },
828 	{ (uint_t)SIOCGLIFBRDADDR,	"SIOCGLIFBRDADDR",	"lifreq" },
829 	{ (uint_t)SIOCSLIFBRDADDR,	"SIOCSLIFBRDADDR",	"lifreq" },
830 	{ (uint_t)SIOCGLIFNETMASK,	"SIOCGLIFNETMASK",	"lifreq" },
831 	{ (uint_t)SIOCSLIFNETMASK,	"SIOCSLIFNETMASK",	"lifreq" },
832 	{ (uint_t)SIOCGLIFMETRIC,	"SIOCGLIFMETRIC",	"lifreq" },
833 	{ (uint_t)SIOCSLIFMETRIC,	"SIOCSLIFMETRIC",	"lifreq" },
834 	{ (uint_t)SIOCSLIFNAME,		"SIOCSLIFNAME",		"lifreq" },
835 	{ (uint_t)SIOCGLIFNUM,		"SIOCGLIFNUM",		"lifnum" },
836 	{ (uint_t)SIOCGLIFMUXID,	"SIOCGLIFMUXID",	"lifreq" },
837 	{ (uint_t)SIOCSLIFMUXID,	"SIOCSLIFMUXID",	"lifreq" },
838 	{ (uint_t)SIOCGLIFINDEX,	"SIOCGLIFINDEX",	"lifreq" },
839 	{ (uint_t)SIOCSLIFINDEX,	"SIOCSLIFINDEX",	"lifreq" },
840 	{ (uint_t)SIOCSLIFTOKEN,	"SIOCSLIFTOKEN",	"lifreq" },
841 	{ (uint_t)SIOCGLIFTOKEN,	"SIOCGLIFTOKEN",	"lifreq" },
842 	{ (uint_t)SIOCSLIFSUBNET,	"SIOCSLIFSUBNET",	"lifreq" },
843 	{ (uint_t)SIOCGLIFSUBNET,	"SIOCGLIFSUBNET",	"lifreq" },
844 	{ (uint_t)SIOCSLIFLNKINFO,	"SIOCSLIFLNKINFO",	"lifreq" },
845 	{ (uint_t)SIOCGLIFLNKINFO,	"SIOCGLIFLNKINFO",	"lifreq" },
846 	{ (uint_t)SIOCLIFDELND,		"SIOCLIFDELND",		"lifreq" },
847 	{ (uint_t)SIOCLIFGETND,		"SIOCLIFGETND",		"lifreq" },
848 	{ (uint_t)SIOCLIFSETND,		"SIOCLIFSETND",		"lifreq" },
849 	{ (uint_t)SIOCTMYADDR,		"SIOCTMYADDR",	"sioc_addrreq" },
850 	{ (uint_t)SIOCTONLINK,		"SIOCTONLINK",	"sioc_addrreq" },
851 	{ (uint_t)SIOCTMYSITE,		"SIOCTMYSITE",	"sioc_addrreq" },
852 	{ (uint_t)SIOCFIPSECONFIG,	"SIOCFIPSECONFIG",	NULL },
853 	{ (uint_t)SIOCSIPSECONFIG,	"SIOCSIPSECONFIG",	NULL },
854 	{ (uint_t)SIOCDIPSECONFIG,	"SIOCDIPSECONFIG",	NULL },
855 	{ (uint_t)SIOCLIPSECONFIG,	"SIOCLIPSECONFIG",	NULL },
856 	{ (uint_t)SIOCGLIFBINDING,	"SIOCGLIFBINDING",	"lifreq" },
857 	{ (uint_t)SIOCSLIFGROUPNAME,	"SIOCSLIFGROUPNAME",	"lifreq" },
858 	{ (uint_t)SIOCGLIFGROUPNAME,	"SIOCGLIFGROUPNAME",	"lifreq" },
859 	{ (uint_t)SIOCGLIFGROUPINFO,	"SIOCGLIFGROUPINFO", "lifgroupinfo" },
860 	{ (uint_t)SIOCGDSTINFO,		"SIOCGDSTINFO",		NULL },
861 	{ (uint_t)SIOCGIP6ADDRPOLICY,	"SIOCGIP6ADDRPOLICY",	NULL },
862 	{ (uint_t)SIOCSIP6ADDRPOLICY,	"SIOCSIP6ADDRPOLICY", 	NULL },
863 	{ (uint_t)SIOCSXARP,		"SIOCSXARP",		"xarpreq" },
864 	{ (uint_t)SIOCGXARP,		"SIOCGXARP",		"xarpreq" },
865 	{ (uint_t)SIOCDXARP,		"SIOCDXARP",		"xarpreq" },
866 	{ (uint_t)SIOCGLIFZONE,		"SIOCGLIFZONE",		"lifreq" },
867 	{ (uint_t)SIOCSLIFZONE,		"SIOCSLIFZONE",		"lifreq" },
868 	{ (uint_t)SIOCSCTPSOPT,		"SIOCSCTPSOPT",		NULL },
869 	{ (uint_t)SIOCSCTPGOPT,		"SIOCSCTPGOPT",		NULL },
870 	{ (uint_t)SIOCSCTPPEELOFF,	"SIOPCSCTPPEELOFF",	"int" },
871 	{ (uint_t)SIOCGLIFUSESRC,	"SIOCGLIFUSESRC",	"lifreq" },
872 	{ (uint_t)SIOCSLIFUSESRC,	"SIOCSLIFUSESRC",	"lifreq" },
873 	{ (uint_t)SIOCGLIFSRCOF,	"SIOCGLIFSRCOF",	"lifsrcof" },
874 	{ (uint_t)SIOCGMSFILTER,	"SIOCGMSFILTER",    "group_filter" },
875 	{ (uint_t)SIOCSMSFILTER,	"SIOCSMSFILTER",    "group_filter" },
876 	{ (uint_t)SIOCGIPMSFILTER,	"SIOCGIPMSFILTER",  "ip_msfilter" },
877 	{ (uint_t)SIOCSIPMSFILTER,	"SIOCSIPMSFILTER",  "ip_msfilter" },
878 	{ (uint_t)SIOCGLIFDADSTATE,	"SIOCGLIFDADSTATE",  "lifreq" },
879 	{ (uint_t)SIOCSLIFPREFIX,	"SIOCSLIFPREFIX", "lifreq" },
880 
881 	/* DES encryption */
882 	{ (uint_t)DESIOCBLOCK,	"DESIOCBLOCK", 	"desparams" },
883 	{ (uint_t)DESIOCQUICK,	"DESIOCQUICK", 	"desparams" },
884 
885 	/* Printing system */
886 	{ (uint_t)PRNIOC_GET_IFCAP,	"PRNIOC_GET_IFCAP", 	NULL },
887 	{ (uint_t)PRNIOC_SET_IFCAP,	"PRNIOC_SET_IFCAP", 	NULL },
888 	{ (uint_t)PRNIOC_GET_IFINFO,	"PRNIOC_GET_IFINFO",
889 	    "prn_interface_info" },
890 	{ (uint_t)PRNIOC_GET_STATUS,	"PRNIOC_GET_STATUS", 	NULL },
891 	{ (uint_t)PRNIOC_GET_1284_DEVID,	"PRNIOC_GET_1284_DEVID",
892 	    "prn_1284_device_id" },
893 	{ (uint_t)PRNIOC_GET_1284_STATUS,
894 	    "PRNIOC_GET_IFCANIOC_GET_1284_STATUS", NULL },
895 	{ (uint_t)PRNIOC_GET_TIMEOUTS,	"PRNIOC_GET_TIMEOUTS",
896 	    "prn_timeouts" },
897 	{ (uint_t)PRNIOC_SET_TIMEOUTS,	"PRNIOC_SET_TIMEOUTS",
898 	    "prn_timeouts" },
899 	{ (uint_t)PRNIOC_RESET,	"PRNIOC_RESET", 	NULL },
900 
901 	/* DTrace */
902 	{ (uint_t)DTRACEIOC_PROVIDER,	"DTRACEIOC_PROVIDER",	NULL },
903 	{ (uint_t)DTRACEIOC_PROBES,	"DTRACEIOC_PROBES",	NULL },
904 	{ (uint_t)DTRACEIOC_BUFSNAP,	"DTRACEIOC_BUFSNAP",	NULL },
905 	{ (uint_t)DTRACEIOC_PROBEMATCH,	"DTRACEIOC_PROBEMATCH",	NULL },
906 	{ (uint_t)DTRACEIOC_ENABLE,	"DTRACEIOC_ENABLE",	NULL },
907 	{ (uint_t)DTRACEIOC_AGGSNAP,	"DTRACEIOC_AGGSNAP",	NULL },
908 	{ (uint_t)DTRACEIOC_EPROBE,	"DTRACEIOC_EPROBE",	NULL },
909 	{ (uint_t)DTRACEIOC_PROBEARG,   "DTRACEIOC_PROBEARG",   NULL },
910 	{ (uint_t)DTRACEIOC_CONF,	"DTRACEIOC_CONF",	NULL },
911 	{ (uint_t)DTRACEIOC_STATUS,	"DTRACEIOC_STATUS",	NULL },
912 	{ (uint_t)DTRACEIOC_GO,		"DTRACEIOC_GO",		NULL },
913 	{ (uint_t)DTRACEIOC_STOP,	"DTRACEIOC_STOP",	NULL },
914 	{ (uint_t)DTRACEIOC_AGGDESC,	"DTRACEIOC_AGGDESC",	NULL },
915 	{ (uint_t)DTRACEIOC_FORMAT,	"DTRACEIOC_FORMAT",	NULL },
916 	{ (uint_t)DTRACEIOC_DOFGET,	"DTRACEIOC_DOFGET",	NULL },
917 	{ (uint_t)DTRACEIOC_REPLICATE,	"DTRACEIOC_REPLICATE",	NULL },
918 
919 	{ (uint_t)DTRACEHIOC_ADD,	"DTRACEHIOC_ADD",	NULL },
920 	{ (uint_t)DTRACEHIOC_REMOVE,	"DTRACEHIOC_REMOVE",	NULL },
921 	{ (uint_t)DTRACEHIOC_ADDDOF,	"DTRACEHIOC_ADDDOF",	NULL },
922 
923 	/* /dev/cryptoadm ioctl() control codes */
924 	{ (uint_t)CRYPTO_GET_VERSION,	"CRYPTO_GET_VERSION",	NULL },
925 	{ (uint_t)CRYPTO_GET_DEV_LIST,	"CRYPTO_GET_DEV_LIST",	NULL },
926 	{ (uint_t)CRYPTO_GET_SOFT_LIST,	"CRYPTO_GET_SOFT_LIST",	NULL },
927 	{ (uint_t)CRYPTO_GET_DEV_INFO,	"CRYPTO_GET_DEV_INFO",	NULL },
928 	{ (uint_t)CRYPTO_GET_SOFT_INFO,	"CRYPTO_GET_SOFT_INFO",	NULL },
929 	{ (uint_t)CRYPTO_LOAD_DEV_DISABLED,	"CRYPTO_LOAD_DEV_DISABLED",
930 	    NULL },
931 	{ (uint_t)CRYPTO_LOAD_SOFT_DISABLED,	"CRYPTO_LOAD_SOFT_DISABLED",
932 	    NULL },
933 	{ (uint_t)CRYPTO_UNLOAD_SOFT_MODULE,	"CRYPTO_UNLOAD_SOFT_MODULE",
934 	    NULL },
935 	{ (uint_t)CRYPTO_LOAD_SOFT_CONFIG,	"CRYPTO_LOAD_SOFT_CONFIG",
936 	    NULL },
937 	{ (uint_t)CRYPTO_POOL_CREATE,	"CRYPTO_POOL_CREATE",	NULL },
938 	{ (uint_t)CRYPTO_POOL_WAIT,	"CRYPTO_POOL_WAIT",	NULL },
939 	{ (uint_t)CRYPTO_POOL_RUN,	"CRYPTO_POOL_RUN",	NULL },
940 	{ (uint_t)CRYPTO_LOAD_DOOR,	"CRYPTO_LOAD_DOOR",	NULL },
941 
942 	/* /dev/crypto ioctl() control codes */
943 	{ (uint_t)CRYPTO_GET_FUNCTION_LIST,	"CRYPTO_GET_FUNCTION_LIST",
944 	    NULL },
945 	{ (uint_t)CRYPTO_GET_MECHANISM_NUMBER,	"CRYPTO_GET_MECHANISM_NUMBER",
946 	    NULL },
947 	{ (uint_t)CRYPTO_OPEN_SESSION,	"CRYPTO_OPEN_SESSION",	NULL },
948 	{ (uint_t)CRYPTO_CLOSE_SESSION,	"CRYPTO_CLOSE_SESSION",	NULL },
949 	{ (uint_t)CRYPTO_CLOSE_ALL_SESSIONS,	"CRYPTO_CLOSE_ALL_SESSIONS",
950 	    NULL },
951 	{ (uint_t)CRYPTO_LOGIN,		"CRYPTO_LOGIN",		NULL },
952 	{ (uint_t)CRYPTO_LOGOUT,	"CRYPTO_LOGOUT",	NULL },
953 	{ (uint_t)CRYPTO_ENCRYPT,	"CRYPTO_ENCRYPT",	NULL },
954 	{ (uint_t)CRYPTO_ENCRYPT_INIT,	"CRYPTO_ENCRYPT_INIT",	NULL },
955 	{ (uint_t)CRYPTO_ENCRYPT_UPDATE,	"CRYPTO_ENCRYPT_UPDATE",
956 	    NULL },
957 	{ (uint_t)CRYPTO_ENCRYPT_FINAL,	"CRYPTO_ENCRYPT_FINAL",	NULL },
958 	{ (uint_t)CRYPTO_DECRYPT,	"CRYPTO_DECRYPT",	NULL },
959 	{ (uint_t)CRYPTO_DECRYPT_INIT,	"CRYPTO_DECRYPT_INIT",	NULL },
960 	{ (uint_t)CRYPTO_DECRYPT_UPDATE,	"CRYPTO_DECRYPT_UPDATE",
961 	    NULL },
962 	{ (uint_t)CRYPTO_DECRYPT_FINAL,	"CRYPTO_DECRYPT_FINAL",	NULL },
963 	{ (uint_t)CRYPTO_DIGEST,	"CRYPTO_DIGEST",	NULL },
964 	{ (uint_t)CRYPTO_DIGEST_INIT,	"CRYPTO_DIGEST_INIT",	NULL },
965 	{ (uint_t)CRYPTO_DIGEST_UPDATE,	"CRYPTO_DIGEST_UPDATE",	NULL },
966 	{ (uint_t)CRYPTO_DIGEST_KEY,	"CRYPTO_DIGEST_KEY",	NULL },
967 	{ (uint_t)CRYPTO_DIGEST_FINAL,	"CRYPTO_DIGEST_FINAL",	NULL },
968 	{ (uint_t)CRYPTO_MAC,		"CRYPTO_MAC",		NULL },
969 	{ (uint_t)CRYPTO_MAC_INIT,	"CRYPTO_MAC_INIT",	NULL },
970 	{ (uint_t)CRYPTO_MAC_UPDATE,	"CRYPTO_MAC_UPDATE",	NULL },
971 	{ (uint_t)CRYPTO_MAC_FINAL,	"CRYPTO_MAC_FINAL",	NULL },
972 	{ (uint_t)CRYPTO_SIGN,		"CRYPTO_SIGN",		NULL },
973 	{ (uint_t)CRYPTO_SIGN_INIT,	"CRYPTO_SIGN_INIT",	NULL },
974 	{ (uint_t)CRYPTO_SIGN_UPDATE,	"CRYPTO_SIGN_UPDATE",	NULL },
975 	{ (uint_t)CRYPTO_SIGN_FINAL,	"CRYPTO_SIGN_FINAL",	NULL },
976 	{ (uint_t)CRYPTO_SIGN_RECOVER_INIT,	"CRYPTO_SIGN_RECOVER_INIT",
977 	    NULL },
978 	{ (uint_t)CRYPTO_SIGN_RECOVER,	"CRYPTO_SIGN_RECOVER",	NULL },
979 	{ (uint_t)CRYPTO_VERIFY,	"CRYPTO_VERIFY",	NULL },
980 	{ (uint_t)CRYPTO_VERIFY_INIT,	"CRYPTO_VERIFY_INIT",	NULL },
981 	{ (uint_t)CRYPTO_VERIFY_UPDATE,	"CRYPTO_VERIFY_UPDATE",	NULL },
982 	{ (uint_t)CRYPTO_VERIFY_FINAL,	"CRYPTO_VERIFY_FINAL",	NULL },
983 	{ (uint_t)CRYPTO_VERIFY_RECOVER_INIT,	"CRYPTO_VERIFY_RECOVER_INIT",
984 	    NULL },
985 	{ (uint_t)CRYPTO_VERIFY_RECOVER,	"CRYPTO_VERIFY_RECOVER",
986 	    NULL },
987 	{ (uint_t)CRYPTO_DIGEST_ENCRYPT_UPDATE,	"CRYPTO_DIGEST_ENCRYPT_UPDATE",
988 	    NULL },
989 	{ (uint_t)CRYPTO_DECRYPT_DIGEST_UPDATE,	"CRYPTO_DECRYPT_DIGEST_UPDATE",
990 	    NULL },
991 	{ (uint_t)CRYPTO_SIGN_ENCRYPT_UPDATE,	"CRYPTO_SIGN_ENCRYPT_UPDATE",
992 	    NULL },
993 	{ (uint_t)CRYPTO_DECRYPT_VERIFY_UPDATE,	"CRYPTO_DECRYPT_VERIFY_UPDATE",
994 	    NULL },
995 	{ (uint_t)CRYPTO_SEED_RANDOM,	"CRYPTO_SEED_RANDOM",	NULL },
996 	{ (uint_t)CRYPTO_GENERATE_RANDOM,	"CRYPTO_GENERATE_RANDOM",
997 	    NULL },
998 	{ (uint_t)CRYPTO_OBJECT_CREATE,	"CRYPTO_OBJECT_CREATE",	NULL },
999 	{ (uint_t)CRYPTO_OBJECT_COPY,	"CRYPTO_OBJECT_COPY",	NULL },
1000 	{ (uint_t)CRYPTO_OBJECT_DESTROY,	"CRYPTO_OBJECT_DESTROY",
1001 	    NULL },
1002 	{ (uint_t)CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE,
1003 	    "CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE",	NULL },
1004 	{ (uint_t)CRYPTO_OBJECT_GET_SIZE, "CRYPTO_OBJECT_GET_SIZE",	NULL },
1005 	{ (uint_t)CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE,
1006 	    "CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE",	NULL },
1007 	{ (uint_t)CRYPTO_OBJECT_FIND_INIT,	"CRYPTO_OBJECT_FIND_INIT",
1008 	    NULL },
1009 	{ (uint_t)CRYPTO_OBJECT_FIND_UPDATE,	"CRYPTO_OBJECT_FIND_UPDATE",
1010 	    NULL },
1011 	{ (uint_t)CRYPTO_OBJECT_FIND_FINAL,	"CRYPTO_OBJECT_FIND_FINAL",
1012 	    NULL },
1013 	{ (uint_t)CRYPTO_GENERATE_KEY,	"CRYPTO_GENERATE_KEY",	NULL },
1014 	{ (uint_t)CRYPTO_GENERATE_KEY_PAIR,	"CRYPTO_GENERATE_KEY_PAIR",
1015 	    NULL },
1016 	{ (uint_t)CRYPTO_WRAP_KEY,	"CRYPTO_WRAP_KEY",	NULL },
1017 	{ (uint_t)CRYPTO_UNWRAP_KEY,	"CRYPTO_UNWRAP_KEY",	NULL },
1018 	{ (uint_t)CRYPTO_DERIVE_KEY,	"CRYPTO_DERIVE_KEY",	NULL },
1019 	{ (uint_t)CRYPTO_GET_PROVIDER_LIST,	"CRYPTO_GET_PROVIDER_LIST",
1020 	    NULL },
1021 	{ (uint_t)CRYPTO_GET_PROVIDER_INFO,	"CRYPTO_GET_PROVIDER_INFO",
1022 	    NULL },
1023 	{ (uint_t)CRYPTO_GET_PROVIDER_MECHANISMS,
1024 	    "CRYPTO_GET_PROVIDER_MECHANISMS",	NULL },
1025 	{ (uint_t)CRYPTO_GET_PROVIDER_MECHANISM_INFO,
1026 	    "CRYPTO_GET_PROVIDER_MECHANISM_INFO",	NULL },
1027 	{ (uint_t)CRYPTO_INIT_TOKEN,	"CRYPTO_INIT_TOKEN",	NULL },
1028 	{ (uint_t)CRYPTO_INIT_PIN,	"CRYPTO_INIT_PIN",	NULL },
1029 	{ (uint_t)CRYPTO_SET_PIN,	"CRYPTO_SET_PIN",	NULL },
1030 	{ (uint_t)CRYPTO_NOSTORE_GENERATE_KEY,
1031 	    "CRYPTO_NOSTORE_GENERATE_KEY",	NULL },
1032 	{ (uint_t)CRYPTO_NOSTORE_GENERATE_KEY_PAIR,
1033 	    "CRYPTO_NOSTORE_GENERATE_KEY_PAIR",	NULL },
1034 	{ (uint_t)CRYPTO_NOSTORE_DERIVE_KEY,
1035 	    "CRYPTO_NOSTORE_DERIVE_KEY",	NULL },
1036 	{ (uint_t)CRYPTO_FIPS140_STATUS,	"CRYPTO_FIPS140_STATUS", NULL },
1037 	{ (uint_t)CRYPTO_FIPS140_SET,	"CRYPTO_FIPS140_SET",	NULL },
1038 
1039 	/* kbio ioctls */
1040 	{ (uint_t)KIOCTRANS,		"KIOCTRANS",	NULL },
1041 	{ (uint_t)KIOCGTRANS,		"KIOCGTRANS",	NULL },
1042 	{ (uint_t)KIOCTRANSABLE,	"KIOCTRANSABLE",	NULL },
1043 	{ (uint_t)KIOCGTRANSABLE,	"KIOCGTRANSABLE",	NULL },
1044 	{ (uint_t)KIOCSETKEY,		"KIOCSETKEY",	NULL },
1045 	{ (uint_t)KIOCGETKEY,		"KIOCGETKEY",	NULL },
1046 	{ (uint_t)KIOCCMD,		"KIOCCMD",	NULL },
1047 	{ (uint_t)KIOCTYPE,		"KIOCTYPE",	NULL },
1048 	{ (uint_t)KIOCSDIRECT,		"KIOCSDIRECT",	NULL },
1049 	{ (uint_t)KIOCGDIRECT,		"KIOCGDIRECT",	NULL },
1050 	{ (uint_t)KIOCSKEY,		"KIOCSKEY",	NULL },
1051 	{ (uint_t)KIOCGKEY,		"KIOCGKEY",	NULL },
1052 	{ (uint_t)KIOCSLED,		"KIOCSLED",	NULL },
1053 	{ (uint_t)KIOCGLED,		"KIOCGLED",	NULL },
1054 	{ (uint_t)KIOCSCOMPAT,		"KIOCSCOMPAT",	NULL },
1055 	{ (uint_t)KIOCGCOMPAT,		"KIOCGCOMPAT",	NULL },
1056 	{ (uint_t)KIOCSLAYOUT,		"KIOCSLAYOUT",	NULL },
1057 	{ (uint_t)KIOCLAYOUT,		"KIOCLAYOUT",	NULL },
1058 	{ (uint_t)KIOCSKABORTEN,	"KIOCSKABORTEN",	NULL },
1059 	{ (uint_t)KIOCGRPTDELAY,	"KIOCGRPTDELAY",	NULL },
1060 	{ (uint_t)KIOCSRPTDELAY,	"KIOCSRPTDELAY",	NULL },
1061 	{ (uint_t)KIOCGRPTRATE,		"KIOCGRPTRATE",	NULL },
1062 	{ (uint_t)KIOCSRPTRATE,		"KIOCSRPTRATE",	NULL },
1063 	{ (uint_t)KIOCSETFREQ,		"KIOCSETFREQ",	NULL },
1064 	{ (uint_t)KIOCMKTONE,		"KIOCMKTONE",	NULL },
1065 
1066 	/* ptm/pts driver I_STR ioctls */
1067 	{ (uint_t)ISPTM,		"ISPTM",		NULL},
1068 	{ (uint_t)UNLKPT,		"UNLKPT",		NULL},
1069 	{ (uint_t)PTSSTTY,		"PTSSTTY",		NULL},
1070 	{ (uint_t)ZONEPT,		"ZONEPT",		NULL},
1071 	{ (uint_t)OWNERPT,		"OWNERPT",		NULL},
1072 
1073 	/* aggr link aggregation pseudo driver ioctls */
1074 	{ (uint_t)LAIOC_CREATE,		"LAIOC_CREATE",		"laioc_create"},
1075 	{ (uint_t)LAIOC_DELETE,		"LAIOC_DELETE",		"laioc_delete"},
1076 	{ (uint_t)LAIOC_INFO,		"LAIOC_INFO",		"laioc_info"},
1077 	{ (uint_t)LAIOC_ADD,		"LAIOC_ADD",
1078 	    "laioc_add_rem"},
1079 	{ (uint_t)LAIOC_REMOVE,		"LAIOC_REMOVE",
1080 	    "laioc_add_rem"},
1081 	{ (uint_t)LAIOC_MODIFY,		"LAIOC_MODIFY",		"laioc_modify"},
1082 
1083 	/* dld data-link ioctls */
1084 	{ (uint_t)DLDIOC_ATTR,		"DLDIOC_ATTR",		"dld_ioc_attr"},
1085 	{ (uint_t)DLDIOC_PHYS_ATTR,	"DLDIOC_PHYS_ATTR",
1086 		"dld_ioc_phys_attr"},
1087 	{ (uint_t)DLDIOC_DOORSERVER,	"DLDIOC_DOORSERVER", "dld_ioc_door"},
1088 	{ (uint_t)DLDIOC_RENAME,	"DLDIOC_RENAME", "dld_ioc_rename"},
1089 	{ (uint_t)DLDIOC_SECOBJ_GET,		"DLDIOC_SECOBJ_GET",
1090 		"dld_ioc_secobj_get"},
1091 	{ (uint_t)DLDIOC_SECOBJ_SET,		"DLDIOC_SECOBJ_SET",
1092 		"dld_ioc_secobj_set"},
1093 	{ (uint_t)DLDIOC_SECOBJ_UNSET,		"DLDIOC_SECOBJ_UNSET",
1094 		"dld_ioc_secobj_unset"},
1095 	{ (uint_t)DLDIOC_MACADDRGET,		"DLDIOC_MACADDRGET",
1096 		"dld_ioc_macaddrget"},
1097 	{ (uint_t)DLDIOC_SETMACPROP,		"DLDIOC_SETMACPROP",
1098 		"dld_ioc_macprop_s"},
1099 	{ (uint_t)DLDIOC_GETMACPROP,		"DLDIOC_GETMACPROP",
1100 		"dld_ioc_macprop_s"},
1101 	{ (uint_t)DLDIOC_ADDFLOW,		"DLDIOC_ADDFLOW",
1102 		"dld_ioc_addflow"},
1103 	{ (uint_t)DLDIOC_REMOVEFLOW,		"DLDIOC_REMOVEFLOW",
1104 		"dld_ioc_removeflow"},
1105 	{ (uint_t)DLDIOC_MODIFYFLOW,		"DLDIOC_MODIFYFLOW",
1106 		"dld_ioc_modifyflow"},
1107 	{ (uint_t)DLDIOC_WALKFLOW,		"DLDIOC_WALKFLOW",
1108 		"dld_ioc_walkflow"},
1109 	{ (uint_t)DLDIOC_USAGELOG,		"DLDIOC_USAGELOG",
1110 		"dld_ioc_usagelog"},
1111 
1112 	/* simnet ioctls */
1113 	{ (uint_t)SIMNET_IOC_CREATE,		"SIMNET_IOC_CREATE",
1114 		"simnet_ioc_create"},
1115 	{ (uint_t)SIMNET_IOC_DELETE,		"SIMNET_IOC_DELETE",
1116 		"simnet_ioc_delete"},
1117 	{ (uint_t)SIMNET_IOC_INFO,		"SIMNET_IOC_INFO",
1118 		"simnet_ioc_info"},
1119 	{ (uint_t)SIMNET_IOC_MODIFY,		"SIMNET_IOC_MODIFY",
1120 		"simnet_ioc_info"},
1121 
1122 	/* vnic ioctls */
1123 	{ (uint_t)VNIC_IOC_CREATE,		"VNIC_IOC_CREATE",
1124 		"vnic_ioc_create"},
1125 	{ (uint_t)VNIC_IOC_DELETE,		"VNIC_IOC_DELETE",
1126 		"vnic_ioc_delete"},
1127 	{ (uint_t)VNIC_IOC_INFO,		"VNIC_IOC_INFO",
1128 		"vnic_ioc_info"},
1129 
1130 	/* ZFS ioctls */
1131 	{ (uint_t)ZFS_IOC_POOL_CREATE,		"ZFS_IOC_POOL_CREATE",
1132 		"zfs_cmd_t" },
1133 	{ (uint_t)ZFS_IOC_POOL_DESTROY,		"ZFS_IOC_POOL_DESTROY",
1134 		"zfs_cmd_t" },
1135 	{ (uint_t)ZFS_IOC_POOL_IMPORT,		"ZFS_IOC_POOL_IMPORT",
1136 		"zfs_cmd_t" },
1137 	{ (uint_t)ZFS_IOC_POOL_EXPORT,		"ZFS_IOC_POOL_EXPORT",
1138 		"zfs_cmd_t" },
1139 	{ (uint_t)ZFS_IOC_POOL_CONFIGS,		"ZFS_IOC_POOL_CONFIGS",
1140 		"zfs_cmd_t" },
1141 	{ (uint_t)ZFS_IOC_POOL_STATS,		"ZFS_IOC_POOL_STATS",
1142 		"zfs_cmd_t" },
1143 	{ (uint_t)ZFS_IOC_POOL_TRYIMPORT,	"ZFS_IOC_POOL_TRYIMPORT",
1144 		"zfs_cmd_t" },
1145 	{ (uint_t)ZFS_IOC_POOL_SCAN,		"ZFS_IOC_POOL_SCAN",
1146 		"zfs_cmd_t" },
1147 	{ (uint_t)ZFS_IOC_POOL_FREEZE,		"ZFS_IOC_POOL_FREEZE",
1148 		"zfs_cmd_t" },
1149 	{ (uint_t)ZFS_IOC_POOL_UPGRADE,		"ZFS_IOC_POOL_UPGRADE",
1150 		"zfs_cmd_t" },
1151 	{ (uint_t)ZFS_IOC_POOL_GET_HISTORY,	"ZFS_IOC_POOL_GET_HISTORY",
1152 		"zfs_cmd_t" },
1153 	{ (uint_t)ZFS_IOC_VDEV_ADD,		"ZFS_IOC_VDEV_ADD",
1154 		"zfs_cmd_t" },
1155 	{ (uint_t)ZFS_IOC_VDEV_REMOVE,		"ZFS_IOC_VDEV_REMOVE",
1156 		"zfs_cmd_t" },
1157 	{ (uint_t)ZFS_IOC_VDEV_SET_STATE,	"ZFS_IOC_VDEV_SET_STATE",
1158 		"zfs_cmd_t" },
1159 	{ (uint_t)ZFS_IOC_VDEV_ATTACH,		"ZFS_IOC_VDEV_ATTACH",
1160 		"zfs_cmd_t" },
1161 	{ (uint_t)ZFS_IOC_VDEV_DETACH,		"ZFS_IOC_VDEV_DETACH",
1162 		"zfs_cmd_t" },
1163 	{ (uint_t)ZFS_IOC_VDEV_SETPATH,		"ZFS_IOC_VDEV_SETPATH",
1164 		"zfs_cmd_t" },
1165 	{ (uint_t)ZFS_IOC_VDEV_SETFRU,		"ZFS_IOC_VDEV_SETFRU",
1166 		"zfs_cmd_t" },
1167 	{ (uint_t)ZFS_IOC_OBJSET_STATS,		"ZFS_IOC_OBJSET_STATS",
1168 		"zfs_cmd_t" },
1169 	{ (uint_t)ZFS_IOC_OBJSET_ZPLPROPS,	"ZFS_IOC_OBJSET_ZPLPROPS",
1170 		"zfs_cmd_t" },
1171 	{ (uint_t)ZFS_IOC_DATASET_LIST_NEXT,	"ZFS_IOC_DATASET_LIST_NEXT",
1172 		"zfs_cmd_t" },
1173 	{ (uint_t)ZFS_IOC_SNAPSHOT_LIST_NEXT,	"ZFS_IOC_SNAPSHOT_LIST_NEXT",
1174 		"zfs_cmd_t" },
1175 	{ (uint_t)ZFS_IOC_SET_PROP,		"ZFS_IOC_SET_PROP",
1176 		"zfs_cmd_t" },
1177 	{ (uint_t)ZFS_IOC_CREATE,		"ZFS_IOC_CREATE",
1178 		"zfs_cmd_t" },
1179 	{ (uint_t)ZFS_IOC_DESTROY,		"ZFS_IOC_DESTROY",
1180 		"zfs_cmd_t" },
1181 	{ (uint_t)ZFS_IOC_ROLLBACK,		"ZFS_IOC_ROLLBACK",
1182 		"zfs_cmd_t" },
1183 	{ (uint_t)ZFS_IOC_RENAME,		"ZFS_IOC_RENAME",
1184 		"zfs_cmd_t" },
1185 	{ (uint_t)ZFS_IOC_RECV,			"ZFS_IOC_RECV",
1186 		"zfs_cmd_t" },
1187 	{ (uint_t)ZFS_IOC_SEND,			"ZFS_IOC_SEND",
1188 		"zfs_cmd_t" },
1189 	{ (uint_t)ZFS_IOC_INJECT_FAULT,		"ZFS_IOC_INJECT_FAULT",
1190 		"zfs_cmd_t" },
1191 	{ (uint_t)ZFS_IOC_CLEAR_FAULT,		"ZFS_IOC_CLEAR_FAULT",
1192 		"zfs_cmd_t" },
1193 	{ (uint_t)ZFS_IOC_INJECT_LIST_NEXT,	"ZFS_IOC_INJECT_LIST_NEXT",
1194 		"zfs_cmd_t" },
1195 	{ (uint_t)ZFS_IOC_ERROR_LOG,		"ZFS_IOC_ERROR_LOG",
1196 		"zfs_cmd_t" },
1197 	{ (uint_t)ZFS_IOC_CLEAR,		"ZFS_IOC_CLEAR",
1198 		"zfs_cmd_t" },
1199 	{ (uint_t)ZFS_IOC_PROMOTE,		"ZFS_IOC_PROMOTE",
1200 		"zfs_cmd_t" },
1201 	{ (uint_t)ZFS_IOC_DESTROY_SNAPS,	"ZFS_IOC_DESTROY_SNAPS",
1202 		"zfs_cmd_t" },
1203 	{ (uint_t)ZFS_IOC_SNAPSHOT,		"ZFS_IOC_SNAPSHOT",
1204 		"zfs_cmd_t" },
1205 	{ (uint_t)ZFS_IOC_DSOBJ_TO_DSNAME,	"ZFS_IOC_DSOBJ_TO_DSNAME",
1206 		"zfs_cmd_t" },
1207 	{ (uint_t)ZFS_IOC_OBJ_TO_PATH,		"ZFS_IOC_OBJ_TO_PATH",
1208 		"zfs_cmd_t" },
1209 	{ (uint_t)ZFS_IOC_POOL_SET_PROPS,	"ZFS_IOC_POOL_SET_PROPS",
1210 		"zfs_cmd_t" },
1211 	{ (uint_t)ZFS_IOC_POOL_GET_PROPS,	"ZFS_IOC_POOL_GET_PROPS",
1212 		"zfs_cmd_t" },
1213 	{ (uint_t)ZFS_IOC_SET_FSACL,		"ZFS_IOC_SET_FSACL",
1214 		"zfs_cmd_t" },
1215 	{ (uint_t)ZFS_IOC_GET_FSACL,		"ZFS_IOC_GET_FSACL",
1216 		"zfs_cmd_t" },
1217 	{ (uint_t)ZFS_IOC_SHARE,		"ZFS_IOC_SHARE",
1218 		"zfs_cmd_t" },
1219 	{ (uint_t)ZFS_IOC_INHERIT_PROP,		"ZFS_IOC_INHERIT_PROP",
1220 		"zfs_cmd_t" },
1221 	{ (uint_t)ZFS_IOC_SMB_ACL,		"ZFS_IOC_SMB_ACL",
1222 		"zfs_cmd_t" },
1223 	{ (uint_t)ZFS_IOC_USERSPACE_ONE,	"ZFS_IOC_USERSPACE_ONE",
1224 		"zfs_cmd_t" },
1225 	{ (uint_t)ZFS_IOC_USERSPACE_MANY,	"ZFS_IOC_USERSPACE_MANY",
1226 		"zfs_cmd_t" },
1227 	{ (uint_t)ZFS_IOC_USERSPACE_UPGRADE,	"ZFS_IOC_USERSPACE_UPGRADE",
1228 		"zfs_cmd_t" },
1229 	{ (uint_t)ZFS_IOC_HOLD,			"ZFS_IOC_HOLD",
1230 		"zfs_cmd_t" },
1231 	{ (uint_t)ZFS_IOC_RELEASE,		"ZFS_IOC_RELEASE",
1232 		"zfs_cmd_t" },
1233 	{ (uint_t)ZFS_IOC_GET_HOLDS,		"ZFS_IOC_GET_HOLDS",
1234 		"zfs_cmd_t" },
1235 	{ (uint_t)ZFS_IOC_OBJSET_RECVD_PROPS,	"ZFS_IOC_OBJSET_RECVD_PROPS",
1236 		"zfs_cmd_t" },
1237 	{ (uint_t)ZFS_IOC_VDEV_SPLIT,		"ZFS_IOC_VDEV_SPLIT",
1238 		"zfs_cmd_t" },
1239 
1240 	/* kssl ioctls */
1241 	{ (uint_t)KSSL_ADD_ENTRY,		"KSSL_ADD_ENTRY",
1242 		"kssl_params_t"},
1243 	{ (uint_t)KSSL_DELETE_ENTRY,		"KSSL_DELETE_ENTRY",
1244 		"sockaddr_in"},
1245 
1246 	/* disk ioctls - (0x04 << 8) - dkio.h */
1247 	{ (uint_t)DKIOCGGEOM,		"DKIOCGGEOM",
1248 		"struct dk_geom"},
1249 	{ (uint_t)DKIOCINFO,		"DKIOCINFO",
1250 		"struct dk_info"},
1251 	{ (uint_t)DKIOCEJECT,		"DKIOCEJECT",
1252 		NULL},
1253 	{ (uint_t)DKIOCGVTOC,		"DKIOCGVTOC",
1254 		"struct vtoc"},
1255 	{ (uint_t)DKIOCSVTOC,		"DKIOCSVTOC",
1256 		"struct vtoc"},
1257 	{ (uint_t)DKIOCGEXTVTOC,	"DKIOCGEXTVTOC",
1258 		"struct extvtoc"},
1259 	{ (uint_t)DKIOCSEXTVTOC,	"DKIOCSEXTVTOC",
1260 		"struct extvtoc"},
1261 	{ (uint_t)DKIOCFLUSHWRITECACHE,	"DKIOCFLUSHWRITECACHE",
1262 		NULL},
1263 	{ (uint_t)DKIOCGETWCE,		"DKIOCGETWCE",
1264 		NULL},
1265 	{ (uint_t)DKIOCSETWCE,		"DKIOCSETWCE",
1266 		NULL},
1267 	{ (uint_t)DKIOCSGEOM,		"DKIOCSGEOM",
1268 		"struct dk_geom"},
1269 	{ (uint_t)DKIOCSAPART,		"DKIOCSAPART",
1270 		"struct dk_allmap"},
1271 	{ (uint_t)DKIOCGAPART,		"DKIOCGAPART",
1272 		"struct dk_allmap"},
1273 	{ (uint_t)DKIOCG_PHYGEOM,	"DKIOCG_PHYGEOM",
1274 		"struct dk_geom"},
1275 	{ (uint_t)DKIOCG_VIRTGEOM,	"DKIOCG_VIRTGEOM",
1276 		"struct dk_geom"},
1277 	{ (uint_t)DKIOCLOCK,		"DKIOCLOCK",
1278 		NULL},
1279 	{ (uint_t)DKIOCUNLOCK,		"DKIOCUNLOCK",
1280 		NULL},
1281 	{ (uint_t)DKIOCSTATE,		"DKIOCSTATE",
1282 		NULL},
1283 	{ (uint_t)DKIOCREMOVABLE,	"DKIOCREMOVABLE",
1284 		NULL},
1285 	{ (uint_t)DKIOCHOTPLUGGABLE,	"DKIOCHOTPLUGGABLE",
1286 		NULL},
1287 	{ (uint_t)DKIOCADDBAD,		"DKIOCADDBAD",
1288 		NULL},
1289 	{ (uint_t)DKIOCGETDEF,		"DKIOCGETDEF",
1290 		NULL},
1291 	{ (uint_t)DKIOCPARTINFO,	"DKIOCPARTINFO",
1292 		"struct part_info"},
1293 	{ (uint_t)DKIOCEXTPARTINFO,	"DKIOCEXTPARTINFO",
1294 		"struct extpart_info"},
1295 	{ (uint_t)DKIOCGMEDIAINFO,	"DKIOCGMEDIAINFO",
1296 		"struct dk_minfo"},
1297 	{ (uint_t)DKIOCGMBOOT,		"DKIOCGMBOOT",
1298 		NULL},
1299 	{ (uint_t)DKIOCSMBOOT,		"DKIOCSMBOOT",
1300 		NULL},
1301 	{ (uint_t)DKIOCSETEFI,		"DKIOCSETEFI",
1302 		"struct dk_efi"},
1303 	{ (uint_t)DKIOCGETEFI,		"DKIOCGETEFI",
1304 		"struct dk_efi"},
1305 	{ (uint_t)DKIOCPARTITION,	"DKIOCPARTITION",
1306 		"struct partition64"},
1307 	{ (uint_t)DKIOCGETVOLCAP,	"DKIOCGETVOLCAP",
1308 		"struct volcap_t"},
1309 	{ (uint_t)DKIOCSETVOLCAP,	"DKIOCSETVOLCAP",
1310 		"struct volcap_t"},
1311 	{ (uint_t)DKIOCDMR,		"DKIOCDMR",
1312 		"struct vol_directed_rd"},
1313 	{ (uint_t)DKIOCDUMPINIT,	"DKIOCDUMPINIT",
1314 		NULL},
1315 	{ (uint_t)DKIOCDUMPFINI,	"DKIOCDUMPFINI",
1316 		NULL},
1317 	{ (uint_t)DKIOCREADONLY,	"DKIOCREADONLY",
1318 		NULL},
1319 
1320 	/* disk ioctls - (0x04 << 8) - fdio.h */
1321 	{ (uint_t)FDIOGCHAR,		"FDIOGCHAR",
1322 		"struct fd_char"},
1323 	{ (uint_t)FDIOSCHAR,		"FDIOSCHAR",
1324 		"struct fd_char"},
1325 	{ (uint_t)FDEJECT,		"FDEJECT",
1326 		NULL},
1327 	{ (uint_t)FDGETCHANGE,		"FDGETCHANGE",
1328 		NULL},
1329 	{ (uint_t)FDGETDRIVECHAR,	"FDGETDRIVECHAR",
1330 		"struct fd_drive"},
1331 	{ (uint_t)FDSETDRIVECHAR,	"FDSETDRIVECHAR",
1332 		"struct fd_drive"},
1333 	{ (uint_t)FDGETSEARCH,		"FDGETSEARCH",
1334 		NULL},
1335 	{ (uint_t)FDSETSEARCH,		"FDSETSEARCH",
1336 		NULL},
1337 	{ (uint_t)FDIOCMD,		"FDIOCMD",
1338 		"struct fd_cmd"},
1339 	{ (uint_t)FDRAW,		"FDRAW",
1340 		"struct fd_raw"},
1341 	{ (uint_t)FDDEFGEOCHAR,		"FDDEFGEOCHAR",
1342 		NULL},
1343 
1344 	/* disk ioctls - (0x04 << 8) - cdio.h */
1345 	{ (uint_t)CDROMPAUSE,		"CDROMPAUSE",
1346 		NULL},
1347 	{ (uint_t)CDROMRESUME,		"CDROMRESUME",
1348 		NULL},
1349 	{ (uint_t)CDROMPLAYMSF,		"CDROMPLAYMSF",
1350 		"struct cdrom_msf"},
1351 	{ (uint_t)CDROMPLAYTRKIND,	"CDROMPLAYTRKIND",
1352 		"struct cdrom_ti"},
1353 	{ (uint_t)CDROMREADTOCHDR,	"CDROMREADTOCHDR",
1354 		"struct cdrom_tochdr"},
1355 	{ (uint_t)CDROMREADTOCENTRY,	"CDROMREADTOCENTRY",
1356 		"struct cdrom_tocentry"},
1357 	{ (uint_t)CDROMSTOP,		"CDROMSTOP",
1358 		NULL},
1359 	{ (uint_t)CDROMSTART,		"CDROMSTART",
1360 		NULL},
1361 	{ (uint_t)CDROMEJECT,		"CDROMEJECT",
1362 		NULL},
1363 	{ (uint_t)CDROMVOLCTRL,		"CDROMVOLCTRL",
1364 		"struct cdrom_volctrl"},
1365 	{ (uint_t)CDROMSUBCHNL,		"CDROMSUBCHNL",
1366 		"struct cdrom_subchnl"},
1367 	{ (uint_t)CDROMREADMODE2,	"CDROMREADMODE2",
1368 		"struct cdrom_read"},
1369 	{ (uint_t)CDROMREADMODE1,	"CDROMREADMODE1",
1370 		"struct cdrom_read"},
1371 	{ (uint_t)CDROMREADOFFSET,	"CDROMREADOFFSET",
1372 		NULL},
1373 	{ (uint_t)CDROMGBLKMODE,	"CDROMGBLKMODE",
1374 		NULL},
1375 	{ (uint_t)CDROMSBLKMODE,	"CDROMSBLKMODE",
1376 		NULL},
1377 	{ (uint_t)CDROMCDDA,		"CDROMCDDA",
1378 		"struct cdrom_cdda"},
1379 	{ (uint_t)CDROMCDXA,		"CDROMCDXA",
1380 		"struct cdrom_cdxa"},
1381 	{ (uint_t)CDROMSUBCODE,		"CDROMSUBCODE",
1382 		"struct cdrom_subcode"},
1383 	{ (uint_t)CDROMGDRVSPEED,	"CDROMGDRVSPEED",
1384 		NULL},
1385 	{ (uint_t)CDROMSDRVSPEED,	"CDROMSDRVSPEED",
1386 		NULL},
1387 	{ (uint_t)CDROMCLOSETRAY,	"CDROMCLOSETRAY",
1388 		NULL},
1389 
1390 	/* disk ioctls - (0x04 << 8) - uscsi.h */
1391 	{ (uint_t)USCSICMD,		"USCSICMD",
1392 		"struct uscsi_cmd"},
1393 
1394 	/* dumpadm ioctls - (0xdd << 8) */
1395 	{ (uint_t)DIOCGETDEV,	"DIOCGETDEV",
1396 		NULL},
1397 
1398 	/* mntio ioctls - ('m' << 8) */
1399 	{ (uint_t)MNTIOC_NMNTS,		"MNTIOC_NMNTS",
1400 		NULL},
1401 	{ (uint_t)MNTIOC_GETDEVLIST,	"MNTIOC_GETDEVLIST",
1402 		NULL},
1403 	{ (uint_t)MNTIOC_SETTAG,	"MNTIOC_SETTAG",
1404 		"struct mnttagdesc"},
1405 	{ (uint_t)MNTIOC_CLRTAG,	"MNTIOC_CLRTAG",
1406 		"struct mnttagdesc"},
1407 	{ (uint_t)MNTIOC_SHOWHIDDEN,	"MNTIOC_SHOWHIDDEN",
1408 		NULL},
1409 	{ (uint_t)MNTIOC_GETMNTENT,	"MNTIOC_GETMNTENT",
1410 		"struct mnttab"},
1411 	{ (uint_t)MNTIOC_GETEXTMNTENT,	"MNTIOC_GETEXTMNTENT",
1412 		"struct extmnttab"},
1413 	{ (uint_t)MNTIOC_GETMNTANY,	"MNTIOC_GETMNTANY",
1414 		"struct mnttab"},
1415 
1416 	/* devinfo ioctls - ('df' << 8) - devinfo_impl.h */
1417 	{ (uint_t)DINFOUSRLD,		"DINFOUSRLD",
1418 		NULL},
1419 	{ (uint_t)DINFOLODRV,		"DINFOLODRV",
1420 		NULL},
1421 	{ (uint_t)DINFOIDENT,		"DINFOIDENT",
1422 		NULL},
1423 
1424 	{ (uint_t)IPTUN_CREATE,	"IPTUN_CREATE",	"iptun_kparams_t"},
1425 	{ (uint_t)IPTUN_DELETE,	"IPTUN_DELETE", "datalink_id_t"},
1426 	{ (uint_t)IPTUN_MODIFY, "IPTUN_MODIFY", "iptun_kparams_t"},
1427 	{ (uint_t)IPTUN_INFO,	"IPTUN_INFO",	NULL},
1428 	{ (uint_t)IPTUN_SET_6TO4RELAY, "IPTUN_SET_6TO4RELAY",	NULL},
1429 	{ (uint_t)IPTUN_GET_6TO4RELAY, "IPTUN_GET_6TO4RELAY",	NULL},
1430 
1431 	/* zcons ioctls */
1432 	{ (uint_t)ZC_HOLDSLAVE,		"ZC_HOLDSLAVE",		NULL },
1433 	{ (uint_t)ZC_RELEASESLAVE,	"ZC_RELEASESLAVE",	NULL },
1434 
1435 	/* hid ioctls - ('h' << 8) - hid.h */
1436 	{ (uint_t)HIDIOCKMGDIRECT,	"HIDIOCKMGDIRECT",	NULL },
1437 	{ (uint_t)HIDIOCKMSDIRECT,	"HIDIOCKMSDIRECT",	NULL },
1438 
1439 	/* pm ioctls */
1440 	{ (uint_t)PM_SCHEDULE,		"PM_SCHEDULE",		NULL },
1441 	{ (uint_t)PM_GET_IDLE_TIME,	"PM_GET_IDLE_TIME",	NULL },
1442 	{ (uint_t)PM_GET_NUM_CMPTS,	"PM_GET_NUM_CMPTS",	NULL },
1443 	{ (uint_t)PM_GET_THRESHOLD,	"PM_GET_THRESHOLD",	NULL },
1444 	{ (uint_t)PM_SET_THRESHOLD,	"PM_SET_THRESHOLD",	NULL },
1445 	{ (uint_t)PM_GET_NORM_PWR,	"PM_GET_NORM_PWR",	NULL },
1446 	{ (uint_t)PM_SET_CUR_PWR,	"PM_SET_CUR_PWR",	NULL },
1447 	{ (uint_t)PM_GET_CUR_PWR,	"PM_GET_CUR_PWR",	NULL },
1448 	{ (uint_t)PM_GET_NUM_DEPS,	"PM_GET_NUM_DEPS",	NULL },
1449 	{ (uint_t)PM_GET_DEP,		"PM_GET_DEP",		NULL },
1450 	{ (uint_t)PM_ADD_DEP,		"PM_ADD_DEP",		NULL },
1451 	{ (uint_t)PM_REM_DEP,		"PM_REM_DEP",		NULL },
1452 	{ (uint_t)PM_REM_DEVICE,	"PM_REM_DEVICE",	NULL },
1453 	{ (uint_t)PM_REM_DEVICES,	"PM_REM_DEVICES",	NULL },
1454 	{ (uint_t)PM_DISABLE_AUTOPM,	"PM_DISABLE_AUTOPM",	NULL },
1455 	{ (uint_t)PM_REENABLE_AUTOPM,	"PM_REENABLE_AUTOPM",	NULL },
1456 	{ (uint_t)PM_SET_NORM_PWR,	"PM_SET_NORM_PWR",	NULL },
1457 	{ (uint_t)PM_GET_SYSTEM_THRESHOLD,	"PM_GET_SYSTEM_THRESHOLD",
1458 		NULL },
1459 	{ (uint_t)PM_GET_DEFAULT_SYSTEM_THRESHOLD,
1460 		"PM_GET_DEFAULT_SYSTEM_THRESHOLD", NULL },
1461 	{ (uint_t)PM_SET_SYSTEM_THRESHOLD,	"PM_SET_SYSTEM_THRESHOLD",
1462 		NULL },
1463 	{ (uint_t)PM_START_PM,		"PM_START_PM",		NULL },
1464 	{ (uint_t)PM_STOP_PM,		"PM_STOP_PM",		NULL },
1465 	{ (uint_t)PM_RESET_PM,		"PM_RESET_PM",		NULL },
1466 	{ (uint_t)PM_GET_PM_STATE,	"PM_GET_PM_STATE",	NULL },
1467 	{ (uint_t)PM_GET_AUTOS3_STATE,	"PM_GET_AUTOS3_STATE",	NULL },
1468 	{ (uint_t)PM_GET_S3_SUPPORT_STATE,	"PM_GET_S3_SUPPORT_STATE",
1469 		NULL },
1470 	{ (uint_t)PM_IDLE_DOWN,		"PM_IDLE_DOWN",		NULL },
1471 	{ (uint_t)PM_START_CPUPM,	"PM_START_CPUPM",	NULL },
1472 	{ (uint_t)PM_START_CPUPM_EV,	"PM_START_CPUPM_EV",	NULL },
1473 	{ (uint_t)PM_START_CPUPM_POLL,	"PM_START_CPUPM_POLL",	NULL },
1474 	{ (uint_t)PM_STOP_CPUPM,	"PM_STOP_CPUPM",	NULL },
1475 	{ (uint_t)PM_GET_CPU_THRESHOLD,	"PM_GET_CPU_THRESHOLD",	NULL },
1476 	{ (uint_t)PM_SET_CPU_THRESHOLD,	"PM_SET_CPU_THRESHOLD",	NULL },
1477 	{ (uint_t)PM_GET_CPUPM_STATE,	"PM_GET_CPUPM_STATE",	NULL },
1478 	{ (uint_t)PM_START_AUTOS3,	"PM_START_AUTOS3",	NULL },
1479 	{ (uint_t)PM_STOP_AUTOS3,	"PM_STOP_AUTOS3",	NULL },
1480 	{ (uint_t)PM_ENABLE_S3,		"PM_ENABLE_S3",		NULL },
1481 	{ (uint_t)PM_DISABLE_S3,	"PM_DISABLE_S3",	NULL },
1482 	{ (uint_t)PM_ENTER_S3,		"PM_ENTER_S3",		NULL },
1483 	{ (uint_t)PM_DISABLE_CPU_DEEP_IDLE,	"PM_DISABLE_CPU_DEEP_IDLE",
1484 		NULL },
1485 	{ (uint_t)PM_ENABLE_CPU_DEEP_IDLE,	"PM_START_CPU_DEEP_IDLE",
1486 		NULL },
1487 	{ (uint_t)PM_DEFAULT_CPU_DEEP_IDLE,	"PM_DFLT_CPU_DEEP_IDLE",
1488 		NULL },
1489 #ifdef _SYSCALL32
1490 	{ (uint_t)PM_GET_STATE_CHANGE,		"PM_GET_STATE_CHANGE",
1491 		"pm_state_change32_t" },
1492 	{ (uint_t)PM_GET_STATE_CHANGE_WAIT,	"PM_GET_STATE_CHANGE_WAIT",
1493 		"pm_state_change32_t" },
1494 	{ (uint_t)PM_DIRECT_NOTIFY,		"PM_DIRECT_NOTIFY",
1495 		"pm_state_change32_t" },
1496 	{ (uint_t)PM_DIRECT_NOTIFY_WAIT,	"PM_DIRECT_NOTIFY_WAIT",
1497 		"pm_state_change32_t" },
1498 	{ (uint_t)PM_REPARSE_PM_PROPS,		"PM_REPARSE_PM_PROPS",
1499 		"pm_req32_t" },
1500 	{ (uint_t)PM_SET_DEVICE_THRESHOLD,	"PM_SET_DEVICE_THRESHOLD",
1501 		"pm_req32_t" },
1502 	{ (uint_t)PM_GET_STATS,			"PM_GET_STATS",
1503 		"pm_req32_t" },
1504 	{ (uint_t)PM_GET_DEVICE_THRESHOLD,	"PM_GET_DEVICE_THRESHOLD",
1505 		"pm_req32_t" },
1506 	{ (uint_t)PM_GET_POWER_NAME,		"PM_GET_POWER_NAME",
1507 		"pm_req32_t" },
1508 	{ (uint_t)PM_GET_POWER_LEVELS,		"PM_GET_POWER_LEVELS",
1509 		"pm_req32_t" },
1510 	{ (uint_t)PM_GET_NUM_COMPONENTS,	"PM_GET_NUM_COMPONENTS",
1511 		"pm_req32_t" },
1512 	{ (uint_t)PM_GET_COMPONENT_NAME,	"PM_GET_COMPONENT_NAME",
1513 		"pm_req32_t" },
1514 	{ (uint_t)PM_GET_NUM_POWER_LEVELS,	"PM_GET_NUM_POWER_LEVELS",
1515 		"pm_req32_t" },
1516 	{ (uint_t)PM_DIRECT_PM,			"PM_DIRECT_PM",
1517 		"pm_req32_t" },
1518 	{ (uint_t)PM_RELEASE_DIRECT_PM,		"PM_RELEASE_DIRECT_PM",
1519 		"pm_req32_t" },
1520 	{ (uint_t)PM_RESET_DEVICE_THRESHOLD,	"PM_RESET_DEVICE_THRESHOLD",
1521 		"pm_req32_t" },
1522 	{ (uint_t)PM_GET_DEVICE_TYPE,		"PM_GET_DEVICE_TYPE",
1523 		"pm_req32_t" },
1524 	{ (uint_t)PM_SET_COMPONENT_THRESHOLDS,	"PM_SET_COMPONENT_THRESHOLDS",
1525 		"pm_req32_t" },
1526 	{ (uint_t)PM_GET_COMPONENT_THRESHOLDS,	"PM_GET_COMPONENT_THRESHOLDS",
1527 		"pm_req32_t" },
1528 	{ (uint_t)PM_GET_DEVICE_THRESHOLD_BASIS,
1529 		"PM_GET_DEVICE_THRESHOLD_BASIS",	"pm_req32_t" },
1530 	{ (uint_t)PM_SET_CURRENT_POWER,		"PM_SET_CURRENT_POWER",
1531 		"pm_req32_t" },
1532 	{ (uint_t)PM_GET_CURRENT_POWER,		"PM_GET_CURRENT_POWER",
1533 		"pm_req32_t" },
1534 	{ (uint_t)PM_GET_FULL_POWER,		"PM_GET_FULL_POWER",
1535 		"pm_req32_t" },
1536 	{ (uint_t)PM_ADD_DEPENDENT,		"PM_ADD_DEPENDENT",
1537 		"pm_req32_t" },
1538 	{ (uint_t)PM_GET_TIME_IDLE,		"PM_GET_TIME_IDLE",
1539 		"pm_req32_t" },
1540 	{ (uint_t)PM_ADD_DEPENDENT_PROPERTY,	"PM_ADD_DEPENDENT_PROPERTY",
1541 		"pm_req32_t" },
1542 	{ (uint_t)PM_GET_CMD_NAME,		"PM_GET_CMD_NAME",
1543 		"pm_req32_t" },
1544 	{ (uint_t)PM_SEARCH_LIST,		"PM_SEARCH_LIST",
1545 		"pm_searchargs32_t" },
1546 #else  /* _SYSCALL32 */
1547 	{ (uint_t)PM_GET_STATE_CHANGE,		"PM_GET_STATE_CHANGE",
1548 		"pm_state_change_t" },
1549 	{ (uint_t)PM_GET_STATE_CHANGE_WAIT,	"PM_GET_STATE_CHANGE_WAIT",
1550 		"pm_state_change_t" },
1551 	{ (uint_t)PM_DIRECT_NOTIFY,		"PM_DIRECT_NOTIFY",
1552 		"pm_state_change_t" },
1553 	{ (uint_t)PM_DIRECT_NOTIFY_WAIT,	"PM_DIRECT_NOTIFY_WAIT",
1554 		"pm_state_change_t" },
1555 	{ (uint_t)PM_REPARSE_PM_PROPS,		"PM_REPARSE_PM_PROPS",
1556 		"pm_req_t" },
1557 	{ (uint_t)PM_SET_DEVICE_THRESHOLD,	"PM_SET_DEVICE_THRESHOLD",
1558 		"pm_req_t" },
1559 	{ (uint_t)PM_GET_STATS,			"PM_GET_STATS",
1560 		"pm_req_t" },
1561 	{ (uint_t)PM_GET_DEVICE_THRESHOLD,	"PM_GET_DEVICE_THRESHOLD",
1562 		"pm_req_t" },
1563 	{ (uint_t)PM_GET_POWER_NAME,		"PM_GET_POWER_NAME",
1564 		"pm_req_t" },
1565 	{ (uint_t)PM_GET_POWER_LEVELS,		"PM_GET_POWER_LEVELS",
1566 		"pm_req_t" },
1567 	{ (uint_t)PM_GET_NUM_COMPONENTS,	"PM_GET_NUM_COMPONENTS",
1568 		"pm_req_t" },
1569 	{ (uint_t)PM_GET_COMPONENT_NAME,	"PM_GET_COMPONENT_NAME",
1570 		"pm_req_t" },
1571 	{ (uint_t)PM_GET_NUM_POWER_LEVELS,	"PM_GET_NUM_POWER_LEVELS",
1572 		"pm_req_t" },
1573 	{ (uint_t)PM_DIRECT_PM,			"PM_DIRECT_PM",
1574 		"pm_req_t" },
1575 	{ (uint_t)PM_RELEASE_DIRECT_PM,		"PM_RELEASE_DIRECT_PM",
1576 		"pm_req_t" },
1577 	{ (uint_t)PM_RESET_DEVICE_THRESHOLD,	"PM_RESET_DEVICE_THRESHOLD",
1578 		"pm_req_t" },
1579 	{ (uint_t)PM_GET_DEVICE_TYPE,		"PM_GET_DEVICE_TYPE",
1580 		"pm_req_t" },
1581 	{ (uint_t)PM_SET_COMPONENT_THRESHOLDS,	"PM_SET_COMPONENT_THRESHOLDS",
1582 		"pm_req_t" },
1583 	{ (uint_t)PM_GET_COMPONENT_THRESHOLDS,	"PM_GET_COMPONENT_THRESHOLDS",
1584 		"pm_req_t" },
1585 	{ (uint_t)PM_GET_DEVICE_THRESHOLD_BASIS,
1586 		"PM_GET_DEVICE_THRESHOLD_BASIS",	"pm_req_t" },
1587 	{ (uint_t)PM_SET_CURRENT_POWER,		"PM_SET_CURRENT_POWER",
1588 		"pm_req_t" },
1589 	{ (uint_t)PM_GET_CURRENT_POWER,		"PM_GET_CURRENT_POWER",
1590 		"pm_req_t" },
1591 	{ (uint_t)PM_GET_FULL_POWER,		"PM_GET_FULL_POWER",
1592 		"pm_req_t" },
1593 	{ (uint_t)PM_ADD_DEPENDENT,		"PM_ADD_DEPENDENT",
1594 		"pm_req_t" },
1595 	{ (uint_t)PM_GET_TIME_IDLE,		"PM_GET_TIME_IDLE",
1596 		"pm_req_t" },
1597 	{ (uint_t)PM_ADD_DEPENDENT_PROPERTY,	"PM_ADD_DEPENDENT_PROPERTY",
1598 		"pm_req_t" },
1599 	{ (uint_t)PM_GET_CMD_NAME,		"PM_GET_CMD_NAME",
1600 		"pm_req_t" },
1601 	{ (uint_t)PM_SEARCH_LIST,	"PM_SEARCH_LIST",
1602 		"pm_searchargs_t" },
1603 #endif /* _SYSCALL */
1604 
1605 	{ (uint_t)0, NULL, NULL	}
1606 };
1607 
1608 void
1609 ioctl_ioccom(char *buf, size_t size, uint_t code, int nbytes, int x, int y)
1610 {
1611 	const char *inoutstr;
1612 
1613 	if (code & IOC_VOID)
1614 		inoutstr = "";
1615 	else if ((code & IOC_INOUT) == IOC_INOUT)
1616 		inoutstr = "WR";
1617 	else
1618 		inoutstr = code & IOC_IN ? "W" : "R";
1619 
1620 	if (isascii(x) && isprint(x))
1621 		(void) snprintf(buf, size, "_IO%sN('%c', %d, %d)", inoutstr,
1622 		    x, y, nbytes);
1623 	else
1624 		(void) snprintf(buf, size, "_IO%sN(0x%x, %d, %d)", inoutstr,
1625 		    x, y, nbytes);
1626 }
1627 
1628 
1629 const char *
1630 ioctlname(private_t *pri, uint_t code)
1631 {
1632 	const struct ioc *ip;
1633 	const char *str = NULL;
1634 
1635 	for (ip = &ioc[0]; ip->name; ip++) {
1636 		if (code == ip->code) {
1637 			str = ip->name;
1638 			break;
1639 		}
1640 	}
1641 
1642 	/*
1643 	 * Developers hide ascii ioctl names in the ioctl subcode; for example
1644 	 * 0x445210 should be printed 'D'<<16|'R'<<8|10.  We allow for all
1645 	 * three high order bytes (called hi, mid and lo) to contain ascii
1646 	 * characters.
1647 	 */
1648 	if (str == NULL) {
1649 		int c_hi = code >> 24;
1650 		int c_mid = (code >> 16) & 0xff;
1651 		int c_mid_nm = (code >> 16);
1652 		int c_lo = (code >> 8) & 0xff;
1653 		int c_lo_nm = code >> 8;
1654 
1655 		if (isascii(c_lo) && isprint(c_lo) &&
1656 		    isascii(c_mid) && isprint(c_mid) &&
1657 		    isascii(c_hi) && isprint(c_hi))
1658 			(void) sprintf(pri->code_buf,
1659 			    "(('%c'<<24)|('%c'<<16)|('%c'<<8)|%d)",
1660 			    c_hi, c_mid, c_lo, code & 0xff);
1661 		else if (isascii(c_lo) && isprint(c_lo) &&
1662 		    isascii(c_mid_nm) && isprint(c_mid_nm))
1663 			(void) sprintf(pri->code_buf,
1664 			    "(('%c'<<16)|('%c'<<8)|%d)", c_mid, c_lo,
1665 			    code & 0xff);
1666 		else if (isascii(c_lo_nm) && isprint(c_lo_nm))
1667 			(void) sprintf(pri->code_buf, "(('%c'<<8)|%d)",
1668 			    c_lo_nm, code & 0xff);
1669 		else if (code & (IOC_VOID|IOC_INOUT))
1670 			ioctl_ioccom(pri->code_buf, sizeof (pri->code_buf),
1671 			    code, c_mid, c_lo, code & 0xff);
1672 		else
1673 			(void) sprintf(pri->code_buf, "0x%.4X", code);
1674 		str = (const char *)pri->code_buf;
1675 	}
1676 
1677 	return (str);
1678 }
1679 
1680 
1681 const char *
1682 ioctldatastruct(uint_t code)
1683 {
1684 	const struct ioc *ip;
1685 	const char *str = NULL;
1686 
1687 	for (ip = &ioc[0]; ip->name != NULL; ip++) {
1688 		if (code == ip->code) {
1689 			str = ip->datastruct;
1690 			break;
1691 		}
1692 	}
1693 	return (str);
1694 }
1695 
1696 
1697 const char *
1698 fcntlname(int code)
1699 {
1700 	const char *str = NULL;
1701 
1702 	if (code >= FCNTLMIN && code <= FCNTLMAX)
1703 		str = FCNTLname[code-FCNTLMIN];
1704 	return (str);
1705 }
1706 
1707 const char *
1708 sfsname(int code)
1709 {
1710 	const char *str = NULL;
1711 
1712 	if (code >= SYSFSMIN && code <= SYSFSMAX)
1713 		str = SYSFSname[code-SYSFSMIN];
1714 	return (str);
1715 }
1716 
1717 /* ARGSUSED */
1718 const char *
1719 si86name(int code)
1720 {
1721 	const char *str = NULL;
1722 
1723 #if defined(__i386) || defined(__amd64)
1724 	switch (code) {
1725 	case SI86SWPI:		str = "SI86SWPI";	break;
1726 	case SI86SYM:		str = "SI86SYM";	break;
1727 	case SI86CONF:		str = "SI86CONF";	break;
1728 	case SI86BOOT:		str = "SI86BOOT";	break;
1729 	case SI86AUTO:		str = "SI86AUTO";	break;
1730 	case SI86EDT:		str = "SI86EDT";	break;
1731 	case SI86SWAP:		str = "SI86SWAP";	break;
1732 	case SI86FPHW:		str = "SI86FPHW";	break;
1733 	case SI86FPSTART:	str = "SI86FPSTART";	break;
1734 	case GRNON:		str = "GRNON";		break;
1735 	case GRNFLASH:		str = "GRNFLASH";	break;
1736 	case STIME:		str = "STIME";		break;
1737 	case SETNAME:		str = "SETNAME";	break;
1738 	case RNVR:		str = "RNVR";		break;
1739 	case WNVR:		str = "WNVR";		break;
1740 	case RTODC:		str = "RTODC";		break;
1741 	case CHKSER:		str = "CHKSER";		break;
1742 	case SI86NVPRT:		str = "SI86NVPRT";	break;
1743 	case SANUPD:		str = "SANUPD";		break;
1744 	case SI86KSTR:		str = "SI86KSTR";	break;
1745 	case SI86MEM:		str = "SI86MEM";	break;
1746 	case SI86TODEMON:	str = "SI86TODEMON";	break;
1747 	case SI86CCDEMON:	str = "SI86CCDEMON";	break;
1748 	case SI86CACHE:		str = "SI86CACHE";	break;
1749 	case SI86DELMEM:	str = "SI86DELMEM";	break;
1750 	case SI86ADDMEM:	str = "SI86ADDMEM";	break;
1751 /* 71 through 74 reserved for VPIX */
1752 	case SI86V86: 		str = "SI86V86";	break;
1753 	case SI86SLTIME:	str = "SI86SLTIME";	break;
1754 	case SI86DSCR:		str = "SI86DSCR";	break;
1755 	case RDUBLK:		str = "RDUBLK";		break;
1756 /* NFA entry point */
1757 	case SI86NFA:		str = "SI86NFA";	break;
1758 	case SI86VM86:		str = "SI86VM86";	break;
1759 	case SI86VMENABLE:	str = "SI86VMENABLE";	break;
1760 	case SI86LIMUSER:	str = "SI86LIMUSER";	break;
1761 	case SI86RDID: 		str = "SI86RDID";	break;
1762 	case SI86RDBOOT:	str = "SI86RDBOOT";	break;
1763 /* Merged Product defines */
1764 	case SI86SHFIL:		str = "SI86SHFIL";	break;
1765 	case SI86PCHRGN:	str = "SI86PCHRGN";	break;
1766 	case SI86BADVISE:	str = "SI86BADVISE";	break;
1767 	case SI86SHRGN:		str = "SI86SHRGN";	break;
1768 	case SI86CHIDT:		str = "SI86CHIDT";	break;
1769 	case SI86EMULRDA: 	str = "SI86EMULRDA";	break;
1770 /* RTC commands */
1771 	case WTODC:		str = "WTODC";		break;
1772 	case SGMTL:		str = "SGMTL";		break;
1773 	case GGMTL:		str = "GGMTL";		break;
1774 	case RTCSYNC:		str = "RTCSYNC";	break;
1775 	}
1776 #endif /* __i386 */
1777 
1778 	return (str);
1779 }
1780 
1781 const char *
1782 utscode(int code)
1783 {
1784 	const char *str = NULL;
1785 
1786 	switch (code) {
1787 	case UTS_UNAME:		str = "UNAME";	break;
1788 	case UTS_USTAT:		str = "USTAT";	break;
1789 	case UTS_FUSERS:	str = "FUSERS";	break;
1790 	}
1791 
1792 	return (str);
1793 }
1794 
1795 const char *
1796 rctlsyscode(int code)
1797 {
1798 	const char *str = NULL;
1799 	switch (code) {
1800 	case 0:		str = "GETRCTL";	break;
1801 	case 1:		str = "SETRCTL";	break;
1802 	case 2:		str = "RCTLSYS_LST";	break;
1803 	case 3:		str = "RCTLSYS_CTL";	break;
1804 	case 4:		str = "RCTLSYS_SETPROJ";	break;
1805 	default:	str = "UNKNOWN";	break;
1806 	}
1807 	return (str);
1808 }
1809 
1810 const char *
1811 rctl_local_action(private_t *pri, uint_t val)
1812 {
1813 	uint_t action = val & (~RCTL_LOCAL_ACTION_MASK);
1814 
1815 	char *s = pri->code_buf;
1816 
1817 	*s = '\0';
1818 
1819 	if (action & RCTL_LOCAL_NOACTION) {
1820 		action ^= RCTL_LOCAL_NOACTION;
1821 		(void) strlcat(s, "|RCTL_LOCAL_NOACTION",
1822 		    sizeof (pri->code_buf));
1823 	}
1824 	if (action & RCTL_LOCAL_SIGNAL) {
1825 		action ^= RCTL_LOCAL_SIGNAL;
1826 		(void) strlcat(s, "|RCTL_LOCAL_SIGNAL",
1827 		    sizeof (pri->code_buf));
1828 	}
1829 	if (action & RCTL_LOCAL_DENY) {
1830 		action ^= RCTL_LOCAL_DENY;
1831 		(void) strlcat(s, "|RCTL_LOCAL_DENY",
1832 		    sizeof (pri->code_buf));
1833 	}
1834 
1835 	if ((action & (~RCTL_LOCAL_ACTION_MASK)) != 0)
1836 		return (NULL);
1837 	else if (*s != '\0')
1838 		return (s+1);
1839 	else
1840 		return (NULL);
1841 }
1842 
1843 
1844 const char *
1845 rctl_local_flags(private_t *pri, uint_t val)
1846 {
1847 	uint_t pval = val & RCTL_LOCAL_ACTION_MASK;
1848 	char *s = pri->code_buf;
1849 
1850 	*s = '\0';
1851 
1852 	if (pval & RCTL_LOCAL_MAXIMAL) {
1853 		pval ^= RCTL_LOCAL_MAXIMAL;
1854 		(void) strlcat(s, "|RCTL_LOCAL_MAXIMAL",
1855 		    sizeof (pri->code_buf));
1856 	}
1857 
1858 	if ((pval & RCTL_LOCAL_ACTION_MASK) != 0)
1859 		return (NULL);
1860 	else if (*s != '\0')
1861 		return (s+1);
1862 	else
1863 		return (NULL);
1864 }
1865 
1866 
1867 const char *
1868 sconfname(int code)
1869 {
1870 	const char *str = NULL;
1871 
1872 	if (code >= SCONFMIN && code <= SCONFMAX)
1873 		str = SCONFname[code-SCONFMIN];
1874 	return (str);
1875 }
1876 
1877 const char *
1878 pathconfname(int code)
1879 {
1880 	const char *str = NULL;
1881 
1882 	if (code >= PATHCONFMIN && code <= PATHCONFMAX)
1883 		str = PATHCONFname[code-PATHCONFMIN];
1884 	return (str);
1885 }
1886 
1887 #define	ALL_O_FLAGS \
1888 	(O_NDELAY|O_APPEND|O_SYNC|O_DSYNC|O_NONBLOCK|O_CREAT|O_TRUNC\
1889 	|O_EXCL|O_NOCTTY|O_LARGEFILE|O_RSYNC|O_XATTR|O_NOFOLLOW|O_NOLINKS\
1890 	|FXATTRDIROPEN)
1891 
1892 const char *
1893 openarg(private_t *pri, int arg)
1894 {
1895 	char *str = pri->code_buf;
1896 
1897 	switch (arg & ~ALL_O_FLAGS) {
1898 	default:
1899 		return ((char *)NULL);
1900 	case O_RDONLY:
1901 		(void) strcpy(str, "O_RDONLY");
1902 		break;
1903 	case O_WRONLY:
1904 		(void) strcpy(str, "O_WRONLY");
1905 		break;
1906 	case O_RDWR:
1907 		(void) strcpy(str, "O_RDWR");
1908 		break;
1909 	}
1910 
1911 	if (arg & O_NDELAY)
1912 		(void) strlcat(str, "|O_NDELAY", sizeof (pri->code_buf));
1913 	if (arg & O_APPEND)
1914 		(void) strlcat(str, "|O_APPEND", sizeof (pri->code_buf));
1915 	if (arg & O_SYNC)
1916 		(void) strlcat(str, "|O_SYNC", sizeof (pri->code_buf));
1917 	if (arg & O_DSYNC)
1918 		(void) strlcat(str, "|O_DSYNC", sizeof (pri->code_buf));
1919 	if (arg & O_NONBLOCK)
1920 		(void) strlcat(str, "|O_NONBLOCK", sizeof (pri->code_buf));
1921 	if (arg & O_CREAT)
1922 		(void) strlcat(str, "|O_CREAT", sizeof (pri->code_buf));
1923 	if (arg & O_TRUNC)
1924 		(void) strlcat(str, "|O_TRUNC", sizeof (pri->code_buf));
1925 	if (arg & O_EXCL)
1926 		(void) strlcat(str, "|O_EXCL", sizeof (pri->code_buf));
1927 	if (arg & O_NOCTTY)
1928 		(void) strlcat(str, "|O_NOCTTY", sizeof (pri->code_buf));
1929 	if (arg & O_LARGEFILE)
1930 		(void) strlcat(str, "|O_LARGEFILE", sizeof (pri->code_buf));
1931 	if (arg & O_RSYNC)
1932 		(void) strlcat(str, "|O_RSYNC", sizeof (pri->code_buf));
1933 	if (arg & O_XATTR)
1934 		(void) strlcat(str, "|O_XATTR", sizeof (pri->code_buf));
1935 	if (arg & O_NOFOLLOW)
1936 		(void) strlcat(str, "|O_NOFOLLOW", sizeof (pri->code_buf));
1937 	if (arg & O_NOLINKS)
1938 		(void) strlcat(str, "|O_NOLINKS", sizeof (pri->code_buf));
1939 	if (arg & FXATTRDIROPEN)
1940 		(void) strlcat(str, "|FXATTRDIROPEN", sizeof (pri->code_buf));
1941 
1942 	return ((const char *)str);
1943 }
1944 
1945 const char *
1946 whencearg(int arg)
1947 {
1948 	const char *str = NULL;
1949 
1950 	switch (arg) {
1951 	case SEEK_SET:	str = "SEEK_SET";	break;
1952 	case SEEK_CUR:	str = "SEEK_CUR";	break;
1953 	case SEEK_END:	str = "SEEK_END";	break;
1954 	case SEEK_DATA:	str = "SEEK_DATA";	break;
1955 	case SEEK_HOLE:	str = "SEEK_HOLE";	break;
1956 	}
1957 
1958 	return (str);
1959 }
1960 
1961 #define	IPC_FLAGS	(IPC_ALLOC|IPC_CREAT|IPC_EXCL|IPC_NOWAIT)
1962 
1963 char *
1964 ipcflags(private_t *pri, int arg)
1965 {
1966 	char *str = pri->code_buf;
1967 
1968 	if (arg & 0777)
1969 		(void) sprintf(str, "0%.3o", arg&0777);
1970 	else
1971 		*str = '\0';
1972 
1973 	if (arg & IPC_ALLOC)
1974 		(void) strcat(str, "|IPC_ALLOC");
1975 	if (arg & IPC_CREAT)
1976 		(void) strcat(str, "|IPC_CREAT");
1977 	if (arg & IPC_EXCL)
1978 		(void) strcat(str, "|IPC_EXCL");
1979 	if (arg & IPC_NOWAIT)
1980 		(void) strcat(str, "|IPC_NOWAIT");
1981 
1982 	return (str);
1983 }
1984 
1985 const char *
1986 msgflags(private_t *pri, int arg)
1987 {
1988 	char *str;
1989 
1990 	if (arg == 0 || (arg & ~(IPC_FLAGS|MSG_NOERROR|0777)) != 0)
1991 		return ((char *)NULL);
1992 
1993 	str = ipcflags(pri, arg);
1994 
1995 	if (arg & MSG_NOERROR)
1996 		(void) strcat(str, "|MSG_NOERROR");
1997 
1998 	if (*str == '|')
1999 		str++;
2000 	return ((const char *)str);
2001 }
2002 
2003 const char *
2004 semflags(private_t *pri, int arg)
2005 {
2006 	char *str;
2007 
2008 	if (arg == 0 || (arg & ~(IPC_FLAGS|SEM_UNDO|0777)) != 0)
2009 		return ((char *)NULL);
2010 
2011 	str = ipcflags(pri, arg);
2012 
2013 	if (arg & SEM_UNDO)
2014 		(void) strcat(str, "|SEM_UNDO");
2015 
2016 	if (*str == '|')
2017 		str++;
2018 	return ((const char *)str);
2019 }
2020 
2021 const char *
2022 shmflags(private_t *pri, int arg)
2023 {
2024 	char *str;
2025 
2026 	if (arg == 0 || (arg & ~(IPC_FLAGS|SHM_RDONLY|SHM_RND|0777)) != 0)
2027 		return ((char *)NULL);
2028 
2029 	str = ipcflags(pri, arg);
2030 
2031 	if (arg & SHM_RDONLY)
2032 		(void) strcat(str, "|SHM_RDONLY");
2033 	if (arg & SHM_RND)
2034 		(void) strcat(str, "|SHM_RND");
2035 
2036 	if (*str == '|')
2037 		str++;
2038 	return ((const char *)str);
2039 }
2040 
2041 #define	MSGCMDMIN	0
2042 #define	MSGCMDMAX	IPC_STAT64
2043 const char *const MSGCMDname[MSGCMDMAX+1] = {
2044 	NULL, NULL, NULL, NULL, NULL,
2045 	NULL, NULL, NULL, NULL, NULL,
2046 	"IPC_RMID",	/* 10 */
2047 	"IPC_SET",	/* 11 */
2048 	"IPC_STAT",	/* 12 */
2049 	"IPC_SET64",	/* 13 */
2050 	"IPC_STAT64",	/* 14 */
2051 };
2052 
2053 #define	SEMCMDMIN	0
2054 #define	SEMCMDMAX	IPC_STAT64
2055 const char *const SEMCMDname[SEMCMDMAX+1] = {
2056 	NULL,		/* 0 */
2057 	NULL,		/* 1 */
2058 	NULL,		/* 2 */
2059 	"GETNCNT",	/* 3 */
2060 	"GETPID",	/* 4 */
2061 	"GETVAL",	/* 5 */
2062 	"GETALL",	/* 6 */
2063 	"GETZCNT",	/* 7 */
2064 	"SETVAL",	/* 8 */
2065 	"SETALL",	/* 9 */
2066 	"IPC_RMID",	/* 10 */
2067 	"IPC_SET",	/* 11 */
2068 	"IPC_STAT",	/* 12 */
2069 	"IPC_SET64",	/* 13 */
2070 	"IPC_STAT64",	/* 14 */
2071 };
2072 
2073 #define	SHMCMDMIN	0
2074 #define	SHMCMDMAX	IPC_STAT64
2075 const char *const SHMCMDname[SHMCMDMAX+1] = {
2076 	NULL,		/* 0 */
2077 	NULL,		/* 1 */
2078 	NULL,		/* 2 */
2079 	"SHM_LOCK",	/* 3 */
2080 	"SHM_UNLOCK",	/* 4 */
2081 	NULL, NULL, NULL, NULL, NULL,			/* 5 NULLs */
2082 	"IPC_RMID",	/* 10 */
2083 	"IPC_SET",	/* 11 */
2084 	"IPC_STAT",	/* 12 */
2085 	"IPC_SET64",	/* 13 */
2086 	"IPC_STAT64",	/* 14 */
2087 };
2088 
2089 const char *
2090 msgcmd(int arg)
2091 {
2092 	const char *str = NULL;
2093 
2094 	if (arg >= MSGCMDMIN && arg <= MSGCMDMAX)
2095 		str = MSGCMDname[arg-MSGCMDMIN];
2096 	return (str);
2097 }
2098 
2099 const char *
2100 semcmd(int arg)
2101 {
2102 	const char *str = NULL;
2103 
2104 	if (arg >= SEMCMDMIN && arg <= SEMCMDMAX)
2105 		str = SEMCMDname[arg-SEMCMDMIN];
2106 	return (str);
2107 }
2108 
2109 const char *
2110 shmcmd(int arg)
2111 {
2112 	const char *str = NULL;
2113 
2114 	if (arg >= SHMCMDMIN && arg <= SHMCMDMAX)
2115 		str = SHMCMDname[arg-SHMCMDMIN];
2116 	return (str);
2117 }
2118 
2119 const char *
2120 strrdopt(int arg)	/* streams read option (I_SRDOPT I_GRDOPT) */
2121 {
2122 	const char *str = NULL;
2123 
2124 	switch (arg) {
2125 	case RNORM:	str = "RNORM";		break;
2126 	case RMSGD:	str = "RMSGD";		break;
2127 	case RMSGN:	str = "RMSGN";		break;
2128 	}
2129 
2130 	return (str);
2131 }
2132 
2133 /* bit map of streams events (I_SETSIG & I_GETSIG) */
2134 const char *
2135 strevents(private_t *pri, int arg)
2136 {
2137 	char *str = pri->code_buf;
2138 
2139 	if (arg & ~(S_INPUT|S_HIPRI|S_OUTPUT|S_MSG|S_ERROR|S_HANGUP))
2140 		return ((char *)NULL);
2141 
2142 	*str = '\0';
2143 	if (arg & S_INPUT)
2144 		(void) strcat(str, "|S_INPUT");
2145 	if (arg & S_HIPRI)
2146 		(void) strcat(str, "|S_HIPRI");
2147 	if (arg & S_OUTPUT)
2148 		(void) strcat(str, "|S_OUTPUT");
2149 	if (arg & S_MSG)
2150 		(void) strcat(str, "|S_MSG");
2151 	if (arg & S_ERROR)
2152 		(void) strcat(str, "|S_ERROR");
2153 	if (arg & S_HANGUP)
2154 		(void) strcat(str, "|S_HANGUP");
2155 
2156 	return ((const char *)(str+1));
2157 }
2158 
2159 const char *
2160 tiocflush(private_t *pri, int arg)	/* bit map passsed by TIOCFLUSH */
2161 {
2162 	char *str = pri->code_buf;
2163 
2164 	if (arg & ~(FREAD|FWRITE))
2165 		return ((char *)NULL);
2166 
2167 	*str = '\0';
2168 	if (arg & FREAD)
2169 		(void) strcat(str, "|FREAD");
2170 	if (arg & FWRITE)
2171 		(void) strcat(str, "|FWRITE");
2172 
2173 	return ((const char *)(str+1));
2174 }
2175 
2176 const char *
2177 strflush(int arg)	/* streams flush option (I_FLUSH) */
2178 {
2179 	const char *str = NULL;
2180 
2181 	switch (arg) {
2182 	case FLUSHR:	str = "FLUSHR";		break;
2183 	case FLUSHW:	str = "FLUSHW";		break;
2184 	case FLUSHRW:	str = "FLUSHRW";	break;
2185 	}
2186 
2187 	return (str);
2188 }
2189 
2190 #define	ALL_MOUNT_FLAGS	(MS_RDONLY|MS_FSS|MS_DATA|MS_NOSUID|MS_REMOUNT| \
2191 	MS_NOTRUNC|MS_OVERLAY|MS_OPTIONSTR|MS_GLOBAL|MS_FORCE|MS_NOMNTTAB)
2192 
2193 const char *
2194 mountflags(private_t *pri, int arg)	/* bit map of mount syscall flags */
2195 {
2196 	char *str = pri->code_buf;
2197 	size_t used = 0;
2198 
2199 	if (arg & ~ALL_MOUNT_FLAGS)
2200 		return ((char *)NULL);
2201 
2202 	*str = '\0';
2203 	if (arg & MS_RDONLY)
2204 		used = strlcat(str, "|MS_RDONLY", sizeof (pri->code_buf));
2205 	if (arg & MS_FSS)
2206 		used = strlcat(str, "|MS_FSS", sizeof (pri->code_buf));
2207 	if (arg & MS_DATA)
2208 		used = strlcat(str, "|MS_DATA", sizeof (pri->code_buf));
2209 	if (arg & MS_NOSUID)
2210 		used = strlcat(str, "|MS_NOSUID", sizeof (pri->code_buf));
2211 	if (arg & MS_REMOUNT)
2212 		used = strlcat(str, "|MS_REMOUNT", sizeof (pri->code_buf));
2213 	if (arg & MS_NOTRUNC)
2214 		used = strlcat(str, "|MS_NOTRUNC", sizeof (pri->code_buf));
2215 	if (arg & MS_OVERLAY)
2216 		used = strlcat(str, "|MS_OVERLAY", sizeof (pri->code_buf));
2217 	if (arg & MS_OPTIONSTR)
2218 		used = strlcat(str, "|MS_OPTIONSTR", sizeof (pri->code_buf));
2219 	if (arg & MS_GLOBAL)
2220 		used = strlcat(str, "|MS_GLOBAL", sizeof (pri->code_buf));
2221 	if (arg & MS_FORCE)
2222 		used = strlcat(str, "|MS_FORCE", sizeof (pri->code_buf));
2223 	if (arg & MS_NOMNTTAB)
2224 		used = strlcat(str, "|MS_NOMNTTAB", sizeof (pri->code_buf));
2225 
2226 	if (used == 0 || used >= sizeof (pri->code_buf))
2227 		return ((char *)NULL);			/* use prt_hex() */
2228 
2229 	return ((const char *)(str+1));
2230 }
2231 
2232 const char *
2233 svfsflags(private_t *pri, ulong_t arg)	/* bit map of statvfs syscall flags */
2234 {
2235 	char *str = pri->code_buf;
2236 
2237 	if (arg & ~(ST_RDONLY|ST_NOSUID|ST_NOTRUNC)) {
2238 		(void) sprintf(str, "0x%lx", arg);
2239 		return (str);
2240 	}
2241 	*str = '\0';
2242 	if (arg & ST_RDONLY)
2243 		(void) strcat(str, "|ST_RDONLY");
2244 	if (arg & ST_NOSUID)
2245 		(void) strcat(str, "|ST_NOSUID");
2246 	if (arg & ST_NOTRUNC)
2247 		(void) strcat(str, "|ST_NOTRUNC");
2248 	if (*str == '\0')
2249 		(void) strcat(str, "|0");
2250 	return ((const char *)(str+1));
2251 }
2252 
2253 const char *
2254 fuiname(int arg)	/* fusers() input argument */
2255 {
2256 	const char *str = NULL;
2257 
2258 	switch (arg) {
2259 	case F_FILE_ONLY:	str = "F_FILE_ONLY";		break;
2260 	case F_CONTAINED:	str = "F_CONTAINED";		break;
2261 	}
2262 
2263 	return (str);
2264 }
2265 
2266 const char *
2267 fuflags(private_t *pri, int arg)	/* fusers() output flags */
2268 {
2269 	char *str = pri->code_buf;
2270 
2271 	if (arg & ~(F_CDIR|F_RDIR|F_TEXT|F_MAP|F_OPEN|F_TRACE|F_TTY)) {
2272 		(void) sprintf(str, "0x%x", arg);
2273 		return (str);
2274 	}
2275 	*str = '\0';
2276 	if (arg & F_CDIR)
2277 		(void) strcat(str, "|F_CDIR");
2278 	if (arg & F_RDIR)
2279 		(void) strcat(str, "|F_RDIR");
2280 	if (arg & F_TEXT)
2281 		(void) strcat(str, "|F_TEXT");
2282 	if (arg & F_MAP)
2283 		(void) strcat(str, "|F_MAP");
2284 	if (arg & F_OPEN)
2285 		(void) strcat(str, "|F_OPEN");
2286 	if (arg & F_TRACE)
2287 		(void) strcat(str, "|F_TRACE");
2288 	if (arg & F_TTY)
2289 		(void) strcat(str, "|F_TTY");
2290 	if (*str == '\0')
2291 		(void) strcat(str, "|0");
2292 	return ((const char *)(str+1));
2293 }
2294 
2295 
2296 const char *
2297 ipprotos(int arg)	/* IP protocols cf. netinet/in.h */
2298 {
2299 	switch (arg) {
2300 	case IPPROTO_IP:	return ("IPPROTO_IP");
2301 	case IPPROTO_ICMP:	return ("IPPROTO_ICMP");
2302 	case IPPROTO_IGMP:	return ("IPPROTO_IGMP");
2303 	case IPPROTO_GGP:	return ("IPPROTO_GGP");
2304 	case IPPROTO_ENCAP:	return ("IPPROTO_ENCAP");
2305 	case IPPROTO_TCP:	return ("IPPROTO_TCP");
2306 	case IPPROTO_EGP:	return ("IPPROTO_EGP");
2307 	case IPPROTO_PUP:	return ("IPPROTO_PUP");
2308 	case IPPROTO_UDP:	return ("IPPROTO_UDP");
2309 	case IPPROTO_IDP:	return ("IPPROTO_IDP");
2310 	case IPPROTO_IPV6:	return ("IPPROTO_IPV6");
2311 	case IPPROTO_ROUTING:	return ("IPPROTO_ROUTING");
2312 	case IPPROTO_FRAGMENT:	return ("IPPROTO_FRAGMENT");
2313 	case IPPROTO_RSVP:	return ("IPPROTO_RSVP");
2314 	case IPPROTO_ESP:	return ("IPPROTO_ESP");
2315 	case IPPROTO_AH:	return ("IPPROTO_AH");
2316 	case IPPROTO_ICMPV6:	return ("IPPROTO_ICMPV6");
2317 	case IPPROTO_NONE:	return ("IPPROTO_NONE");
2318 	case IPPROTO_DSTOPTS:	return ("IPPROTO_DSTOPTS");
2319 	case IPPROTO_HELLO:	return ("IPPROTO_HELLO");
2320 	case IPPROTO_ND:	return ("IPPROTO_ND");
2321 	case IPPROTO_EON:	return ("IPPROTO_EON");
2322 	case IPPROTO_PIM:	return ("IPPROTO_PIM");
2323 	case IPPROTO_SCTP:	return ("IPPROTO_SCTP");
2324 	case IPPROTO_RAW:	return ("IPPROTO_RAW");
2325 	default:		return (NULL);
2326 	}
2327 }
2328