blob: 75f929137e9b245618d3b5f6806f9d8fb5a11fcf [file] [log] [blame]
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001/*
2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
Wichert Akkerman4dc8a2a1999-12-23 14:20:14 +00005 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00006 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 * $Id$
31 */
32
33#include "defs.h"
34
35#ifdef LINUX
36#define _LINUX_SOCKET_H
Wichert Akkerman14cd9f01999-07-09 18:56:34 +000037#define _LINUX_FS_H
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000038
Roland McGrathcbd33582005-02-02 04:36:11 +000039#define MS_RDONLY 1 /* Mount read-only */
40#define MS_NOSUID 2 /* Ignore suid and sgid bits */
41#define MS_NODEV 4 /* Disallow access to device special files */
42#define MS_NOEXEC 8 /* Disallow program execution */
43#define MS_SYNCHRONOUS 16 /* Writes are synced at once */
44#define MS_REMOUNT 32 /* Alter flags of a mounted FS */
45#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
46#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
47#define MS_NOATIME 1024 /* Do not update access times. */
48#define MS_NODIRATIME 2048 /* Do not update directory access times */
49#define MS_BIND 4096
50#define MS_MOVE 8192
51#define MS_REC 16384
Dmitry V. Levin817b7082007-01-16 15:10:07 +000052#define MS_SILENT 32768
Roland McGrathcbd33582005-02-02 04:36:11 +000053#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
Dmitry V. Levin817b7082007-01-16 15:10:07 +000054#define MS_UNBINDABLE (1<<17) /* change to unbindable */
55#define MS_PRIVATE (1<<18) /* change to private */
56#define MS_SLAVE (1<<19) /* change to slave */
57#define MS_SHARED (1<<20) /* change to shared */
Mike Frysinger22485b72011-02-21 23:04:30 -050058#define MS_RELATIME (1<<21)
59#define MS_KERNMOUNT (1<<22)
60#define MS_I_VERSION (1<<23)
61#define MS_STRICTATIME (1<<24)
62#define MS_BORN (1<<29)
Roland McGrathcbd33582005-02-02 04:36:11 +000063#define MS_ACTIVE (1<<30)
64#define MS_NOUSER (1<<31)
Roland McGrath6af37482006-01-12 21:21:06 +000065#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number */
Dmitry V. Levin817b7082007-01-16 15:10:07 +000066#define MS_MGC_MSK 0xffff0000 /* Magic flag mask */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000067
68#include <sys/socket.h>
69#include <netinet/in.h>
70#include <arpa/inet.h>
71
Nate Sammons8d5860c1999-07-03 18:53:05 +000072#include <sys/syscall.h>
73
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +000074#ifdef HAVE_LINUX_CAPABILITY_H
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000075#include <linux/capability.h>
76#endif
77
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +000078#ifdef HAVE_ASM_CACHECTL_H
Wichert Akkerman2e2553a1999-05-09 00:29:58 +000079#include <asm/cachectl.h>
80#endif
81
Wichert Akkermand6b92492001-04-07 21:37:12 +000082#ifdef HAVE_LINUX_USTNAME_H
83#include <linux/utsname.h>
84#endif
85
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +000086#ifdef HAVE_ASM_SYSMIPS_H
Wichert Akkermand6b92492001-04-07 21:37:12 +000087#include <asm/sysmips.h>
88#endif
89
Wichert Akkerman22fe9d21999-05-27 12:00:57 +000090#include <linux/sysctl.h>
Wichert Akkerman22fe9d21999-05-27 12:00:57 +000091
Roland McGrathd9f816f2004-09-04 03:39:20 +000092static const struct xlat mount_flags[] = {
Roland McGrath6af37482006-01-12 21:21:06 +000093 { MS_MGC_VAL, "MS_MGC_VAL" },
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000094 { MS_RDONLY, "MS_RDONLY" },
95 { MS_NOSUID, "MS_NOSUID" },
96 { MS_NODEV, "MS_NODEV" },
97 { MS_NOEXEC, "MS_NOEXEC" },
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000098 { MS_SYNCHRONOUS,"MS_SYNCHRONOUS"},
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000099 { MS_REMOUNT, "MS_REMOUNT" },
Mike Frysinger22485b72011-02-21 23:04:30 -0500100 { MS_RELATIME, "MS_RELATIME" },
101 { MS_KERNMOUNT, "MS_KERNMOUNT" },
102 { MS_I_VERSION, "MS_I_VERSION" },
103 { MS_STRICTATIME,"MS_STRICTATIME"},
104 { MS_BORN, "MS_BORN" },
Roland McGrathcbd33582005-02-02 04:36:11 +0000105 { MS_MANDLOCK, "MS_MANDLOCK" },
106 { MS_NOATIME, "MS_NOATIME" },
107 { MS_NODIRATIME,"MS_NODIRATIME" },
108 { MS_BIND, "MS_BIND" },
109 { MS_MOVE, "MS_MOVE" },
110 { MS_REC, "MS_REC" },
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000111 { MS_SILENT, "MS_SILENT" },
Roland McGrathcbd33582005-02-02 04:36:11 +0000112 { MS_POSIXACL, "MS_POSIXACL" },
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000113 { MS_UNBINDABLE,"MS_UNBINDABLE" },
114 { MS_PRIVATE, "MS_PRIVATE" },
115 { MS_SLAVE, "MS_SLAVE" },
116 { MS_SHARED, "MS_SHARED" },
Roland McGrathcbd33582005-02-02 04:36:11 +0000117 { MS_ACTIVE, "MS_ACTIVE" },
118 { MS_NOUSER, "MS_NOUSER" },
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000119 { 0, NULL },
120};
121
122int
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000123sys_mount(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000124{
125 if (entering(tcp)) {
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000126 int ignore_type = 0, ignore_data = 0;
127 unsigned long flags = tcp->u_arg[3];
128
129 /* Discard magic */
130 if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
131 flags &= ~MS_MGC_MSK;
132
133 if (flags & MS_REMOUNT)
134 ignore_type = 1;
135 else if (flags & (MS_BIND | MS_MOVE))
136 ignore_type = ignore_data = 1;
137
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000138 printpath(tcp, tcp->u_arg[0]);
139 tprintf(", ");
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000140
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000141 printpath(tcp, tcp->u_arg[1]);
142 tprintf(", ");
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000143
144 if (ignore_type && tcp->u_arg[2])
Roland McGrathcbd33582005-02-02 04:36:11 +0000145 tprintf("%#lx", tcp->u_arg[2]);
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000146 else
147 printstr(tcp, tcp->u_arg[2], -1);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000148 tprintf(", ");
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000149
Roland McGrathb2dee132005-06-01 19:02:36 +0000150 printflags(mount_flags, tcp->u_arg[3], "MS_???");
Roland McGrath6af37482006-01-12 21:21:06 +0000151 tprintf(", ");
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000152
153 if (ignore_data && tcp->u_arg[4])
Roland McGrath6af37482006-01-12 21:21:06 +0000154 tprintf("%#lx", tcp->u_arg[4]);
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000155 else
156 printstr(tcp, tcp->u_arg[4], -1);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000157 }
158 return 0;
159}
160
Dmitry V. Levin5c7ad8c2007-01-13 11:15:48 +0000161#define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */
162#define MNT_DETACH 0x00000002 /* Just detach from the tree */
163#define MNT_EXPIRE 0x00000004 /* Mark for expiry */
164
165static const struct xlat umount_flags[] = {
166 { MNT_FORCE, "MNT_FORCE" },
167 { MNT_DETACH, "MNT_DETACH" },
168 { MNT_EXPIRE, "MNT_EXPIRE" },
169 { 0, NULL },
170};
171
Wichert Akkermandacfb6e1999-06-03 14:21:07 +0000172int
Dmitry V. Levin5c7ad8c2007-01-13 11:15:48 +0000173sys_umount2(struct tcb *tcp)
Wichert Akkermandacfb6e1999-06-03 14:21:07 +0000174{
175 if (entering(tcp)) {
176 printstr(tcp, tcp->u_arg[0], -1);
177 tprintf(", ");
Dmitry V. Levin5c7ad8c2007-01-13 11:15:48 +0000178 printflags(umount_flags, tcp->u_arg[1], "MNT_???");
Wichert Akkermandacfb6e1999-06-03 14:21:07 +0000179 }
180 return 0;
181}
182
Roland McGrathced50da2004-08-31 06:48:46 +0000183/* These are not macros, but enums. We just copy the values by hand
184 from Linux 2.6.9 here. */
Roland McGrathd9f816f2004-09-04 03:39:20 +0000185static const struct xlat personality_options[] = {
Roland McGrathced50da2004-08-31 06:48:46 +0000186 { 0, "PER_LINUX" },
187 { 0x00800000, "PER_LINUX_32BIT"},
188 { 0x04100001, "PER_SVR4" },
189 { 0x05000002, "PER_SVR3" },
190 { 0x07000003, "PER_SCOSVR3" },
191 { 0x06000003, "PER_OSR5" },
192 { 0x05000004, "PER_WYSEV386" },
193 { 0x04000005, "PER_ISCR4" },
194 { 0x00000006, "PER_BSD" },
195 { 0x04000006, "PER_SUNOS" },
196 { 0x05000007, "PER_XENIX" },
197 { 0x00000008, "PER_LINUX32" },
198 { 0x08000008, "PER_LINUX32_3GB"},
199 { 0x04000009, "PER_IRIX32" },
200 { 0x0400000a, "PER_IRIXN32" },
201 { 0x0400000b, "PER_IRIX64" },
202 { 0x0000000c, "PER_RISCOS" },
203 { 0x0400000d, "PER_SOLARIS" },
204 { 0x0410000e, "PER_UW7" },
205 { 0x0000000f, "PER_OSF4" },
206 { 0x00000010, "PER_HPUX" },
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000207 { 0, NULL },
208};
209
210int
211sys_personality(tcp)
212struct tcb *tcp;
213{
214 if (entering(tcp))
215 printxval(personality_options, tcp->u_arg[0], "PER_???");
216 return 0;
217}
218
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000219#include <linux/reboot.h>
Roland McGrathd9f816f2004-09-04 03:39:20 +0000220static const struct xlat bootflags1[] = {
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000221 { LINUX_REBOOT_MAGIC1, "LINUX_REBOOT_MAGIC1" },
222 { 0, NULL },
223};
224
Roland McGrathd9f816f2004-09-04 03:39:20 +0000225static const struct xlat bootflags2[] = {
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000226 { LINUX_REBOOT_MAGIC2, "LINUX_REBOOT_MAGIC2" },
227 { LINUX_REBOOT_MAGIC2A, "LINUX_REBOOT_MAGIC2A" },
228 { LINUX_REBOOT_MAGIC2B, "LINUX_REBOOT_MAGIC2B" },
229 { 0, NULL },
230};
231
Roland McGrathd9f816f2004-09-04 03:39:20 +0000232static const struct xlat bootflags3[] = {
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000233 { LINUX_REBOOT_CMD_CAD_OFF, "LINUX_REBOOT_CMD_CAD_OFF" },
234 { LINUX_REBOOT_CMD_RESTART, "LINUX_REBOOT_CMD_RESTART" },
235 { LINUX_REBOOT_CMD_HALT, "LINUX_REBOOT_CMD_HALT" },
236 { LINUX_REBOOT_CMD_CAD_ON, "LINUX_REBOOT_CMD_CAD_ON" },
237 { LINUX_REBOOT_CMD_POWER_OFF, "LINUX_REBOOT_CMD_POWER_OFF" },
238 { LINUX_REBOOT_CMD_RESTART2, "LINUX_REBOOT_CMD_RESTART2" },
239 { 0, NULL },
240};
241
242int
243sys_reboot(tcp)
244struct tcb *tcp;
245{
246 if (entering(tcp)) {
Roland McGrathb2dee132005-06-01 19:02:36 +0000247 printflags(bootflags1, tcp->u_arg[0], "LINUX_REBOOT_MAGIC_???");
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000248 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000249 printflags(bootflags2, tcp->u_arg[1], "LINUX_REBOOT_MAGIC_???");
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000250 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000251 printflags(bootflags3, tcp->u_arg[2], "LINUX_REBOOT_CMD_???");
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000252 if (tcp->u_arg[2] == LINUX_REBOOT_CMD_RESTART2) {
253 tprintf(", ");
254 printstr(tcp, tcp->u_arg[3], -1);
255 }
256 }
257 return 0;
258}
259
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000260#ifdef M68K
Roland McGrathd9f816f2004-09-04 03:39:20 +0000261static const struct xlat cacheflush_scope[] = {
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000262#ifdef FLUSH_SCOPE_LINE
263 { FLUSH_SCOPE_LINE, "FLUSH_SCOPE_LINE" },
264#endif
265#ifdef FLUSH_SCOPE_PAGE
266 { FLUSH_SCOPE_PAGE, "FLUSH_SCOPE_PAGE" },
267#endif
268#ifdef FLUSH_SCOPE_ALL
269 { FLUSH_SCOPE_ALL, "FLUSH_SCOPE_ALL" },
270#endif
271 { 0, NULL },
272};
273
Roland McGrathd9f816f2004-09-04 03:39:20 +0000274static const struct xlat cacheflush_flags[] = {
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000275#ifdef FLUSH_CACHE_BOTH
276 { FLUSH_CACHE_BOTH, "FLUSH_CACHE_BOTH" },
277#endif
278#ifdef FLUSH_CACHE_DATA
279 { FLUSH_CACHE_DATA, "FLUSH_CACHE_DATA" },
280#endif
281#ifdef FLUSH_CACHE_INSN
282 { FLUSH_CACHE_INSN, "FLUSH_CACHE_INSN" },
283#endif
284 { 0, NULL },
285};
286
287int
288sys_cacheflush(tcp)
289struct tcb *tcp;
290{
291 if (entering(tcp)) {
292 /* addr */
293 tprintf("%#lx, ", tcp->u_arg[0]);
294 /* scope */
295 printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???");
296 tprintf(", ");
297 /* flags */
Roland McGrathb2dee132005-06-01 19:02:36 +0000298 printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???");
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000299 /* len */
300 tprintf(", %lu", tcp->u_arg[3]);
301 }
302 return 0;
303}
304#endif /* M68K */
305
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000306#ifdef BFIN
307
308#include <bfin_sram.h>
309
310static const struct xlat sram_alloc_flags[] = {
311 { L1_INST_SRAM, "L1_INST_SRAM" },
312 { L1_DATA_A_SRAM, "L1_DATA_A_SRAM" },
313 { L1_DATA_B_SRAM, "L1_DATA_B_SRAM" },
314 { L1_DATA_SRAM, "L1_DATA_SRAM" },
Denys Vlasenko132c52a2009-03-23 13:12:46 +0000315 { L2_SRAM, "L2_SRAM" },
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000316 { 0, NULL },
317};
318
319int
Denys Vlasenko132c52a2009-03-23 13:12:46 +0000320sys_sram_alloc(struct tcb *tcp)
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000321{
322 if (entering(tcp)) {
323 /* size */
Denys Vlasenko132c52a2009-03-23 13:12:46 +0000324 tprintf("%lu, ", tcp->u_arg[0]);
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000325 /* flags */
Denys Vlasenko132c52a2009-03-23 13:12:46 +0000326 printxval(sram_alloc_flags, tcp->u_arg[1], "???_SRAM");
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000327 }
328 return 1;
329}
330
Mike Frysinger260e5712010-09-11 15:04:18 -0400331#include <asm/cachectl.h>
332
333static const struct xlat cacheflush_flags[] = {
334 { ICACHE, "ICACHE" },
335 { DCACHE, "DCACHE" },
336 { BCACHE, "BCACHE" },
337 { 0, NULL },
338};
339
340int
341sys_cacheflush(struct tcb *tcp)
342{
343 if (entering(tcp)) {
344 /* start addr */
345 tprintf("%#lx, ", tcp->u_arg[0]);
346 /* length */
347 tprintf("%ld, ", tcp->u_arg[1]);
348 /* flags */
349 printxval(cacheflush_flags, tcp->u_arg[1], "?CACHE");
350 }
351 return 0;
352}
353
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000354#endif
355
Carmelo AMOROSOf8e56502010-12-01 14:27:07 +0100356#ifdef SH
357static const struct xlat cacheflush_flags[] = {
358#ifdef CACHEFLUSH_D_INVAL
359 { CACHEFLUSH_D_INVAL, "CACHEFLUSH_D_INVAL" },
360#endif
361#ifdef CACHEFLUSH_D_WB
362 { CACHEFLUSH_D_WB, "CACHEFLUSH_D_WB" },
363#endif
364#ifdef CACHEFLUSH_D_PURGE
365 { CACHEFLUSH_D_PURGE, "CACHEFLUSH_D_PURGE" },
366#endif
367#ifdef CACHEFLUSH_I
368 { CACHEFLUSH_I, "CACHEFLUSH_I" },
369#endif
370 { 0, NULL },
371};
372
373int
374sys_cacheflush(struct tcb *tcp)
375{
376 if (entering(tcp)) {
377 /* addr */
378 tprintf("%#lx, ", tcp->u_arg[0]);
379 /* len */
380 tprintf("%lu, ", tcp->u_arg[1]);
381 /* flags */
382 printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???");
383 }
384 return 0;
385}
386#endif /* SH */
387
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000388#endif /* LINUX */
389
390#ifdef SUNOS4
391
392#include <sys/reboot.h>
393#define NFSCLIENT
394#define LOFS
395#define RFS
396#define PCFS
397#include <sys/mount.h>
398#include <sys/socket.h>
399#include <nfs/export.h>
400#include <rpc/types.h>
401#include <rpc/auth.h>
402
403/*ARGSUSED*/
404int
405sys_sync(tcp)
406struct tcb *tcp;
407{
408 return 0;
409}
410
Roland McGrathd9f816f2004-09-04 03:39:20 +0000411static const struct xlat bootflags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000412 { RB_AUTOBOOT, "RB_AUTOBOOT" }, /* for system auto-booting itself */
413 { RB_ASKNAME, "RB_ASKNAME" }, /* ask for file name to reboot from */
414 { RB_SINGLE, "RB_SINGLE" }, /* reboot to single user only */
415 { RB_NOSYNC, "RB_NOSYNC" }, /* dont sync before reboot */
416 { RB_HALT, "RB_HALT" }, /* don't reboot, just halt */
417 { RB_INITNAME, "RB_INITNAME" }, /* name given for /etc/init */
418 { RB_NOBOOTRC, "RB_NOBOOTRC" }, /* don't run /etc/rc.boot */
419 { RB_DEBUG, "RB_DEBUG" }, /* being run under debugger */
420 { RB_DUMP, "RB_DUMP" }, /* dump system core */
421 { RB_WRITABLE, "RB_WRITABLE" }, /* mount root read/write */
422 { RB_STRING, "RB_STRING" }, /* pass boot args to prom monitor */
423 { 0, NULL },
424};
425
426int
427sys_reboot(tcp)
428struct tcb *tcp;
429{
430 if (entering(tcp)) {
Roland McGrathb2dee132005-06-01 19:02:36 +0000431 printflags(bootflags, tcp->u_arg[0], "RB_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000432 if (tcp->u_arg[0] & RB_STRING) {
433 printstr(tcp, tcp->u_arg[1], -1);
434 }
435 }
436 return 0;
437}
438
439int
440sys_sysacct(tcp)
441struct tcb *tcp;
442{
443 if (entering(tcp)) {
444 printstr(tcp, tcp->u_arg[0], -1);
445 }
446 return 0;
447}
448
449int
450sys_swapon(tcp)
451struct tcb *tcp;
452{
453 if (entering(tcp)) {
454 printstr(tcp, tcp->u_arg[0], -1);
455 }
456 return 0;
457}
458
459int
460sys_nfs_svc(tcp)
461struct tcb *tcp;
462{
463 if (entering(tcp)) {
464 printsock(tcp, tcp->u_arg[0]);
465 }
466 return 0;
467}
468
Roland McGrathd9f816f2004-09-04 03:39:20 +0000469static const struct xlat mountflags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000470 { M_RDONLY, "M_RDONLY" },
471 { M_NOSUID, "M_NOSUID" },
472 { M_NEWTYPE, "M_NEWTYPE" },
473 { M_GRPID, "M_GRPID" },
474#ifdef M_REMOUNT
475 { M_REMOUNT, "M_REMOUNT" },
476#endif
477#ifdef M_NOSUB
478 { M_NOSUB, "M_NOSUB" },
479#endif
480#ifdef M_MULTI
481 { M_MULTI, "M_MULTI" },
482#endif
483#ifdef M_SYS5
484 { M_SYS5, "M_SYS5" },
485#endif
486 { 0, NULL },
487};
488
Roland McGrathd9f816f2004-09-04 03:39:20 +0000489static const struct xlat nfsflags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000490 { NFSMNT_SOFT, "NFSMNT_SOFT" },
491 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
492 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
493 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
494 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
495 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
496 { NFSMNT_INT, "NFSMNT_INT" },
497 { NFSMNT_NOAC, "NFSMNT_NOAC" },
498 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
499 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
500 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
501 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
502#ifdef NFSMNT_SECURE
503 { NFSMNT_SECURE, "NFSMNT_SECURE" },
504#endif
505#ifdef NFSMNT_NOCTO
506 { NFSMNT_NOCTO, "NFSMNT_NOCTO" },
507#endif
508#ifdef NFSMNT_POSIX
509 { NFSMNT_POSIX, "NFSMNT_POSIX" },
510#endif
511 { 0, NULL },
512};
513
514int
515sys_mount(tcp)
516struct tcb *tcp;
517{
518 char type[4];
519
520 if (entering(tcp)) {
521 if (!(tcp->u_arg[2] & M_NEWTYPE) || umovestr(tcp,
522 tcp->u_arg[0], sizeof type, type) < 0) {
523 tprintf("OLDTYPE:#%lx", tcp->u_arg[0]);
524 } else {
525 tprintf("\"%s\", ", type);
526 }
527 printstr(tcp, tcp->u_arg[1], -1);
528 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000529 printflags(mountflags, tcp->u_arg[2] & ~M_NEWTYPE, "M_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000530 tprintf(", ");
531
532 if (strcmp(type, "4.2") == 0) {
533 struct ufs_args a;
534 if (umove(tcp, tcp->u_arg[3], &a) < 0)
535 return 0;
536 printstr(tcp, (int)a.fspec, -1);
537 } else if (strcmp(type, "lo") == 0) {
538 struct lo_args a;
539 if (umove(tcp, tcp->u_arg[3], &a) < 0)
540 return 0;
541 printstr(tcp, (int)a.fsdir, -1);
542 } else if (strcmp(type, "nfs") == 0) {
543 struct nfs_args a;
544 if (umove(tcp, tcp->u_arg[3], &a) < 0)
545 return 0;
546 tprintf("[");
547 printsock(tcp, (int) a.addr);
548 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000549 printflags(nfsflags, a.flags, "NFSMNT_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000550 tprintf(", ws:%u,rs:%u,to:%u,re:%u,",
551 a.wsize, a.rsize, a.timeo, a.retrans);
552 if (a.flags & NFSMNT_HOSTNAME && a.hostname)
553 printstr(tcp, (int)a.hostname, -1);
554 else
555 tprintf("%#lx", (unsigned long) a.hostname);
556 tprintf(",reg-min:%u,max:%u,dir-min:%u,max:%u,",
557 a.acregmin, a.acregmax, a.acdirmin, a.acdirmax);
558 if ((a.flags & NFSMNT_SECURE) && a.netname)
559 printstr(tcp, (int) a.netname, -1);
560 else
561 tprintf("%#lx", (unsigned long) a.netname);
562 tprintf("]");
563 } else if (strcmp(type, "rfs") == 0) {
564 struct rfs_args a;
565 struct token t;
566 if (umove(tcp, tcp->u_arg[3], &a) < 0)
567 return 0;
568 tprintf("[");
569 printstr(tcp, (int)a.rmtfs, -1);
570 if (umove(tcp, (int)a.token, &t) < 0)
571 return 0;
572 tprintf(", %u, %s]", t.t_id, t.t_uname);
573 } else if (strcmp(type, "pcfs") == 0) {
574 struct pc_args a;
575 if (umove(tcp, tcp->u_arg[3], &a) < 0)
576 return 0;
577 printstr(tcp, (int)a.fspec, -1);
578 }
579 }
580 return 0;
581}
582
583int
584sys_unmount(tcp)
585struct tcb *tcp;
586{
587 if (entering(tcp)) {
588 printstr(tcp, tcp->u_arg[0], -1);
589 }
590 return 0;
591}
592
593int
594sys_umount(tcp)
595struct tcb *tcp;
596{
597 return sys_unmount(tcp);
598}
599
600int
601sys_auditsys(tcp)
602struct tcb *tcp;
603{
604 /* XXX - no information available */
605 return printargs(tcp);
606}
607
Roland McGrathd9f816f2004-09-04 03:39:20 +0000608static const struct xlat ex_auth_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000609 { AUTH_UNIX, "AUTH_UNIX" },
610 { AUTH_DES, "AUTH_DES" },
611 { 0, NULL },
612};
613
614int
615sys_exportfs(tcp)
616struct tcb *tcp;
617{
618 struct export e;
619 int i;
620
621 if (entering(tcp)) {
622 printstr(tcp, tcp->u_arg[0], -1);
623 if (umove(tcp, tcp->u_arg[1], &e) < 0) {
624 tprintf("%#lx", tcp->u_arg[1]);
625 return 0;
626 }
627 tprintf("{fl:%u, anon:%u, ", e.ex_flags, e.ex_anon);
628 printxval(ex_auth_flags, e.ex_auth, "AUTH_???");
629 tprintf(", roots:[");
630 if (e.ex_auth == AUTH_UNIX) {
631 for (i=0; i<e.ex_u.exunix.rootaddrs.naddrs; i++) {
632 printsock(tcp,
633 (int)&e.ex_u.exunix.rootaddrs.addrvec[i]);
634 }
635 tprintf("], writers:[");
636 for (i=0; i<e.ex_writeaddrs.naddrs; i++) {
637 printsock(tcp,
638 (int)&e.ex_writeaddrs.addrvec[i]);
639 }
640 tprintf("]");
641 } else {
642 for (i=0; i<e.ex_u.exdes.nnames; i++) {
643 printsock(tcp,
644 (int)&e.ex_u.exdes.rootnames[i]);
645 tprintf(", ");
646 }
647 tprintf("], window:%u", e.ex_u.exdes.window);
648 }
649 tprintf("}");
650 }
651 return 0;
652}
653
Roland McGrathd9f816f2004-09-04 03:39:20 +0000654static const struct xlat sysconflimits[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000655#ifdef _SC_ARG_MAX
656 { _SC_ARG_MAX, "_SC_ARG_MAX" }, /* space for argv & envp */
657#endif
658#ifdef _SC_CHILD_MAX
659 { _SC_CHILD_MAX, "_SC_CHILD_MAX" }, /* maximum children per process??? */
660#endif
661#ifdef _SC_CLK_TCK
662 { _SC_CLK_TCK, "_SC_CLK_TCK" }, /* clock ticks/sec */
663#endif
664#ifdef _SC_NGROUPS_MAX
665 { _SC_NGROUPS_MAX, "_SC_NGROUPS_MAX" }, /* number of groups if multple supp. */
666#endif
667#ifdef _SC_OPEN_MAX
668 { _SC_OPEN_MAX, "_SC_OPEN_MAX" }, /* max open files per process */
669#endif
670#ifdef _SC_JOB_CONTROL
671 { _SC_JOB_CONTROL, "_SC_JOB_CONTROL" }, /* do we have job control */
672#endif
673#ifdef _SC_SAVED_IDS
674 { _SC_SAVED_IDS, "_SC_SAVED_IDS" }, /* do we have saved uid/gids */
675#endif
676#ifdef _SC_VERSION
677 { _SC_VERSION, "_SC_VERSION" }, /* POSIX version supported */
678#endif
679 { 0, NULL },
680};
681
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000682int
683sys_sysconf(tcp)
684struct tcb *tcp;
685{
686 if (entering(tcp)) {
687 printxval(sysconflimits, tcp->u_arg[0], "_SC_???");
688 }
689 return 0;
690}
691
692#endif /* SUNOS4 */
693
694#if defined(SUNOS4) || defined(FREEBSD)
Roland McGrathd9f816f2004-09-04 03:39:20 +0000695static const struct xlat pathconflimits[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000696#ifdef _PC_LINK_MAX
697 { _PC_LINK_MAX, "_PC_LINK_MAX" }, /* max links to file/dir */
698#endif
699#ifdef _PC_MAX_CANON
700 { _PC_MAX_CANON, "_PC_MAX_CANON" }, /* max line length */
701#endif
702#ifdef _PC_MAX_INPUT
703 { _PC_MAX_INPUT, "_PC_MAX_INPUT" }, /* max "packet" to a tty device */
704#endif
705#ifdef _PC_NAME_MAX
706 { _PC_NAME_MAX, "_PC_NAME_MAX" }, /* max pathname component length */
707#endif
708#ifdef _PC_PATH_MAX
709 { _PC_PATH_MAX, "_PC_PATH_MAX" }, /* max pathname length */
710#endif
711#ifdef _PC_PIPE_BUF
712 { _PC_PIPE_BUF, "_PC_PIPE_BUF" }, /* size of a pipe */
713#endif
714#ifdef _PC_CHOWN_RESTRICTED
715 { _PC_CHOWN_RESTRICTED, "_PC_CHOWN_RESTRICTED" }, /* can we give away files */
716#endif
717#ifdef _PC_NO_TRUNC
718 { _PC_NO_TRUNC, "_PC_NO_TRUNC" }, /* trunc or error on >NAME_MAX */
719#endif
720#ifdef _PC_VDISABLE
721 { _PC_VDISABLE, "_PC_VDISABLE" }, /* best char to shut off tty c_cc */
722#endif
723 { 0, NULL },
724};
725
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000726
727int
728sys_pathconf(tcp)
729struct tcb *tcp;
730{
731 if (entering(tcp)) {
732 printstr(tcp, tcp->u_arg[0], -1);
733 tprintf(", ");
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000734 printxval(pathconflimits, tcp->u_arg[1], "_PC_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000735 }
736 return 0;
737}
738
739int
740sys_fpathconf(tcp)
741struct tcb *tcp;
742{
743 if (entering(tcp)) {
744 tprintf("%lu, ", tcp->u_arg[0]);
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000745 printxval(pathconflimits, tcp->u_arg[1], "_PC_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000746 }
747 return 0;
748}
749
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000750#endif /* SUNOS4 || FREEBSD */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000751
752#ifdef SVR4
753
754#ifdef HAVE_SYS_SYSCONFIG_H
755#include <sys/sysconfig.h>
756#endif /* HAVE_SYS_SYSCONFIG_H */
757
758#include <sys/mount.h>
759#include <sys/systeminfo.h>
760#include <sys/utsname.h>
761
Roland McGrathd9f816f2004-09-04 03:39:20 +0000762static const struct xlat sysconfig_options[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000763#ifdef _CONFIG_NGROUPS
764 { _CONFIG_NGROUPS, "_CONFIG_NGROUPS" },
765#endif
766#ifdef _CONFIG_CHILD_MAX
767 { _CONFIG_CHILD_MAX, "_CONFIG_CHILD_MAX" },
768#endif
769#ifdef _CONFIG_OPEN_FILES
770 { _CONFIG_OPEN_FILES, "_CONFIG_OPEN_FILES" },
771#endif
772#ifdef _CONFIG_POSIX_VER
773 { _CONFIG_POSIX_VER, "_CONFIG_POSIX_VER" },
774#endif
775#ifdef _CONFIG_PAGESIZE
776 { _CONFIG_PAGESIZE, "_CONFIG_PAGESIZE" },
777#endif
778#ifdef _CONFIG_CLK_TCK
779 { _CONFIG_CLK_TCK, "_CONFIG_CLK_TCK" },
780#endif
781#ifdef _CONFIG_XOPEN_VER
782 { _CONFIG_XOPEN_VER, "_CONFIG_XOPEN_VER" },
783#endif
784#ifdef _CONFIG_PROF_TCK
785 { _CONFIG_PROF_TCK, "_CONFIG_PROF_TCK" },
786#endif
787#ifdef _CONFIG_NPROC_CONF
788 { _CONFIG_NPROC_CONF, "_CONFIG_NPROC_CONF" },
789#endif
790#ifdef _CONFIG_NPROC_ONLN
791 { _CONFIG_NPROC_ONLN, "_CONFIG_NPROC_ONLN" },
792#endif
793#ifdef _CONFIG_AIO_LISTIO_MAX
794 { _CONFIG_AIO_LISTIO_MAX, "_CONFIG_AIO_LISTIO_MAX" },
795#endif
796#ifdef _CONFIG_AIO_MAX
797 { _CONFIG_AIO_MAX, "_CONFIG_AIO_MAX" },
798#endif
799#ifdef _CONFIG_AIO_PRIO_DELTA_MAX
800 { _CONFIG_AIO_PRIO_DELTA_MAX, "_CONFIG_AIO_PRIO_DELTA_MAX" },
801#endif
802#ifdef _CONFIG_CONFIG_DELAYTIMER_MAX
803 { _CONFIG_DELAYTIMER_MAX, "_CONFIG_DELAYTIMER_MAX" },
804#endif
805#ifdef _CONFIG_MQ_OPEN_MAX
806 { _CONFIG_MQ_OPEN_MAX, "_CONFIG_MQ_OPEN_MAX" },
807#endif
808#ifdef _CONFIG_MQ_PRIO_MAX
809 { _CONFIG_MQ_PRIO_MAX, "_CONFIG_MQ_PRIO_MAX" },
810#endif
811#ifdef _CONFIG_RTSIG_MAX
812 { _CONFIG_RTSIG_MAX, "_CONFIG_RTSIG_MAX" },
813#endif
814#ifdef _CONFIG_SEM_NSEMS_MAX
815 { _CONFIG_SEM_NSEMS_MAX, "_CONFIG_SEM_NSEMS_MAX" },
816#endif
817#ifdef _CONFIG_SEM_VALUE_MAX
818 { _CONFIG_SEM_VALUE_MAX, "_CONFIG_SEM_VALUE_MAX" },
819#endif
820#ifdef _CONFIG_SIGQUEUE_MAX
821 { _CONFIG_SIGQUEUE_MAX, "_CONFIG_SIGQUEUE_MAX" },
822#endif
823#ifdef _CONFIG_SIGRT_MIN
824 { _CONFIG_SIGRT_MIN, "_CONFIG_SIGRT_MIN" },
825#endif
826#ifdef _CONFIG_SIGRT_MAX
827 { _CONFIG_SIGRT_MAX, "_CONFIG_SIGRT_MAX" },
828#endif
829#ifdef _CONFIG_TIMER_MAX
830 { _CONFIG_TIMER_MAX, "_CONFIG_TIMER_MAX" },
831#endif
832#ifdef _CONFIG_CONFIG_PHYS_PAGES
833 { _CONFIG_PHYS_PAGES, "_CONFIG_PHYS_PAGES" },
834#endif
835#ifdef _CONFIG_AVPHYS_PAGES
836 { _CONFIG_AVPHYS_PAGES, "_CONFIG_AVPHYS_PAGES" },
837#endif
838 { 0, NULL },
839};
840
841int
842sys_sysconfig(tcp)
843struct tcb *tcp;
844{
845 if (entering(tcp))
846 printxval(sysconfig_options, tcp->u_arg[0], "_CONFIG_???");
847 return 0;
848}
849
Roland McGrathd9f816f2004-09-04 03:39:20 +0000850static const struct xlat sysinfo_options[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000851 { SI_SYSNAME, "SI_SYSNAME" },
852 { SI_HOSTNAME, "SI_HOSTNAME" },
853 { SI_RELEASE, "SI_RELEASE" },
854 { SI_VERSION, "SI_VERSION" },
855 { SI_MACHINE, "SI_MACHINE" },
856 { SI_ARCHITECTURE, "SI_ARCHITECTURE" },
857 { SI_HW_SERIAL, "SI_HW_SERIAL" },
858 { SI_HW_PROVIDER, "SI_HW_PROVIDER" },
859 { SI_SRPC_DOMAIN, "SI_SRPC_DOMAIN" },
860#ifdef SI_SET_HOSTNAME
861 { SI_SET_HOSTNAME, "SI_SET_HOSTNAME" },
862#endif
863#ifdef SI_SET_SRPC_DOMAIN
864 { SI_SET_SRPC_DOMAIN, "SI_SET_SRPC_DOMAIN" },
865#endif
866#ifdef SI_SET_KERB_REALM
867 { SI_SET_KERB_REALM, "SI_SET_KERB_REALM" },
868#endif
869#ifdef SI_KERB_REALM
870 { SI_KERB_REALM, "SI_KERB_REALM" },
871#endif
872 { 0, NULL },
873};
874
875int
876sys_sysinfo(tcp)
877struct tcb *tcp;
878{
879 if (entering(tcp)) {
880 printxval(sysinfo_options, tcp->u_arg[0], "SI_???");
881 tprintf(", ");
882 }
883 else {
884 /* Technically some calls write values. So what. */
885 if (syserror(tcp))
886 tprintf("%#lx", tcp->u_arg[1]);
887 else
888 printpath(tcp, tcp->u_arg[1]);
889 tprintf(", %lu", tcp->u_arg[2]);
890 }
891 return 0;
892}
893
894#ifdef MIPS
895
896#include <sys/syssgi.h>
897
Roland McGrathd9f816f2004-09-04 03:39:20 +0000898static const struct xlat syssgi_options[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000899 { SGI_SYSID, "SGI_SYSID" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000900#ifdef SGI_RDUBLK
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000901 { SGI_RDUBLK, "SGI_RDUBLK" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000902#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000903 { SGI_TUNE, "SGI_TUNE" },
904 { SGI_IDBG, "SGI_IDBG" },
905 { SGI_INVENT, "SGI_INVENT" },
906 { SGI_RDNAME, "SGI_RDNAME" },
907 { SGI_SETLED, "SGI_SETLED" },
908 { SGI_SETNVRAM, "SGI_SETNVRAM" },
909 { SGI_GETNVRAM, "SGI_GETNVRAM" },
910 { SGI_QUERY_FTIMER, "SGI_QUERY_FTIMER" },
911 { SGI_QUERY_CYCLECNTR, "SGI_QUERY_CYCLECNTR" },
912 { SGI_PROCSZ, "SGI_PROCSZ" },
913 { SGI_SIGACTION, "SGI_SIGACTION" },
914 { SGI_SIGPENDING, "SGI_SIGPENDING" },
915 { SGI_SIGPROCMASK, "SGI_SIGPROCMASK" },
916 { SGI_SIGSUSPEND, "SGI_SIGSUSPEND" },
917 { SGI_SETSID, "SGI_SETSID" },
918 { SGI_SETPGID, "SGI_SETPGID" },
919 { SGI_SYSCONF, "SGI_SYSCONF" },
920 { SGI_WAIT4, "SGI_WAIT4" },
921 { SGI_PATHCONF, "SGI_PATHCONF" },
922 { SGI_READB, "SGI_READB" },
923 { SGI_WRITEB, "SGI_WRITEB" },
924 { SGI_SETGROUPS, "SGI_SETGROUPS" },
925 { SGI_GETGROUPS, "SGI_GETGROUPS" },
926 { SGI_SETTIMEOFDAY, "SGI_SETTIMEOFDAY" },
927 { SGI_SETTIMETRIM, "SGI_SETTIMETRIM" },
928 { SGI_GETTIMETRIM, "SGI_GETTIMETRIM" },
929 { SGI_SPROFIL, "SGI_SPROFIL" },
930 { SGI_RUSAGE, "SGI_RUSAGE" },
931 { SGI_SIGSTACK, "SGI_SIGSTACK" },
932 { SGI_SIGSTATUS, "SGI_SIGSTATUS" },
933 { SGI_NETPROC, "SGI_NETPROC" },
934 { SGI_SIGALTSTACK, "SGI_SIGALTSTACK" },
935 { SGI_BDFLUSHCNT, "SGI_BDFLUSHCNT" },
936 { SGI_SSYNC, "SGI_SSYNC" },
937 { SGI_NFSCNVT, "SGI_NFSCNVT" },
938 { SGI_GETPGID, "SGI_GETPGID" },
939 { SGI_GETSID, "SGI_GETSID" },
940 { SGI_IOPROBE, "SGI_IOPROBE" },
941 { SGI_CONFIG, "SGI_CONFIG" },
942 { SGI_ELFMAP, "SGI_ELFMAP" },
943 { SGI_MCONFIG, "SGI_MCONFIG" },
944 { SGI_GETPLABEL, "SGI_GETPLABEL" },
945 { SGI_SETPLABEL, "SGI_SETPLABEL" },
946 { SGI_GETLABEL, "SGI_GETLABEL" },
947 { SGI_SETLABEL, "SGI_SETLABEL" },
948 { SGI_SATREAD, "SGI_SATREAD" },
949 { SGI_SATWRITE, "SGI_SATWRITE" },
950 { SGI_SATCTL, "SGI_SATCTL" },
951 { SGI_LOADATTR, "SGI_LOADATTR" },
952 { SGI_UNLOADATTR, "SGI_UNLOADATTR" },
953#ifdef SGI_RECVLMSG
954 { SGI_RECVLMSG, "SGI_RECVLMSG" },
955#endif
956 { SGI_PLANGMOUNT, "SGI_PLANGMOUNT" },
957 { SGI_GETPSOACL, "SGI_GETPSOACL" },
958 { SGI_SETPSOACL, "SGI_SETPSOACL" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000959#ifdef SGI_EAG_GET_ATTR
960 { SGI_EAG_GET_ATTR, "SGI_EAG_GET_ATTR" },
961#endif
962#ifdef SGI_EAG_SET_ATTR
963 { SGI_EAG_SET_ATTR, "SGI_EAG_SET_ATTR" },
964#endif
965#ifdef SGI_EAG_GET_PROCATTR
966 { SGI_EAG_GET_PROCATTR, "SGI_EAG_GET_PROCATTR" },
967#endif
968#ifdef SGI_EAG_SET_PROCATTR
969 { SGI_EAG_SET_PROCATTR, "SGI_EAG_SET_PROCATTR" },
970#endif
971#ifdef SGI_FREVOKE
972 { SGI_FREVOKE, "SGI_FREVOKE" },
973#endif
974#ifdef SGI_SBE_GET_INFO
975 { SGI_SBE_GET_INFO, "SGI_SBE_GET_INFO" },
976#endif
977#ifdef SGI_SBE_CLR_INFO
978 { SGI_SBE_CLR_INFO, "SGI_SBE_CLR_INFO" },
979#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000980 { SGI_RMI_FIXECC, "SGI_RMI_FIXECC" },
981 { SGI_R4K_CERRS, "SGI_R4K_CERRS" },
982 { SGI_GET_EVCONF, "SGI_GET_EVCONF" },
983 { SGI_MPCWAROFF, "SGI_MPCWAROFF" },
984 { SGI_SET_AUTOPWRON, "SGI_SET_AUTOPWRON" },
985 { SGI_SPIPE, "SGI_SPIPE" },
986 { SGI_SYMTAB, "SGI_SYMTAB" },
987#ifdef SGI_SET_FPDEBUG
988 { SGI_SET_FPDEBUG, "SGI_SET_FPDEBUG" },
989#endif
Wichert Akkerman8829a551999-06-11 13:18:40 +0000990#ifdef SGI_SET_FP_PRECISE
991 { SGI_SET_FP_PRECISE, "SGI_SET_FP_PRECISE" },
992#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000993 { SGI_TOSSTSAVE, "SGI_TOSSTSAVE" },
994 { SGI_FDHI, "SGI_FDHI" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000995#ifdef SGI_SET_CONFIG_SMM
996 { SGI_SET_CONFIG_SMM, "SGI_SET_CONFIG_SMM" },
997#endif
998#ifdef SGI_SET_FP_PRESERVE
999 { SGI_SET_FP_PRESERVE, "SGI_SET_FP_PRESERVE" },
1000#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001001 { SGI_MINRSS, "SGI_MINRSS" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001002#ifdef SGI_GRIO
1003 { SGI_GRIO, "SGI_GRIO" },
1004#endif
1005#ifdef SGI_XLV_SET_TAB
1006 { SGI_XLV_SET_TAB, "SGI_XLV_SET_TAB" },
1007#endif
1008#ifdef SGI_XLV_GET_TAB
1009 { SGI_XLV_GET_TAB, "SGI_XLV_GET_TAB" },
1010#endif
1011#ifdef SGI_GET_FP_PRECISE
1012 { SGI_GET_FP_PRECISE, "SGI_GET_FP_PRECISE" },
1013#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001014#ifdef SGI_GET_CONFIG_SMM
Wichert Akkerman8829a551999-06-11 13:18:40 +00001015 { SGI_GET_CONFIG_SMM, "SGI_GET_CONFIG_SMM" },
1016#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001017#ifdef SGI_FP_IMPRECISE_SUPP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001018 { SGI_FP_IMPRECISE_SUPP,"SGI_FP_IMPRECISE_SUPP" },
1019#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001020#ifdef SGI_CONFIG_NSMM_SUPP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001021 { SGI_CONFIG_NSMM_SUPP, "SGI_CONFIG_NSMM_SUPP" },
1022#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001023#ifdef SGI_RT_TSTAMP_CREATE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001024 { SGI_RT_TSTAMP_CREATE, "SGI_RT_TSTAMP_CREATE" },
1025#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001026#ifdef SGI_RT_TSTAMP_DELETE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001027 { SGI_RT_TSTAMP_DELETE, "SGI_RT_TSTAMP_DELETE" },
1028#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001029#ifdef SGI_RT_TSTAMP_START
Wichert Akkerman8829a551999-06-11 13:18:40 +00001030 { SGI_RT_TSTAMP_START, "SGI_RT_TSTAMP_START" },
1031#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001032#ifdef SGI_RT_TSTAMP_STOP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001033 { SGI_RT_TSTAMP_STOP, "SGI_RT_TSTAMP_STOP" },
1034#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001035#ifdef SGI_RT_TSTAMP_ADDR
Wichert Akkerman8829a551999-06-11 13:18:40 +00001036 { SGI_RT_TSTAMP_ADDR, "SGI_RT_TSTAMP_ADDR" },
1037#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001038#ifdef SGI_RT_TSTAMP_MASK
Wichert Akkerman8829a551999-06-11 13:18:40 +00001039 { SGI_RT_TSTAMP_MASK, "SGI_RT_TSTAMP_MASK" },
1040#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001041#ifdef SGI_RT_TSTAMP_EOB_MODE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001042 { SGI_RT_TSTAMP_EOB_MODE,"SGI_RT_TSTAMP_EOB_MODE"},
1043#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001044#ifdef SGI_USE_FP_BCOPY
Wichert Akkerman8829a551999-06-11 13:18:40 +00001045 { SGI_USE_FP_BCOPY, "SGI_USE_FP_BCOPY" },
1046#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001047#ifdef SGI_GET_UST
Wichert Akkerman8829a551999-06-11 13:18:40 +00001048 { SGI_GET_UST, "SGI_GET_UST" },
1049#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001050#ifdef SGI_SPECULATIVE_EXEC
Wichert Akkerman8829a551999-06-11 13:18:40 +00001051 { SGI_SPECULATIVE_EXEC, "SGI_SPECULATIVE_EXEC" },
1052#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001053#ifdef SGI_XLV_NEXT_RQST
Wichert Akkerman8829a551999-06-11 13:18:40 +00001054 { SGI_XLV_NEXT_RQST, "SGI_XLV_NEXT_RQST" },
1055#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001056#ifdef SGI_XLV_ATTR_CURSOR
Wichert Akkerman8829a551999-06-11 13:18:40 +00001057 { SGI_XLV_ATTR_CURSOR, "SGI_XLV_ATTR_CURSOR" },
1058#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001059#ifdef SGI_XLV_ATTR_GET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001060 { SGI_XLV_ATTR_GET, "SGI_XLV_ATTR_GET" },
1061#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001062#ifdef SGI_XLV_ATTR_SET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001063 { SGI_XLV_ATTR_SET, "SGI_XLV_ATTR_SET" },
1064#endif
1065#ifdef SGI_BTOOLSIZE
1066 { SGI_BTOOLSIZE, "SGI_BTOOLSIZE" },
1067#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001068#ifdef SGI_BTOOLGET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001069 { SGI_BTOOLGET, "SGI_BTOOLGET" },
1070#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001071#ifdef SGI_BTOOLREINIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001072 { SGI_BTOOLREINIT, "SGI_BTOOLREINIT" },
1073#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001074#ifdef SGI_CREATE_UUID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001075 { SGI_CREATE_UUID, "SGI_CREATE_UUID" },
1076#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001077#ifdef SGI_NOFPE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001078 { SGI_NOFPE, "SGI_NOFPE" },
1079#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001080#ifdef SGI_OLD_SOFTFP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001081 { SGI_OLD_SOFTFP, "SGI_OLD_SOFTFP" },
1082#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001083#ifdef SGI_FS_INUMBERS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001084 { SGI_FS_INUMBERS, "SGI_FS_INUMBERS" },
1085#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001086#ifdef SGI_FS_BULKSTAT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001087 { SGI_FS_BULKSTAT, "SGI_FS_BULKSTAT" },
1088#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001089#ifdef SGI_RT_TSTAMP_WAIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001090 { SGI_RT_TSTAMP_WAIT, "SGI_RT_TSTAMP_WAIT" },
1091#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001092#ifdef SGI_RT_TSTAMP_UPDATE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001093 { SGI_RT_TSTAMP_UPDATE, "SGI_RT_TSTAMP_UPDATE" },
1094#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001095#ifdef SGI_PATH_TO_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001096 { SGI_PATH_TO_HANDLE, "SGI_PATH_TO_HANDLE" },
1097#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001098#ifdef SGI_PATH_TO_FSHANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001099 { SGI_PATH_TO_FSHANDLE, "SGI_PATH_TO_FSHANDLE" },
1100#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001101#ifdef SGI_FD_TO_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001102 { SGI_FD_TO_HANDLE, "SGI_FD_TO_HANDLE" },
1103#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001104#ifdef SGI_OPEN_BY_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001105 { SGI_OPEN_BY_HANDLE, "SGI_OPEN_BY_HANDLE" },
1106#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001107#ifdef SGI_READLINK_BY_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001108 { SGI_READLINK_BY_HANDLE,"SGI_READLINK_BY_HANDLE"},
1109#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001110#ifdef SGI_READ_DANGID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001111 { SGI_READ_DANGID, "SGI_READ_DANGID" },
1112#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001113#ifdef SGI_CONST
Wichert Akkerman8829a551999-06-11 13:18:40 +00001114 { SGI_CONST, "SGI_CONST" },
1115#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001116#ifdef SGI_XFS_FSOPERATIONS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001117 { SGI_XFS_FSOPERATIONS, "SGI_XFS_FSOPERATIONS" },
1118#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001119#ifdef SGI_SETASH
Wichert Akkerman8829a551999-06-11 13:18:40 +00001120 { SGI_SETASH, "SGI_SETASH" },
1121#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001122#ifdef SGI_GETASH
Wichert Akkerman8829a551999-06-11 13:18:40 +00001123 { SGI_GETASH, "SGI_GETASH" },
1124#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001125#ifdef SGI_SETPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001126 { SGI_SETPRID, "SGI_SETPRID" },
1127#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001128#ifdef SGI_GETPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001129 { SGI_GETPRID, "SGI_GETPRID" },
1130#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001131#ifdef SGI_SETSPINFO
Wichert Akkerman8829a551999-06-11 13:18:40 +00001132 { SGI_SETSPINFO, "SGI_SETSPINFO" },
1133#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001134#ifdef SGI_GETSPINFO
Wichert Akkerman8829a551999-06-11 13:18:40 +00001135 { SGI_GETSPINFO, "SGI_GETSPINFO" },
1136#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001137#ifdef SGI_SHAREII
Wichert Akkerman8829a551999-06-11 13:18:40 +00001138 { SGI_SHAREII, "SGI_SHAREII" },
1139#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001140#ifdef SGI_NEWARRAYSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001141 { SGI_NEWARRAYSESS, "SGI_NEWARRAYSESS" },
1142#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001143#ifdef SGI_GETDFLTPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001144 { SGI_GETDFLTPRID, "SGI_GETDFLTPRID" },
1145#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001146#ifdef SGI_SET_DISMISSED_EXC_CNT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001147 { SGI_SET_DISMISSED_EXC_CNT,"SGI_SET_DISMISSED_EXC_CNT" },
1148#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001149#ifdef SGI_GET_DISMISSED_EXC_CNT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001150 { SGI_GET_DISMISSED_EXC_CNT,"SGI_GET_DISMISSED_EXC_CNT" },
1151#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001152#ifdef SGI_CYCLECNTR_SIZE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001153 { SGI_CYCLECNTR_SIZE, "SGI_CYCLECNTR_SIZE" },
1154#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001155#ifdef SGI_QUERY_FASTTIMER
Wichert Akkerman8829a551999-06-11 13:18:40 +00001156 { SGI_QUERY_FASTTIMER, "SGI_QUERY_FASTTIMER" },
1157#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001158#ifdef SGI_PIDSINASH
Wichert Akkerman8829a551999-06-11 13:18:40 +00001159 { SGI_PIDSINASH, "SGI_PIDSINASH" },
1160#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001161#ifdef SGI_ULI
Wichert Akkerman8829a551999-06-11 13:18:40 +00001162 { SGI_ULI, "SGI_ULI" },
1163#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001164#ifdef SGI_LPG_SHMGET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001165 { SGI_LPG_SHMGET, "SGI_LPG_SHMGET" },
1166#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001167#ifdef SGI_LPG_MAP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001168 { SGI_LPG_MAP, "SGI_LPG_MAP" },
1169#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001170#ifdef SGI_CACHEFS_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001171 { SGI_CACHEFS_SYS, "SGI_CACHEFS_SYS" },
1172#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001173#ifdef SGI_NFSNOTIFY
Wichert Akkerman8829a551999-06-11 13:18:40 +00001174 { SGI_NFSNOTIFY, "SGI_NFSNOTIFY" },
1175#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001176#ifdef SGI_LOCKDSYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001177 { SGI_LOCKDSYS, "SGI_LOCKDSYS" },
1178#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001179#ifdef SGI_EVENTCTR
Wichert Akkerman8829a551999-06-11 13:18:40 +00001180 { SGI_EVENTCTR, "SGI_EVENTCTR" },
1181#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001182#ifdef SGI_GETPRUSAGE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001183 { SGI_GETPRUSAGE, "SGI_GETPRUSAGE" },
1184#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001185#ifdef SGI_PROCMASK_LOCATION
Wichert Akkerman8829a551999-06-11 13:18:40 +00001186 { SGI_PROCMASK_LOCATION,"SGI_PROCMASK_LOCATION" },
1187#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001188#ifdef SGI_UNUSED
Wichert Akkerman8829a551999-06-11 13:18:40 +00001189 { SGI_UNUSED, "SGI_UNUSED" },
1190#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001191#ifdef SGI_CKPT_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001192 { SGI_CKPT_SYS, "SGI_CKPT_SYS" },
1193#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001194#ifdef SGI_CKPT_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001195 { SGI_CKPT_SYS, "SGI_CKPT_SYS" },
1196#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001197#ifdef SGI_GETGRPPID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001198 { SGI_GETGRPPID, "SGI_GETGRPPID" },
1199#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001200#ifdef SGI_GETSESPID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001201 { SGI_GETSESPID, "SGI_GETSESPID" },
1202#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001203#ifdef SGI_ENUMASHS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001204 { SGI_ENUMASHS, "SGI_ENUMASHS" },
1205#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001206#ifdef SGI_SETASMACHID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001207 { SGI_SETASMACHID, "SGI_SETASMACHID" },
1208#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001209#ifdef SGI_GETASMACHID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001210 { SGI_GETASMACHID, "SGI_GETASMACHID" },
1211#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001212#ifdef SGI_GETARSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001213 { SGI_GETARSESS, "SGI_GETARSESS" },
1214#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001215#ifdef SGI_JOINARRAYSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001216 { SGI_JOINARRAYSESS, "SGI_JOINARRAYSESS" },
1217#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001218#ifdef SGI_SPROC_KILL
Wichert Akkerman8829a551999-06-11 13:18:40 +00001219 { SGI_SPROC_KILL, "SGI_SPROC_KILL" },
1220#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001221#ifdef SGI_DBA_CONFIG
Wichert Akkerman8829a551999-06-11 13:18:40 +00001222 { SGI_DBA_CONFIG, "SGI_DBA_CONFIG" },
1223#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001224#ifdef SGI_RELEASE_NAME
Wichert Akkerman8829a551999-06-11 13:18:40 +00001225 { SGI_RELEASE_NAME, "SGI_RELEASE_NAME" },
1226#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001227#ifdef SGI_SYNCH_CACHE_HANDLER
Wichert Akkerman8829a551999-06-11 13:18:40 +00001228 { SGI_SYNCH_CACHE_HANDLER,"SGI_SYNCH_CACHE_HANDLER"},
1229#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001230#ifdef SGI_SWASH_INIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001231 { SGI_SWASH_INIT, "SGI_SWASH_INIT" },
1232#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001233#ifdef SGI_NUMA_MIGR_PAGE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001234 { SGI_NUMA_MIGR_PAGE, "SGI_NUMA_MIGR_PAGE" },
1235#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001236#ifdef SGI_NUMA_MIGR_PAGE_ALT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001237 { SGI_NUMA_MIGR_PAGE_ALT,"SGI_NUMA_MIGR_PAGE_ALT"},
1238#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001239#ifdef SGI_KAIO_USERINIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001240 { SGI_KAIO_USERINIT, "SGI_KAIO_USERINIT" },
1241#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001242#ifdef SGI_KAIO_READ
Wichert Akkerman8829a551999-06-11 13:18:40 +00001243 { SGI_KAIO_READ, "SGI_KAIO_READ" },
1244#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001245#ifdef SGI_KAIO_WRITE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001246 { SGI_KAIO_WRITE, "SGI_KAIO_WRITE" },
1247#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001248#ifdef SGI_KAIO_SUSPEND
Wichert Akkerman8829a551999-06-11 13:18:40 +00001249 { SGI_KAIO_SUSPEND, "SGI_KAIO_SUSPEND" },
1250#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001251#ifdef SGI_KAIO_STATS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001252 { SGI_KAIO_STATS, "SGI_KAIO_STATS" },
1253#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001254#ifdef SGI_INITIAL_PT_SPROC
Wichert Akkerman8829a551999-06-11 13:18:40 +00001255 { SGI_INITIAL_PT_SPROC, "SGI_INITIAL_PT_SPROC" },
1256#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001257 { 0, NULL },
1258};
1259
1260int
1261sys_syssgi(tcp)
1262struct tcb *tcp;
1263{
1264 int i;
1265
1266 if (entering(tcp)) {
1267 printxval(syssgi_options, tcp->u_arg[0], "SGI_???");
1268 switch (tcp->u_arg[0]) {
1269 default:
1270 for (i = 1; i < tcp->u_nargs; i++)
1271 tprintf(", %#lx", tcp->u_arg[i]);
1272 break;
1273 }
1274 }
1275 return 0;
1276}
1277
1278#include <sys/types.h>
1279#include <rpc/rpc.h>
1280struct cred;
1281struct uio;
1282#include <sys/fsid.h>
1283#include <sys/vnode.h>
1284#include <sys/fs/nfs.h>
1285#include <sys/fs/nfs_clnt.h>
1286
Roland McGrathd9f816f2004-09-04 03:39:20 +00001287static const struct xlat mount_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001288 { MS_RDONLY, "MS_RDONLY" },
1289 { MS_FSS, "MS_FSS" },
1290 { MS_DATA, "MS_DATA" },
1291 { MS_NOSUID, "MS_NOSUID" },
1292 { MS_REMOUNT, "MS_REMOUNT" },
1293 { MS_NOTRUNC, "MS_NOTRUNC" },
1294 { MS_GRPID, "MS_GRPID" },
1295 { MS_NODEV, "MS_NODEV" },
1296 { MS_BEFORE, "MS_BEFORE" },
1297 { MS_AFTER, "MS_AFTER" },
1298 { 0, NULL },
1299};
1300
Roland McGrathd9f816f2004-09-04 03:39:20 +00001301static const struct xlat nfs_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001302 { NFSMNT_SOFT, "NFSMNT_SOFT" },
1303 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
1304 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
1305 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
1306 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
1307 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001308#ifdef NFSMNT_NOINT /* IRIX 6 */
1309 { NFSMNT_NOINT, "NFSMNT_NOINT" },
1310#endif
1311#ifdef NFSMNT_INT /* IRIX 5 */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001312 { NFSMNT_INT, "NFSMNT_INT" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001313#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001314 { NFSMNT_NOAC, "NFSMNT_NOAC" },
1315 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
1316 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
1317 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
1318 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
1319 { NFSMNT_PRIVATE, "NFSMNT_PRIVATE" },
1320 { NFSMNT_SYMTTL, "NFSMNT_SYMTTL" },
1321 { NFSMNT_LOOPBACK, "NFSMNT_LOOPBACK" },
1322 { NFSMNT_BASETYPE, "NFSMNT_BASETYPE" },
1323 { NFSMNT_NAMEMAX, "NFSMNT_NAMEMAX" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001324#ifdef NFSMNT_SHORTUID /* IRIX 6 */
1325 { NFSMNT_SHORTUID, "NFSMNT_SHORTUID" },
1326#endif
1327#ifdef NFSMNT_ASYNCNLM /* IRIX 6 */
1328 { NFSMNT_ASYNCNLM, "NFSMNT_ASYNCNLM" },
1329#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001330 { 0, NULL },
1331};
1332
1333int
1334sys_mount(tcp)
1335struct tcb *tcp;
1336{
1337 if (entering(tcp)) {
1338 printpath(tcp, tcp->u_arg[0]);
1339 tprintf(", ");
1340 printpath(tcp, tcp->u_arg[1]);
1341 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001342 printflags(mount_flags, tcp->u_arg[2], "MS_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001343 if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
1344 tprintf(", ");
1345 tprintf("%ld", tcp->u_arg[3]);
1346 }
1347 if (tcp->u_arg[2] & MS_DATA) {
1348 int nfs_type = sysfs(GETFSIND, FSID_NFS);
1349
1350 tprintf(", ");
1351 if (tcp->u_arg[3] == nfs_type) {
1352 struct nfs_args args;
1353 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1354 tprintf("%#lx", tcp->u_arg[4]);
1355 else {
1356 tprintf("addr=");
1357 printsock(tcp, (int) args.addr);
1358 tprintf(", flags=");
Roland McGrathb2dee132005-06-01 19:02:36 +00001359 printflags(nfs_flags, args.flags, "NFSMNT_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001360 tprintf(", hostname=");
1361 printstr(tcp, (int) args.hostname, -1);
1362 tprintf(", ...}");
1363 }
1364 }
1365 else
1366 tprintf("%#lx", tcp->u_arg[4]);
1367 tprintf(", %ld", tcp->u_arg[5]);
1368 }
1369 }
1370 return 0;
1371}
1372
1373#else /* !MIPS */
1374
Wichert Akkerman3377df71999-11-26 13:14:41 +00001375#if UNIXWARE
1376
1377#include <sys/types.h>
1378#include <sys/fstyp.h>
1379#include <sys/mount.h>
1380#include <sys/xti.h>
1381
1382#define NFSCLIENT 1
1383#include <nfs/mount.h>
1384
1385#include <sys/fs/vx_ioctl.h>
1386
Roland McGrathd9f816f2004-09-04 03:39:20 +00001387static const struct xlat mount_flags[] = {
Wichert Akkerman3377df71999-11-26 13:14:41 +00001388 { MS_RDONLY, "MS_RDONLY" },
1389 { MS_FSS, "MS_FSS" },
1390 { MS_DATA, "MS_DATA" },
1391 { MS_HADBAD, "MS_HADBAD" },
1392 { MS_NOSUID, "MS_NOSUID" },
1393 { MS_REMOUNT, "MS_REMOUNT" },
1394 { MS_NOTRUNC, "MS_NOTRUNC" },
1395 { MS_SOFTMNT, "MS_SOFTMNT" },
1396 { MS_SYSSPACE, "MS_SYSSPACE" },
1397 { 0, NULL },
1398};
1399
1400#ifdef VX_MS_MASK
Roland McGrathd9f816f2004-09-04 03:39:20 +00001401static const struct xlat vxfs_flags[] = {
Wichert Akkerman3377df71999-11-26 13:14:41 +00001402 { VX_MS_NOLOG, "VX_MS_NOLOG" },
1403 { VX_MS_BLKCLEAR, "VX_MS_BLKCLEAR" },
1404 { VX_MS_SNAPSHOT, "VX_MS_SNAPSHOT" },
1405 { VX_MS_NODATAINLOG, "VX_MS_NODATAINLOG" },
1406 { VX_MS_DELAYLOG, "VX_MS_DELAYLOG" },
1407 { VX_MS_TMPLOG, "VX_MS_TMPLOG" },
1408 { VX_MS_FILESET, "VX_MS_FILESET" },
1409
1410 { VX_MS_CACHE_DIRECT, "VX_MS_CACHE_DIRECT" },
1411 { VX_MS_CACHE_DSYNC, "VX_MS_CACHE_DSYNC" },
1412 { VX_MS_CACHE_CLOSESYNC,"VX_MS_CACHE_CLOSESYNC" },
1413 { VX_MS_CACHE_TMPCACHE, "VX_MS_CACHE_TMPCACHE" },
1414
1415 { VX_MS_OSYNC_DIRECT, "VX_MS_OSYNC_DIRECT" },
1416 { VX_MS_OSYNC_DSYNC, "VX_MS_OSYNC_DSYNC" },
1417 { VX_MS_OSYNC_CLOSESYNC,"VX_MS_OSYNC_CLOSESYNC" },
1418 { VX_MS_OSYNC_DELAY, "VX_MS_OSYNC_DELAY" },
1419 { 0, NULL, },
1420};
1421#endif
1422
Roland McGrathd9f816f2004-09-04 03:39:20 +00001423static const struct xlat nfs_flags[] = {
Wichert Akkerman3377df71999-11-26 13:14:41 +00001424 { NFSMNT_SOFT, "NFSMNT_SOFT" },
1425 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
1426 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
1427 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
1428 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
1429 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
1430 { NFSMNT_INT, "NFSMNT_INT" },
1431 { NFSMNT_NOAC, "NFSMNT_NOAC" },
1432 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
1433 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
1434 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
1435 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
1436 { NFSMNT_SECURE, "NFSMNT_SECURE" },
1437 { NFSMNT_NOCTO, "NFSMNT_NOCTO" },
1438 { NFSMNT_GRPID, "NFSMNT_GRPID" },
1439 { NFSMNT_RPCTIMESYNC, "NFSMNT_RPCTIMESYNC" },
1440 { NFSMNT_LWPSMAX, "NFSMNT_LWPSMAX" },
1441 { 0, NULL },
1442};
1443
1444int
1445sys_mount(tcp)
1446struct tcb *tcp;
1447{
1448 if (entering(tcp)) {
1449 char fstyp [FSTYPSZ];
1450 printpath(tcp, tcp->u_arg[0]);
1451 tprintf(", ");
1452 printpath(tcp, tcp->u_arg[1]);
1453 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001454 printflags(mount_flags, tcp->u_arg[2], "MS_???");
Wichert Akkerman3377df71999-11-26 13:14:41 +00001455 /* The doc sez that the file system type is given as a
1456 fsindex, and we should use sysfs to work out the name.
1457 This appears to be untrue for UW. Maybe it's untrue
1458 for all SVR4's? */
1459 if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
1460 if (umovestr(tcp, tcp->u_arg[3], FSTYPSZ, fstyp) < 0) {
1461 *fstyp = 0;
1462 tprintf(", %ld", tcp->u_arg[3]);
1463 }
1464 else
1465 tprintf(", \"%s\"", fstyp);
1466 }
1467 if (tcp->u_arg[2] & MS_DATA) {
1468 tprintf(", ");
1469#ifdef VX_MS_MASK
1470 /* On UW7 they don't give us the defines and structs
1471 we need to see what is going on. Bummer. */
1472 if (strcmp (fstyp, "vxfs") == 0) {
1473 struct vx_mountargs5 args;
1474 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1475 tprintf("%#lx", tcp->u_arg[4]);
1476 else {
1477 tprintf("{ flags=");
Roland McGrathb2dee132005-06-01 19:02:36 +00001478 printflags(vxfs_flags, args.mflags, "VX_MS_???");
Wichert Akkerman3377df71999-11-26 13:14:41 +00001479 if (args.mflags & VX_MS_SNAPSHOT) {
1480 tprintf (", snapof=");
1481 printstr (tcp,
Roland McGrathced50da2004-08-31 06:48:46 +00001482 (long) args.primaryspec,
Wichert Akkerman3377df71999-11-26 13:14:41 +00001483 -1);
1484 if (args.snapsize > 0)
1485 tprintf (", snapsize=%ld", args.snapsize);
1486 }
1487 tprintf(" }");
1488 }
1489 }
1490 else
1491#endif
1492 if (strcmp (fstyp, "specfs") == 0) {
1493 tprintf ("dev=");
1494 printstr (tcp, tcp->u_arg[4], -1);
1495 }
1496 else
1497 if (strcmp (fstyp, "nfs") == 0) {
1498 struct nfs_args args;
1499 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1500 tprintf("%#lx", tcp->u_arg[4]);
1501 else {
1502 struct netbuf addr;
1503 tprintf("{ addr=");
1504 if (umove (tcp, (int) args.addr, &addr) < 0) {
1505 tprintf ("%#lx", (long) args.addr);
1506 }
1507 else {
1508 printsock(tcp, (int) addr.buf, addr.len);
1509 }
1510 tprintf(", flags=");
Roland McGrathb2dee132005-06-01 19:02:36 +00001511 printflags(nfs_flags, args.flags, "NFSMNT_???");
Wichert Akkerman3377df71999-11-26 13:14:41 +00001512 tprintf(", hostname=");
1513 printstr(tcp, (int) args.hostname, -1);
1514 tprintf(", ...}");
1515 }
1516 }
1517 else
1518 tprintf("%#lx", tcp->u_arg[4]);
1519 tprintf(", %ld", tcp->u_arg[5]);
1520 }
1521 }
1522 return 0;
1523}
1524
1525#else /* !UNIXWARE */
1526
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001527int
1528sys_mount(tcp)
1529struct tcb *tcp;
1530{
1531 if (entering(tcp)) {
1532 printpath(tcp, tcp->u_arg[0]);
1533 tprintf(", ");
1534 printpath(tcp, tcp->u_arg[1]);
1535 tprintf(", ...");
1536 }
1537 return 0;
1538}
Wichert Akkermanea78f0f1999-11-29 15:34:02 +00001539#endif /* !UNIXWARE */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001540
1541#endif /* !MIPS */
1542
1543#endif /* SVR4 */
1544
Nate Sammons8d5860c1999-07-03 18:53:05 +00001545#ifdef SYS_capget
Wichert Akkermanc7926982000-04-10 22:22:31 +00001546
Roland McGrathd9f816f2004-09-04 03:39:20 +00001547static const struct xlat capabilities[] = {
Wichert Akkermanc7926982000-04-10 22:22:31 +00001548 { 1<<CAP_CHOWN, "CAP_CHOWN" },
1549 { 1<<CAP_DAC_OVERRIDE, "CAP_DAC_OVERRIDE"},
1550 { 1<<CAP_DAC_READ_SEARCH,"CAP_DAC_READ_SEARCH"},
1551 { 1<<CAP_FOWNER, "CAP_FOWNER" },
1552 { 1<<CAP_FSETID, "CAP_FSETID" },
1553 { 1<<CAP_KILL, "CAP_KILL" },
1554 { 1<<CAP_SETGID, "CAP_SETGID" },
1555 { 1<<CAP_SETUID, "CAP_SETUID" },
1556 { 1<<CAP_SETPCAP, "CAP_SETPCAP" },
1557 { 1<<CAP_LINUX_IMMUTABLE,"CAP_LINUX_IMMUTABLE"},
1558 { 1<<CAP_NET_BIND_SERVICE,"CAP_NET_BIND_SERVICE"},
1559 { 1<<CAP_NET_BROADCAST, "CAP_NET_BROADCAST"},
1560 { 1<<CAP_NET_ADMIN, "CAP_NET_ADMIN" },
1561 { 1<<CAP_NET_RAW, "CAP_NET_RAW" },
1562 { 1<<CAP_IPC_LOCK, "CAP_IPC_LOCK" },
1563 { 1<<CAP_IPC_OWNER, "CAP_IPC_OWNER" },
1564 { 1<<CAP_SYS_MODULE, "CAP_SYS_MODULE"},
1565 { 1<<CAP_SYS_RAWIO, "CAP_SYS_RAWIO" },
1566 { 1<<CAP_SYS_CHROOT, "CAP_SYS_CHROOT"},
1567 { 1<<CAP_SYS_PTRACE, "CAP_SYS_PTRACE"},
1568 { 1<<CAP_SYS_PACCT, "CAP_SYS_PACCT" },
1569 { 1<<CAP_SYS_ADMIN, "CAP_SYS_ADMIN" },
1570 { 1<<CAP_SYS_BOOT, "CAP_SYS_BOOT" },
1571 { 1<<CAP_SYS_NICE, "CAP_SYS_NICE" },
1572 { 1<<CAP_SYS_RESOURCE, "CAP_SYS_RESOURCE"},
1573 { 1<<CAP_SYS_TIME, "CAP_SYS_TIME" },
1574 { 1<<CAP_SYS_TTY_CONFIG,"CAP_SYS_TTY_CONFIG"},
Dmitry V. Levin949f4512008-11-11 00:21:09 +00001575#ifdef CAP_MKNOD
1576 { 1<<CAP_MKNOD, "CAP_MKNOD" },
1577#endif
1578#ifdef CAP_LEASE
1579 { 1<<CAP_LEASE, "CAP_LEASE" },
1580#endif
1581#ifdef CAP_AUDIT_WRITE
1582 { 1<<CAP_AUDIT_WRITE, "CAP_AUDIT_WRITE"},
1583#endif
1584#ifdef CAP_AUDIT_CONTROL
1585 { 1<<CAP_AUDIT_CONTROL, "CAP_AUDIT_CONTROL"},
1586#endif
1587#ifdef CAP_SETFCAP
1588 { 1<<CAP_SETFCAP, "CAP_SETFCAP" },
1589#endif
Wichert Akkermanc7926982000-04-10 22:22:31 +00001590 { 0, NULL },
1591};
1592
1593
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001594int
1595sys_capget(tcp)
1596struct tcb *tcp;
1597{
Wichert Akkermanc7926982000-04-10 22:22:31 +00001598 static cap_user_header_t arg0 = NULL;
1599 static cap_user_data_t arg1 = NULL;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001600
1601 if(!entering(tcp)) {
Wichert Akkermanc7926982000-04-10 22:22:31 +00001602 if (!arg0) {
1603 if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001604 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001605 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001606 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001607 }
1608 }
1609 if (!arg1) {
1610 if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001611 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001612 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001613 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001614 }
1615 }
1616
1617 if (!tcp->u_arg[0])
1618 tprintf("NULL");
1619 else if (!verbose(tcp))
1620 tprintf("%#lx", tcp->u_arg[0]);
1621 else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
1622 tprintf("???");
1623 else {
1624 tprintf("%#x, %d", arg0->version, arg0->pid);
1625 }
1626 tprintf(", ");
1627 if (!tcp->u_arg[1])
1628 tprintf("NULL");
1629 else if (!verbose(tcp))
1630 tprintf("%#lx", tcp->u_arg[1]);
1631 else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
1632 tprintf("???");
1633 else {
1634 tprintf("{");
Roland McGrathb2dee132005-06-01 19:02:36 +00001635 printflags(capabilities, arg1->effective, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001636 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001637 printflags(capabilities, arg1->permitted, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001638 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001639 printflags(capabilities, arg1->inheritable, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001640 tprintf("}");
Roland McGrathced50da2004-08-31 06:48:46 +00001641 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001642 }
1643 return 0;
1644}
1645
1646int
1647sys_capset(tcp)
1648struct tcb *tcp;
1649{
Wichert Akkermanc7926982000-04-10 22:22:31 +00001650 static cap_user_header_t arg0 = NULL;
1651 static cap_user_data_t arg1 = NULL;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001652
Wichert Akkermanc7926982000-04-10 22:22:31 +00001653 if(entering(tcp)) {
1654 if (!arg0) {
1655 if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001656 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001657 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001658 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001659 }
1660 }
1661 if (!arg1) {
1662 if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001663 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001664 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001665 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001666 }
1667 }
1668
1669 if (!tcp->u_arg[0])
1670 tprintf("NULL");
1671 else if (!verbose(tcp))
1672 tprintf("%#lx", tcp->u_arg[0]);
1673 else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
1674 tprintf("???");
1675 else {
1676 tprintf("%#x, %d", arg0->version, arg0->pid);
1677 }
1678 tprintf(", ");
1679 if (!tcp->u_arg[1])
1680 tprintf("NULL");
1681 else if (!verbose(tcp))
1682 tprintf("%#lx", tcp->u_arg[1]);
1683 else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
1684 tprintf("???");
1685 else {
1686 tprintf("{");
Roland McGrathb2dee132005-06-01 19:02:36 +00001687 printflags(capabilities, arg1->effective, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001688 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001689 printflags(capabilities, arg1->permitted, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001690 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001691 printflags(capabilities, arg1->inheritable, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001692 tprintf("}");
Roland McGrathced50da2004-08-31 06:48:46 +00001693 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001694 }
1695 return 0;
1696}
1697
1698#else
1699
1700int sys_capget(tcp)
1701struct tcb *tcp;
1702{
1703 return printargs(tcp);
1704}
1705
1706int sys_capset(tcp)
1707struct tcb *tcp;
1708{
1709 return printargs(tcp);
1710}
1711
1712#endif
1713
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001714#ifdef LINUX
Dmitry V. Levin35a55782006-12-04 13:48:10 +00001715/* Linux 2.6.18+ headers removed CTL_PROC enum. */
1716# define CTL_PROC 4
Roland McGrath5eb1aa52007-01-11 22:48:39 +00001717# define CTL_CPU 10 /* older headers lack */
Roland McGrathd9f816f2004-09-04 03:39:20 +00001718static const struct xlat sysctl_root[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001719 { CTL_KERN, "CTL_KERN" },
1720 { CTL_VM, "CTL_VM" },
1721 { CTL_NET, "CTL_NET" },
1722 { CTL_PROC, "CTL_PROC" },
1723 { CTL_FS, "CTL_FS" },
1724 { CTL_DEBUG, "CTL_DEBUG" },
1725 { CTL_DEV, "CTL_DEV" },
Dmitry V. Levin35a55782006-12-04 13:48:10 +00001726 { CTL_BUS, "CTL_BUS" },
1727 { CTL_ABI, "CTL_ABI" },
1728 { CTL_CPU, "CTL_CPU" },
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001729 { 0, NULL }
1730};
1731
Roland McGrathd9f816f2004-09-04 03:39:20 +00001732static const struct xlat sysctl_kern[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001733 { KERN_OSTYPE, "KERN_OSTYPE" },
1734 { KERN_OSRELEASE, "KERN_OSRELEASE" },
1735 { KERN_OSREV, "KERN_OSREV" },
1736 { KERN_VERSION, "KERN_VERSION" },
1737 { KERN_SECUREMASK, "KERN_SECUREMASK" },
1738 { KERN_PROF, "KERN_PROF" },
1739 { KERN_NODENAME, "KERN_NODENAME" },
1740 { KERN_DOMAINNAME, "KERN_DOMAINNAME" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001741#ifdef KERN_SECURELVL
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001742 { KERN_SECURELVL, "KERN_SECURELVL" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001743#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001744 { KERN_PANIC, "KERN_PANIC" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001745#ifdef KERN_REALROOTDEV
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001746 { KERN_REALROOTDEV, "KERN_REALROOTDEV" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001747#endif
1748#ifdef KERN_JAVA_INTERPRETER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001749 { KERN_JAVA_INTERPRETER, "KERN_JAVA_INTERPRETER" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001750#endif
1751#ifdef KERN_JAVA_APPLETVIEWER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001752 { KERN_JAVA_APPLETVIEWER, "KERN_JAVA_APPLETVIEWER" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001753#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001754 { KERN_SPARC_REBOOT, "KERN_SPARC_REBOOT" },
1755 { KERN_CTLALTDEL, "KERN_CTLALTDEL" },
1756 { KERN_PRINTK, "KERN_PRINTK" },
1757 { KERN_NAMETRANS, "KERN_NAMETRANS" },
1758 { KERN_PPC_HTABRECLAIM, "KERN_PPC_HTABRECLAIM" },
1759 { KERN_PPC_ZEROPAGED, "KERN_PPC_ZEROPAGED" },
1760 { KERN_PPC_POWERSAVE_NAP, "KERN_PPC_POWERSAVE_NAP" },
1761 { KERN_MODPROBE, "KERN_MODPROBE" },
1762 { KERN_SG_BIG_BUFF, "KERN_SG_BIG_BUFF" },
1763 { KERN_ACCT, "KERN_ACCT" },
1764 { KERN_PPC_L2CR, "KERN_PPC_L2CR" },
1765 { KERN_RTSIGNR, "KERN_RTSIGNR" },
1766 { KERN_RTSIGMAX, "KERN_RTSIGMAX" },
1767 { KERN_SHMMAX, "KERN_SHMMAX" },
1768 { KERN_MSGMAX, "KERN_MSGMAX" },
1769 { KERN_MSGMNB, "KERN_MSGMNB" },
1770 { KERN_MSGPOOL, "KERN_MSGPOOL" },
1771 { 0, NULL }
1772};
1773
Roland McGrathd9f816f2004-09-04 03:39:20 +00001774static const struct xlat sysctl_vm[] = {
Roland McGratha796fd02004-03-01 22:10:54 +00001775#ifdef VM_SWAPCTL
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001776 { VM_SWAPCTL, "VM_SWAPCTL" },
Roland McGratha796fd02004-03-01 22:10:54 +00001777#endif
1778#ifdef VM_UNUSED1
1779 { VM_UNUSED1, "VM_UNUSED1" },
1780#endif
1781#ifdef VM_SWAPOUT
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001782 { VM_SWAPOUT, "VM_SWAPOUT" },
Roland McGratha796fd02004-03-01 22:10:54 +00001783#endif
1784#ifdef VM_UNUSED2
1785 { VM_UNUSED2, "VM_UNUSED2" },
1786#endif
1787#ifdef VM_FREEPG
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001788 { VM_FREEPG, "VM_FREEPG" },
Roland McGratha796fd02004-03-01 22:10:54 +00001789#endif
1790#ifdef VM_UNUSED3
1791 { VM_UNUSED3, "VM_UNUSED3" },
1792#endif
1793#ifdef VM_BDFLUSH
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001794 { VM_BDFLUSH, "VM_BDFLUSH" },
Roland McGratha796fd02004-03-01 22:10:54 +00001795#endif
1796#ifdef VM_UNUSED4
1797 { VM_UNUSED4, "VM_UNUSED4" },
1798#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001799 { VM_OVERCOMMIT_MEMORY, "VM_OVERCOMMIT_MEMORY" },
Roland McGratha796fd02004-03-01 22:10:54 +00001800#ifdef VM_BUFFERMEM
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001801 { VM_BUFFERMEM, "VM_BUFFERMEM" },
Roland McGratha796fd02004-03-01 22:10:54 +00001802#endif
1803#ifdef VM_UNUSED5
1804 { VM_UNUSED5, "VM_UNUSED5" },
1805#endif
1806#ifdef VM_PAGECACHE
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001807 { VM_PAGECACHE, "VM_PAGECACHE" },
Roland McGratha796fd02004-03-01 22:10:54 +00001808#endif
1809#ifdef VM_UNUSED7
1810 { VM_UNUSED7, "VM_UNUSED7" },
1811#endif
1812#ifdef VM_PAGERDAEMON
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001813 { VM_PAGERDAEMON, "VM_PAGERDAEMON" },
Roland McGratha796fd02004-03-01 22:10:54 +00001814#endif
1815#ifdef VM_UNUSED8
1816 { VM_UNUSED8, "VM_UNUSED8" },
1817#endif
1818#ifdef VM_PGT_CACHE
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001819 { VM_PGT_CACHE, "VM_PGT_CACHE" },
Roland McGratha796fd02004-03-01 22:10:54 +00001820#endif
1821#ifdef VM_UNUSED9
1822 { VM_UNUSED9, "VM_UNUSED9" },
1823#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001824 { VM_PAGE_CLUSTER, "VM_PAGE_CLUSTER" },
1825 { 0, NULL },
1826};
1827
Roland McGrathd9f816f2004-09-04 03:39:20 +00001828static const struct xlat sysctl_net[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001829 { NET_CORE, "NET_CORE" },
1830 { NET_ETHER, "NET_ETHER" },
1831 { NET_802, "NET_802" },
1832 { NET_UNIX, "NET_UNIX" },
1833 { NET_IPV4, "NET_IPV4" },
1834 { NET_IPX, "NET_IPX" },
1835 { NET_ATALK, "NET_ATALK" },
1836 { NET_NETROM, "NET_NETROM" },
1837 { NET_AX25, "NET_AX25" },
1838 { NET_BRIDGE, "NET_BRIDGE" },
1839 { NET_ROSE, "NET_ROSE" },
1840 { NET_IPV6, "NET_IPV6" },
1841 { NET_X25, "NET_X25" },
1842 { NET_TR, "NET_TR" },
1843 { NET_DECNET, "NET_DECNET" },
1844 { 0, NULL }
1845};
1846
Roland McGrathd9f816f2004-09-04 03:39:20 +00001847static const struct xlat sysctl_net_core[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001848 { NET_CORE_WMEM_MAX, "NET_CORE_WMEM_MAX" },
1849 { NET_CORE_RMEM_MAX, "NET_CORE_RMEM_MAX" },
1850 { NET_CORE_WMEM_DEFAULT, "NET_CORE_WMEM_DEFAULT" },
1851 { NET_CORE_RMEM_DEFAULT, "NET_CORE_RMEM_DEFAULT" },
1852 { NET_CORE_MAX_BACKLOG, "NET_CORE_MAX_BACKLOG" },
1853 { NET_CORE_FASTROUTE, "NET_CORE_FASTROUTE" },
1854 { NET_CORE_MSG_COST, "NET_CORE_MSG_COST" },
1855 { NET_CORE_MSG_BURST, "NET_CORE_MSG_BURST" },
1856 { NET_CORE_OPTMEM_MAX, "NET_CORE_OPTMEM_MAX" },
1857 { 0, NULL }
1858};
1859
Roland McGrathd9f816f2004-09-04 03:39:20 +00001860static const struct xlat sysctl_net_unix[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001861 { NET_UNIX_DESTROY_DELAY, "NET_UNIX_DESTROY_DELAY" },
1862 { NET_UNIX_DELETE_DELAY, "NET_UNIX_DELETE_DELAY" },
1863 { 0, NULL }
1864};
1865
Roland McGrathd9f816f2004-09-04 03:39:20 +00001866static const struct xlat sysctl_net_ipv4[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001867 { NET_IPV4_FORWARD, "NET_IPV4_FORWARD" },
1868 { NET_IPV4_DYNADDR, "NET_IPV4_DYNADDR" },
1869 { NET_IPV4_CONF, "NET_IPV4_CONF" },
1870 { NET_IPV4_NEIGH, "NET_IPV4_NEIGH" },
1871 { NET_IPV4_ROUTE, "NET_IPV4_ROUTE" },
1872 { NET_IPV4_FIB_HASH, "NET_IPV4_FIB_HASH" },
1873 { NET_IPV4_TCP_TIMESTAMPS, "NET_IPV4_TCP_TIMESTAMPS" },
1874 { NET_IPV4_TCP_WINDOW_SCALING, "NET_IPV4_TCP_WINDOW_SCALING" },
1875 { NET_IPV4_TCP_SACK, "NET_IPV4_TCP_SACK" },
1876 { NET_IPV4_TCP_RETRANS_COLLAPSE, "NET_IPV4_TCP_RETRANS_COLLAPSE" },
1877 { NET_IPV4_DEFAULT_TTL, "NET_IPV4_DEFAULT_TTL" },
1878 { NET_IPV4_AUTOCONFIG, "NET_IPV4_AUTOCONFIG" },
1879 { NET_IPV4_NO_PMTU_DISC, "NET_IPV4_NO_PMTU_DISC" },
1880 { NET_IPV4_TCP_SYN_RETRIES, "NET_IPV4_TCP_SYN_RETRIES" },
1881 { NET_IPV4_IPFRAG_HIGH_THRESH, "NET_IPV4_IPFRAG_HIGH_THRESH" },
1882 { NET_IPV4_IPFRAG_LOW_THRESH, "NET_IPV4_IPFRAG_LOW_THRESH" },
1883 { NET_IPV4_IPFRAG_TIME, "NET_IPV4_IPFRAG_TIME" },
1884 { NET_IPV4_TCP_MAX_KA_PROBES, "NET_IPV4_TCP_MAX_KA_PROBES" },
1885 { NET_IPV4_TCP_KEEPALIVE_TIME, "NET_IPV4_TCP_KEEPALIVE_TIME" },
1886 { NET_IPV4_TCP_KEEPALIVE_PROBES, "NET_IPV4_TCP_KEEPALIVE_PROBES" },
1887 { NET_IPV4_TCP_RETRIES1, "NET_IPV4_TCP_RETRIES1" },
1888 { NET_IPV4_TCP_RETRIES2, "NET_IPV4_TCP_RETRIES2" },
1889 { NET_IPV4_TCP_FIN_TIMEOUT, "NET_IPV4_TCP_FIN_TIMEOUT" },
1890 { NET_IPV4_IP_MASQ_DEBUG, "NET_IPV4_IP_MASQ_DEBUG" },
1891 { NET_TCP_SYNCOOKIES, "NET_TCP_SYNCOOKIES" },
1892 { NET_TCP_STDURG, "NET_TCP_STDURG" },
1893 { NET_TCP_RFC1337, "NET_TCP_RFC1337" },
1894 { NET_TCP_SYN_TAILDROP, "NET_TCP_SYN_TAILDROP" },
1895 { NET_TCP_MAX_SYN_BACKLOG, "NET_TCP_MAX_SYN_BACKLOG" },
1896 { NET_IPV4_LOCAL_PORT_RANGE, "NET_IPV4_LOCAL_PORT_RANGE" },
1897 { NET_IPV4_ICMP_ECHO_IGNORE_ALL, "NET_IPV4_ICMP_ECHO_IGNORE_ALL" },
1898 { NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS" },
1899 { NET_IPV4_ICMP_SOURCEQUENCH_RATE, "NET_IPV4_ICMP_SOURCEQUENCH_RATE" },
1900 { NET_IPV4_ICMP_DESTUNREACH_RATE, "NET_IPV4_ICMP_DESTUNREACH_RATE" },
1901 { NET_IPV4_ICMP_TIMEEXCEED_RATE, "NET_IPV4_ICMP_TIMEEXCEED_RATE" },
1902 { NET_IPV4_ICMP_PARAMPROB_RATE, "NET_IPV4_ICMP_PARAMPROB_RATE" },
1903 { NET_IPV4_ICMP_ECHOREPLY_RATE, "NET_IPV4_ICMP_ECHOREPLY_RATE" },
1904 { NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES" },
1905 { NET_IPV4_IGMP_MAX_MEMBERSHIPS, "NET_IPV4_IGMP_MAX_MEMBERSHIPS" },
1906 { 0, NULL }
1907};
1908
Roland McGrathd9f816f2004-09-04 03:39:20 +00001909static const struct xlat sysctl_net_ipv4_route[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001910 { NET_IPV4_ROUTE_FLUSH, "NET_IPV4_ROUTE_FLUSH" },
1911 { NET_IPV4_ROUTE_MIN_DELAY, "NET_IPV4_ROUTE_MIN_DELAY" },
1912 { NET_IPV4_ROUTE_MAX_DELAY, "NET_IPV4_ROUTE_MAX_DELAY" },
1913 { NET_IPV4_ROUTE_GC_THRESH, "NET_IPV4_ROUTE_GC_THRESH" },
1914 { NET_IPV4_ROUTE_MAX_SIZE, "NET_IPV4_ROUTE_MAX_SIZE" },
1915 { NET_IPV4_ROUTE_GC_MIN_INTERVAL, "NET_IPV4_ROUTE_GC_MIN_INTERVAL" },
1916 { NET_IPV4_ROUTE_GC_TIMEOUT, "NET_IPV4_ROUTE_GC_TIMEOUT" },
1917 { NET_IPV4_ROUTE_GC_INTERVAL, "NET_IPV4_ROUTE_GC_INTERVAL" },
1918 { NET_IPV4_ROUTE_REDIRECT_LOAD, "NET_IPV4_ROUTE_REDIRECT_LOAD" },
1919 { NET_IPV4_ROUTE_REDIRECT_NUMBER, "NET_IPV4_ROUTE_REDIRECT_NUMBER" },
1920 { NET_IPV4_ROUTE_REDIRECT_SILENCE, "NET_IPV4_ROUTE_REDIRECT_SILENCE" },
1921 { NET_IPV4_ROUTE_ERROR_COST, "NET_IPV4_ROUTE_ERROR_COST" },
1922 { NET_IPV4_ROUTE_ERROR_BURST, "NET_IPV4_ROUTE_ERROR_BURST" },
1923 { NET_IPV4_ROUTE_GC_ELASTICITY, "NET_IPV4_ROUTE_GC_ELASTICITY" },
1924 { 0, NULL }
1925};
1926
Roland McGrathd9f816f2004-09-04 03:39:20 +00001927static const struct xlat sysctl_net_ipv4_conf[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001928 { NET_IPV4_CONF_FORWARDING, "NET_IPV4_CONF_FORWARDING" },
1929 { NET_IPV4_CONF_MC_FORWARDING, "NET_IPV4_CONF_MC_FORWARDING" },
1930 { NET_IPV4_CONF_PROXY_ARP, "NET_IPV4_CONF_PROXY_ARP" },
1931 { NET_IPV4_CONF_ACCEPT_REDIRECTS, "NET_IPV4_CONF_ACCEPT_REDIRECTS" },
1932 { NET_IPV4_CONF_SECURE_REDIRECTS, "NET_IPV4_CONF_SECURE_REDIRECTS" },
1933 { NET_IPV4_CONF_SEND_REDIRECTS, "NET_IPV4_CONF_SEND_REDIRECTS" },
1934 { NET_IPV4_CONF_SHARED_MEDIA, "NET_IPV4_CONF_SHARED_MEDIA" },
1935 { NET_IPV4_CONF_RP_FILTER, "NET_IPV4_CONF_RP_FILTER" },
1936 { NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, "NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE" },
1937 { NET_IPV4_CONF_BOOTP_RELAY, "NET_IPV4_CONF_BOOTP_RELAY" },
1938 { NET_IPV4_CONF_LOG_MARTIANS, "NET_IPV4_CONF_LOG_MARTIANS" },
1939 { 0, NULL }
1940};
1941
Roland McGrathd9f816f2004-09-04 03:39:20 +00001942static const struct xlat sysctl_net_ipv6[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001943 { NET_IPV6_CONF, "NET_IPV6_CONF" },
1944 { NET_IPV6_NEIGH, "NET_IPV6_NEIGH" },
1945 { NET_IPV6_ROUTE, "NET_IPV6_ROUTE" },
1946 { 0, NULL }
1947};
1948
Roland McGrathd9f816f2004-09-04 03:39:20 +00001949static const struct xlat sysctl_net_ipv6_route[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001950 { NET_IPV6_ROUTE_FLUSH, "NET_IPV6_ROUTE_FLUSH" },
1951 { NET_IPV6_ROUTE_GC_THRESH, "NET_IPV6_ROUTE_GC_THRESH" },
1952 { NET_IPV6_ROUTE_MAX_SIZE, "NET_IPV6_ROUTE_MAX_SIZE" },
1953 { NET_IPV6_ROUTE_GC_MIN_INTERVAL, "NET_IPV6_ROUTE_GC_MIN_INTERVAL" },
1954 { NET_IPV6_ROUTE_GC_TIMEOUT, "NET_IPV6_ROUTE_GC_TIMEOUT" },
1955 { NET_IPV6_ROUTE_GC_INTERVAL, "NET_IPV6_ROUTE_GC_INTERVAL" },
1956 { NET_IPV6_ROUTE_GC_ELASTICITY, "NET_IPV6_ROUTE_GC_ELASTICITY" },
1957 { 0, NULL }
1958};
1959
1960int
1961sys_sysctl(tcp)
1962struct tcb *tcp;
1963{
1964 struct __sysctl_args info;
1965 int *name;
Roland McGrathaa524c82005-06-01 19:22:06 +00001966 unsigned long size;
1967
Roland McGrath2cbe44e2005-05-26 23:21:09 +00001968 if (umove (tcp, tcp->u_arg[0], &info) < 0)
1969 return printargs(tcp);
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001970
Roland McGrathaa524c82005-06-01 19:22:06 +00001971 size = sizeof (int) * (unsigned long) info.nlen;
1972 name = (size / sizeof (int) != info.nlen) ? NULL : malloc (size);
Roland McGrath2cbe44e2005-05-26 23:21:09 +00001973 if (name == NULL ||
Roland McGrathaa524c82005-06-01 19:22:06 +00001974 umoven(tcp, (unsigned long) info.name, size, (char *) name) < 0) {
1975 free(name);
1976 if (entering(tcp))
1977 tprintf("{%p, %d, %p, %p, %p, %Zu}",
1978 info.name, info.nlen, info.oldval,
1979 info.oldlenp, info.newval, info.newlen);
Roland McGrath2cbe44e2005-05-26 23:21:09 +00001980 return 0;
1981 }
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001982
1983 if (entering(tcp)) {
Roland McGrathaa524c82005-06-01 19:22:06 +00001984 int cnt = 0, max_cnt;
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001985
1986 tprintf("{{");
1987
1988 if (info.nlen == 0)
1989 goto out;
1990 printxval(sysctl_root, name[0], "CTL_???");
1991 ++cnt;
1992
1993 if (info.nlen == 1)
1994 goto out;
1995 switch (name[0]) {
1996 case CTL_KERN:
1997 tprintf(", ");
1998 printxval(sysctl_kern, name[1], "KERN_???");
1999 ++cnt;
2000 break;
2001 case CTL_VM:
2002 tprintf(", ");
2003 printxval(sysctl_vm, name[1], "VM_???");
2004 ++cnt;
2005 break;
2006 case CTL_NET:
2007 tprintf(", ");
2008 printxval(sysctl_net, name[1], "NET_???");
2009 ++cnt;
2010
2011 if (info.nlen == 2)
2012 goto out;
2013 switch (name[1]) {
2014 case NET_CORE:
2015 tprintf(", ");
2016 printxval(sysctl_net_core, name[2],
2017 "NET_CORE_???");
2018 break;
2019 case NET_UNIX:
2020 tprintf(", ");
2021 printxval(sysctl_net_unix, name[2],
2022 "NET_UNIX_???");
2023 break;
2024 case NET_IPV4:
2025 tprintf(", ");
2026 printxval(sysctl_net_ipv4, name[2],
2027 "NET_IPV4_???");
2028
2029 if (info.nlen == 3)
2030 goto out;
2031 switch (name[2]) {
2032 case NET_IPV4_ROUTE:
2033 tprintf(", ");
2034 printxval(sysctl_net_ipv4_route,
2035 name[3],
2036 "NET_IPV4_ROUTE_???");
2037 break;
2038 case NET_IPV4_CONF:
2039 tprintf(", ");
2040 printxval(sysctl_net_ipv4_conf,
2041 name[3],
2042 "NET_IPV4_CONF_???");
2043 break;
2044 default:
2045 goto out;
2046 }
2047 break;
2048 case NET_IPV6:
2049 tprintf(", ");
2050 printxval(sysctl_net_ipv6, name[2],
2051 "NET_IPV6_???");
2052
2053 if (info.nlen == 3)
2054 goto out;
2055 switch (name[2]) {
2056 case NET_IPV6_ROUTE:
2057 tprintf(", ");
2058 printxval(sysctl_net_ipv6_route,
2059 name[3],
2060 "NET_IPV6_ROUTE_???");
2061 break;
2062 default:
2063 goto out;
2064 }
2065 break;
2066 default:
2067 goto out;
2068 }
2069 break;
2070 default:
2071 goto out;
2072 }
2073 out:
Roland McGrath8e4a3e62006-01-12 11:03:46 +00002074 max_cnt = info.nlen;
2075 if (abbrev(tcp) && max_cnt > max_strlen)
2076 max_cnt = max_strlen;
Roland McGrathaa524c82005-06-01 19:22:06 +00002077 while (cnt < max_cnt)
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002078 tprintf(", %x", name[cnt++]);
Roland McGrathaa524c82005-06-01 19:22:06 +00002079 if (cnt < info.nlen)
2080 tprintf(", ...");
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002081 tprintf("}, %d, ", info.nlen);
2082 } else {
2083 size_t oldlen;
Roland McGrathaa524c82005-06-01 19:22:06 +00002084 if (umove(tcp, (size_t)info.oldlenp, &oldlen) >= 0
2085 && info.nlen >= 2
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002086 && ((name[0] == CTL_KERN
2087 && (name[1] == KERN_OSRELEASE
2088 || name[1] == KERN_OSTYPE
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00002089#ifdef KERN_JAVA_INTERPRETER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002090 || name[1] == KERN_JAVA_INTERPRETER
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00002091#endif
2092#ifdef KERN_JAVA_APPLETVIEWER
2093 || name[1] == KERN_JAVA_APPLETVIEWER
2094#endif
2095 )))) {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002096 printpath(tcp, (size_t)info.oldval);
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +00002097 tprintf(", %Zu, ", oldlen);
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002098 if (info.newval == 0)
2099 tprintf("NULL");
2100 else if (syserror(tcp))
2101 tprintf("%p", info.newval);
2102 else
2103 printpath(tcp, (size_t)info.newval);
2104 tprintf(", %Zd", info.newlen);
2105 } else {
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +00002106 tprintf("%p, %Zd, %p, %Zd", info.oldval, oldlen,
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002107 info.newval, info.newlen);
2108 }
2109 tprintf("}");
2110 }
Roland McGrath2cbe44e2005-05-26 23:21:09 +00002111
2112 free(name);
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002113 return 0;
2114}
2115#else
2116int sys_sysctl(tcp)
2117struct tcb *tcp;
2118{
2119 return printargs(tcp);
2120}
2121#endif
2122
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00002123#ifdef FREEBSD
2124#include <sys/sysctl.h>
2125
2126int sys___sysctl(tcp)
2127struct tcb *tcp;
2128{
2129 int qoid[CTL_MAXNAME+2];
2130 char ctl[1024];
2131 size_t len;
2132 int i, numeric;
Roland McGrathced50da2004-08-31 06:48:46 +00002133
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00002134 if (entering(tcp)) {
2135 if (tcp->u_arg[1] < 0 || tcp->u_arg[1] > CTL_MAXNAME ||
2136 (umoven(tcp, tcp->u_arg[0], tcp->u_arg[1] * sizeof(int),
2137 (char *) (qoid + 2)) < 0))
2138 tprintf("[...], ");
2139 else {
2140 /* Use sysctl to ask the name of the current MIB
2141 This uses the undocumented "Staff-functions" used
2142 by the sysctl program. See kern_sysctl.c for
2143 details. */
2144 qoid[0] = 0; /* sysctl */
2145 qoid[1] = 1; /* name */
2146 i = sizeof(ctl);
2147 tprintf("[");
2148 if (sysctl(qoid, tcp->u_arg[1] + 2, ctl, &i, 0, 0) >= 0) {
2149 numeric = !abbrev(tcp);
2150 tprintf("%s%s", ctl, numeric ? ", " : "");
2151 } else
2152 numeric = 1;
2153 if (numeric) {
2154 for (i = 0; i < tcp->u_arg[1]; i++)
2155 tprintf("%s%d", i ? "." : "", qoid[i + 2]);
2156 }
2157 tprintf("], ");
2158 tprintf("%lu, ", tcp->u_arg[1]);
2159 }
2160 } else {
2161 if (!syserror(tcp) && (umove(tcp, tcp->u_arg[3], &len) >= 0)) {
2162 printstr(tcp, tcp->u_arg[2], len);
2163 tprintf(", [%u], ", len);
Roland McGrathced50da2004-08-31 06:48:46 +00002164 } else
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00002165 tprintf("%#lx, %#lx, ", tcp->u_arg[2], tcp->u_arg[3]);
2166 printstr(tcp, tcp->u_arg[4], tcp->u_arg[5]);
2167 tprintf(", %lu", tcp->u_arg[5]);
2168 }
2169 return 0;
2170}
2171#endif
Wichert Akkerman16a03d22000-08-10 02:14:04 +00002172
2173#if UNIXWARE >= 2
2174
2175#include <sys/ksym.h>
2176#include <sys/elf.h>
2177
Roland McGrathd9f816f2004-09-04 03:39:20 +00002178static const struct xlat ksym_flags[] = {
Roland McGrathced50da2004-08-31 06:48:46 +00002179 { STT_NOTYPE, "STT_NOTYPE" },
2180 { STT_FUNC, "STT_FUNC" },
2181 { STT_OBJECT, "STT_OBJECT" },
Wichert Akkerman16a03d22000-08-10 02:14:04 +00002182 { 0, NULL },
2183};
2184
2185int
2186sys_getksym(tcp)
2187struct tcb *tcp;
2188{
2189 if (entering (tcp)) {
2190 printstr(tcp, tcp->u_arg[0], -1);
2191 tprintf(", ");
2192 }
2193 else {
2194 if (syserror(tcp)) {
2195 tprintf("%#lx, %#lx",
2196 tcp->u_arg[1], tcp->u_arg[2]);
2197 }
2198 else {
2199 int val;
2200 printnum (tcp, tcp->u_arg[1], "%#lx");
2201 tprintf(", ");
2202 if (umove(tcp, tcp->u_arg[2], &val) < 0) {
2203 tprintf("%#lx", tcp->u_arg[2]);
2204 }
2205 else {
2206 tprintf("[");
2207 printxval (ksym_flags, val, "STT_???");
2208 tprintf("]");
2209 }
2210 }
2211 }
2212
2213 return 0;
2214}
2215
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002216#ifdef HAVE_SYS_NSCSYS_H
John Hughes4e36a812001-04-18 15:11:51 +00002217
John Hughes0aadba42001-10-16 18:19:52 +00002218struct cred;
John Hughes4e36a812001-04-18 15:11:51 +00002219#include <sys/nscsys.h>
2220
Roland McGrathd9f816f2004-09-04 03:39:20 +00002221static const struct xlat ssi_cmd [] = {
John Hughes4e36a812001-04-18 15:11:51 +00002222 { SSISYS_BADOP, "SSISYS_BADOP" },
2223 { SSISYS_LDLVL_INIT,"SSISYS_LDLVL_INIT"},
2224 { SSISYS_LDLVL_GETVEC,"SSISYS_LDLVL_GETVEC"},
2225 { SSISYS_LDLVL_PUTVEC,"SSISYS_LDLVL_PUTVEC"},
2226 { SSISYS_LDLVL_PUTRCMDS,"SSISYS_LDLVL_PUTRCMDS"},
2227 { SSISYS_LDLVL_SETREXEC,"SSISYS_LDLVL_SETREXEC"},
2228 { SSISYS_CMS_CLUSTERID,"SSISYS_CMS_CLUSTERID"},
2229 { SSISYS_CFS_STATVFS,"SSISYS_CFS_STATVFS"},
2230 { SSISYS_NODE_GETNUM,"SSISYS_NODE_GETNUM"},
2231 { SSISYS_NODE_TABLE,"SSISYS_NODE_TABLE"},
2232 { SSISYS_NODE_DOWN,"SSISYS_NODE_DOWN"},
2233 { SSISYS_RECLAIM_CHILD,"SSISYS_RECLAIM_CHILD"},
2234 { SSISYS_IPC_GETINFO,"SSISYS_IPC_GETINFO"},
2235 { SSISYS_ICS_TEST,"SSISYS_ICS_TEST"},
2236 { SSISYS_NODE_PID,"SSISYS_NODE_PID"},
2237 { SSISYS_ISLOCAL,"SSISYS_ISLOCAL"},
2238 { SSISYS_CFS_ISSTACKED,"SSISYS_CFS_ISSTACKED"},
2239 { SSISYS_DNET_SYNC,"SSISYS_DNET_SYNC"},
2240 { SSISYS_CFS_WAIT_MODE,"SSISYS_CFS_WAIT_MODE"},
2241 { SSISYS_CFS_UMOUNT,"SSISYS_CFS_UMOUNT"},
2242 { SSISYS_LLSTAT,"SSISYS_LLSTAT" },
2243 { SSISYS_LTS_PERFTEST,"SSISYS_LTS_PERFTEST"},
2244 { SSISYS_LTS_CONFIG,"SSISYS_LTS_CONFIG"},
2245 { SSISYS_SNET_PERFTEST,"SSISYS_SNET_PERFTEST"},
2246 { SSISYS_IGNORE_HALFUP,"SSISYS_IGNORE_HALFUP"},
2247 { SSISYS_NODE_ROOTDEV,"SSISYS_NODE_ROOTDEV"},
2248 { SSISYS_GET_PRIMARY,"SSISYS_GET_PRIMARY"},
2249 { SSISYS_GET_SECONDARY,"SSISYS_GET_SECONDARY"},
2250 { SSISYS_GET_ROOTDISK,"SSISYS_GET_ROOTDISK"},
2251 { SSISYS_CLUSTERNODE_NUM,"SSISYS_CLUSTERNODE_NUM"},
2252 { SSISYS_CLUSTER_MEMBERSHIP,"SSISYS_CLUSTER_MEMBERSHIP"},
2253 { SSISYS_CLUSTER_DETAILEDTRANS,"SSISYS_CLUSTER_DETAILEDTRANS"},
2254 { SSISYS_CLUSTERNODE_INFO,"SSISYS_CLUSTERNODE_INFO"},
2255 { SSISYS_CLUSTERNODE_SETINFO,"SSISYS_CLUSTERNODE_SETINFO"},
2256 { SSISYS_CLUSTERNODE_AVAIL,"SSISYS_CLUSTERNODE_AVAIL"},
2257 { SSISYS_CLUSTER_MAXNODES,"SSISYS_CLUSTER_MAXNODES"},
2258 { SSISYS_SET_MEMPRIO,"SSISYS_SET_MEMPRIO"},
2259 { SSISYS_GET_USERS,"SSISYS_GET_USERS"},
2260 { SSISYS_FORCE_ROOT_NODE,"SSISYS_FORCE_ROOT_NODE"},
2261 { SSISYS_CVIP_SET,"SSISYS_CVIP_SET"},
2262 { SSISYS_CVIP_GET,"SSISYS_CVIP_GET"},
2263 { SSISYS_GET_NODE_COUNTS,"SSISYS_GET_NODE_COUNTS"},
2264 { SSISYS_GET_TRANSPORT,"SSISYS_GET_TRANSPORT"},
2265 { 0, NULL },
2266};
2267
2268int sys_ssisys (tcp)
2269struct tcb *tcp;
2270{
2271 struct ssisys_iovec iov;
John Hughes2d8b2c52001-10-18 14:52:24 +00002272 cls_nodeinfo_args_t cni;
2273 clusternode_info_t info;
2274
John Hughes4e36a812001-04-18 15:11:51 +00002275 if (entering (tcp)) {
John Hughes0aadba42001-10-16 18:19:52 +00002276 ts_reclaim_child_inargs_t trc;
John Hughes4e36a812001-04-18 15:11:51 +00002277 if (tcp->u_arg[1] != sizeof iov ||
2278 umove (tcp, tcp->u_arg[0], &iov) < 0)
2279 {
2280 tprintf ("%#lx, %ld", tcp->u_arg[0], tcp->u_arg[1]);
2281 return 0;
2282 }
2283 tprintf ("{id=");
2284 printxval(ssi_cmd, iov.tio_id.id_cmd, "SSISYS_???");
2285 tprintf (":%d", iov.tio_id.id_ver);
2286 switch (iov.tio_id.id_cmd) {
John Hughes0aadba42001-10-16 18:19:52 +00002287 case SSISYS_RECLAIM_CHILD:
2288 if (iov.tio_udatainlen != sizeof trc ||
2289 umove (tcp, (long) iov.tio_udatain, &trc) < 0)
2290 goto bad;
2291 tprintf (", in={pid=%ld, start=%ld}",
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002292 trc.trc_pid, trc.trc_start);
John Hughes0aadba42001-10-16 18:19:52 +00002293 break;
2294 case SSISYS_CLUSTERNODE_INFO:
2295 if (iov.tio_udatainlen != sizeof cni ||
2296 umove (tcp, (long) iov.tio_udatain, &cni) < 0)
2297 goto bad;
2298 tprintf (", in={node=%ld, len=%d}",
2299 cni.nodenum, cni.info_len);
2300 break;
John Hughes4e36a812001-04-18 15:11:51 +00002301 default:
John Hughes0aadba42001-10-16 18:19:52 +00002302 bad:
John Hughes4e36a812001-04-18 15:11:51 +00002303 if (iov.tio_udatainlen) {
2304 tprintf (", in=[/* %d bytes */]",
2305 iov.tio_udatainlen);
2306 }
2307 }
2308 }
2309 else {
John Hughes2d8b2c52001-10-18 14:52:24 +00002310 if (tcp->u_arg[1] != sizeof iov ||
2311 umove (tcp, tcp->u_arg[0], &iov) < 0)
2312 goto done;
John Hughes4e36a812001-04-18 15:11:51 +00002313 switch (iov.tio_id.id_cmd) {
John Hughes2d8b2c52001-10-18 14:52:24 +00002314 case SSISYS_CLUSTERNODE_INFO:
2315 if (iov.tio_udatainlen != sizeof cni ||
2316 umove (tcp, (long) iov.tio_udatain, &cni) < 0)
2317 goto bad_out;
Roland McGrathced50da2004-08-31 06:48:46 +00002318 if (cni.info_len != sizeof info ||
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002319 iov.tio_udataoutlen != sizeof &info ||
John Hughes2d8b2c52001-10-18 14:52:24 +00002320 umove (tcp, (long) iov.tio_udataout, &info) < 0)
2321 goto bad_out;
2322 tprintf (", out={node=%ld, cpus=%d, online=%d}",
2323 info.node_num, info.node_totalcpus,
2324 info.node_onlinecpus);
2325 break;
Roland McGrathced50da2004-08-31 06:48:46 +00002326
John Hughes4e36a812001-04-18 15:11:51 +00002327 default:
John Hughes2d8b2c52001-10-18 14:52:24 +00002328 bad_out:
John Hughes4e36a812001-04-18 15:11:51 +00002329 if (iov.tio_udataoutlen) {
2330 tprintf (", out=[/* %d bytes */]",
2331 iov.tio_udataoutlen);
2332 }
2333 }
John Hughes2d8b2c52001-10-18 14:52:24 +00002334 done:
John Hughes4e36a812001-04-18 15:11:51 +00002335 tprintf ("}, %ld", tcp->u_arg[1]);
2336 }
2337 return 0;
2338}
2339
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002340#endif
John Hughes4e36a812001-04-18 15:11:51 +00002341
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002342#endif /* UNIXWARE > 2 */
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002343
2344#ifdef MIPS
2345
Wichert Akkermand6b92492001-04-07 21:37:12 +00002346#ifndef __NEW_UTS_LEN
2347#define __NEW_UTS_LEN 64
2348#endif
2349
Roland McGrathd9f816f2004-09-04 03:39:20 +00002350static const struct xlat sysmips_operations[] = {
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002351 { SETNAME, "SETNAME" },
2352 { FLUSH_CACHE, "FLUSH_CACHE" },
2353 { MIPS_FIXADE, "MIPS_FIXADE" },
2354 { MIPS_RDNVRAM, "MIPS_RDNVRAM" },
2355 { MIPS_ATOMIC_SET, "MIPS_ATOMIC_SET" },
2356 { 0, NULL }
2357};
2358
2359int sys_sysmips(tcp)
2360struct tcb *tcp;
2361{
2362 if (entering(tcp)) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002363 printxval(sysmips_operations, tcp->u_arg[0], "???");
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002364 if (!verbose(tcp)) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002365 tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002366 } else if (tcp->u_arg[0]==SETNAME) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002367 char nodename[__NEW_UTS_LEN + 1];
2368 if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), nodename) < 0)
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002369 tprintf(", %#lx", tcp->u_arg[1]);
2370 else
2371 tprintf(", \"%s\"", nodename);
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002372 } else if (tcp->u_arg[0] == MIPS_ATOMIC_SET) {
2373 tprintf(", %#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]);
2374 } else if (tcp->u_arg[0] == MIPS_FIXADE) {
2375 tprintf(", 0x%lx", tcp->u_arg[1]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002376 } else {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002377 tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002378 }
2379 }
2380
2381 return 0;
2382}
2383
2384#endif /* MIPS */