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