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