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