blob: e16a6be4a1b8315c5d072fe773f9567bddee7196 [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 */
Roland McGrathcbd33582005-02-02 04:36:11 +000058#define MS_ACTIVE (1<<30)
59#define MS_NOUSER (1<<31)
Roland McGrath6af37482006-01-12 21:21:06 +000060#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number */
Dmitry V. Levin817b7082007-01-16 15:10:07 +000061#define MS_MGC_MSK 0xffff0000 /* Magic flag mask */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000062
63#include <sys/socket.h>
64#include <netinet/in.h>
65#include <arpa/inet.h>
66
Nate Sammons8d5860c1999-07-03 18:53:05 +000067#include <sys/syscall.h>
68
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +000069#ifdef HAVE_LINUX_CAPABILITY_H
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000070#include <linux/capability.h>
71#endif
72
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +000073#ifdef HAVE_ASM_CACHECTL_H
Wichert Akkerman2e2553a1999-05-09 00:29:58 +000074#include <asm/cachectl.h>
75#endif
76
Wichert Akkermand6b92492001-04-07 21:37:12 +000077#ifdef HAVE_LINUX_USTNAME_H
78#include <linux/utsname.h>
79#endif
80
Dmitry V. Levinf48df6c2009-06-01 09:59:11 +000081#ifdef HAVE_ASM_SYSMIPS_H
Wichert Akkermand6b92492001-04-07 21:37:12 +000082#include <asm/sysmips.h>
83#endif
84
Wichert Akkerman22fe9d21999-05-27 12:00:57 +000085#include <linux/sysctl.h>
Wichert Akkerman22fe9d21999-05-27 12:00:57 +000086
Roland McGrathd9f816f2004-09-04 03:39:20 +000087static const struct xlat mount_flags[] = {
Roland McGrath6af37482006-01-12 21:21:06 +000088 { MS_MGC_VAL, "MS_MGC_VAL" },
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000089 { MS_RDONLY, "MS_RDONLY" },
90 { MS_NOSUID, "MS_NOSUID" },
91 { MS_NODEV, "MS_NODEV" },
92 { MS_NOEXEC, "MS_NOEXEC" },
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000093 { MS_SYNCHRONOUS,"MS_SYNCHRONOUS"},
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000094 { MS_REMOUNT, "MS_REMOUNT" },
Roland McGrathcbd33582005-02-02 04:36:11 +000095 { MS_MANDLOCK, "MS_MANDLOCK" },
96 { MS_NOATIME, "MS_NOATIME" },
97 { MS_NODIRATIME,"MS_NODIRATIME" },
98 { MS_BIND, "MS_BIND" },
99 { MS_MOVE, "MS_MOVE" },
100 { MS_REC, "MS_REC" },
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000101 { MS_SILENT, "MS_SILENT" },
Roland McGrathcbd33582005-02-02 04:36:11 +0000102 { MS_POSIXACL, "MS_POSIXACL" },
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000103 { MS_UNBINDABLE,"MS_UNBINDABLE" },
104 { MS_PRIVATE, "MS_PRIVATE" },
105 { MS_SLAVE, "MS_SLAVE" },
106 { MS_SHARED, "MS_SHARED" },
Roland McGrathcbd33582005-02-02 04:36:11 +0000107 { MS_ACTIVE, "MS_ACTIVE" },
108 { MS_NOUSER, "MS_NOUSER" },
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000109 { 0, NULL },
110};
111
112int
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000113sys_mount(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000114{
115 if (entering(tcp)) {
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000116 int ignore_type = 0, ignore_data = 0;
117 unsigned long flags = tcp->u_arg[3];
118
119 /* Discard magic */
120 if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
121 flags &= ~MS_MGC_MSK;
122
123 if (flags & MS_REMOUNT)
124 ignore_type = 1;
125 else if (flags & (MS_BIND | MS_MOVE))
126 ignore_type = ignore_data = 1;
127
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000128 printpath(tcp, tcp->u_arg[0]);
129 tprintf(", ");
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000130
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000131 printpath(tcp, tcp->u_arg[1]);
132 tprintf(", ");
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000133
134 if (ignore_type && tcp->u_arg[2])
Roland McGrathcbd33582005-02-02 04:36:11 +0000135 tprintf("%#lx", tcp->u_arg[2]);
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000136 else
137 printstr(tcp, tcp->u_arg[2], -1);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000138 tprintf(", ");
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000139
Roland McGrathb2dee132005-06-01 19:02:36 +0000140 printflags(mount_flags, tcp->u_arg[3], "MS_???");
Roland McGrath6af37482006-01-12 21:21:06 +0000141 tprintf(", ");
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000142
143 if (ignore_data && tcp->u_arg[4])
Roland McGrath6af37482006-01-12 21:21:06 +0000144 tprintf("%#lx", tcp->u_arg[4]);
Dmitry V. Levin817b7082007-01-16 15:10:07 +0000145 else
146 printstr(tcp, tcp->u_arg[4], -1);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000147 }
148 return 0;
149}
150
Dmitry V. Levin5c7ad8c2007-01-13 11:15:48 +0000151#define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */
152#define MNT_DETACH 0x00000002 /* Just detach from the tree */
153#define MNT_EXPIRE 0x00000004 /* Mark for expiry */
154
155static const struct xlat umount_flags[] = {
156 { MNT_FORCE, "MNT_FORCE" },
157 { MNT_DETACH, "MNT_DETACH" },
158 { MNT_EXPIRE, "MNT_EXPIRE" },
159 { 0, NULL },
160};
161
Wichert Akkermandacfb6e1999-06-03 14:21:07 +0000162int
Dmitry V. Levin5c7ad8c2007-01-13 11:15:48 +0000163sys_umount2(struct tcb *tcp)
Wichert Akkermandacfb6e1999-06-03 14:21:07 +0000164{
165 if (entering(tcp)) {
166 printstr(tcp, tcp->u_arg[0], -1);
167 tprintf(", ");
Dmitry V. Levin5c7ad8c2007-01-13 11:15:48 +0000168 printflags(umount_flags, tcp->u_arg[1], "MNT_???");
Wichert Akkermandacfb6e1999-06-03 14:21:07 +0000169 }
170 return 0;
171}
172
Roland McGrathced50da2004-08-31 06:48:46 +0000173/* These are not macros, but enums. We just copy the values by hand
174 from Linux 2.6.9 here. */
Roland McGrathd9f816f2004-09-04 03:39:20 +0000175static const struct xlat personality_options[] = {
Roland McGrathced50da2004-08-31 06:48:46 +0000176 { 0, "PER_LINUX" },
177 { 0x00800000, "PER_LINUX_32BIT"},
178 { 0x04100001, "PER_SVR4" },
179 { 0x05000002, "PER_SVR3" },
180 { 0x07000003, "PER_SCOSVR3" },
181 { 0x06000003, "PER_OSR5" },
182 { 0x05000004, "PER_WYSEV386" },
183 { 0x04000005, "PER_ISCR4" },
184 { 0x00000006, "PER_BSD" },
185 { 0x04000006, "PER_SUNOS" },
186 { 0x05000007, "PER_XENIX" },
187 { 0x00000008, "PER_LINUX32" },
188 { 0x08000008, "PER_LINUX32_3GB"},
189 { 0x04000009, "PER_IRIX32" },
190 { 0x0400000a, "PER_IRIXN32" },
191 { 0x0400000b, "PER_IRIX64" },
192 { 0x0000000c, "PER_RISCOS" },
193 { 0x0400000d, "PER_SOLARIS" },
194 { 0x0410000e, "PER_UW7" },
195 { 0x0000000f, "PER_OSF4" },
196 { 0x00000010, "PER_HPUX" },
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000197 { 0, NULL },
198};
199
200int
201sys_personality(tcp)
202struct tcb *tcp;
203{
204 if (entering(tcp))
205 printxval(personality_options, tcp->u_arg[0], "PER_???");
206 return 0;
207}
208
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000209#include <linux/reboot.h>
Roland McGrathd9f816f2004-09-04 03:39:20 +0000210static const struct xlat bootflags1[] = {
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000211 { LINUX_REBOOT_MAGIC1, "LINUX_REBOOT_MAGIC1" },
212 { 0, NULL },
213};
214
Roland McGrathd9f816f2004-09-04 03:39:20 +0000215static const struct xlat bootflags2[] = {
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000216 { LINUX_REBOOT_MAGIC2, "LINUX_REBOOT_MAGIC2" },
217 { LINUX_REBOOT_MAGIC2A, "LINUX_REBOOT_MAGIC2A" },
218 { LINUX_REBOOT_MAGIC2B, "LINUX_REBOOT_MAGIC2B" },
219 { 0, NULL },
220};
221
Roland McGrathd9f816f2004-09-04 03:39:20 +0000222static const struct xlat bootflags3[] = {
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000223 { LINUX_REBOOT_CMD_CAD_OFF, "LINUX_REBOOT_CMD_CAD_OFF" },
224 { LINUX_REBOOT_CMD_RESTART, "LINUX_REBOOT_CMD_RESTART" },
225 { LINUX_REBOOT_CMD_HALT, "LINUX_REBOOT_CMD_HALT" },
226 { LINUX_REBOOT_CMD_CAD_ON, "LINUX_REBOOT_CMD_CAD_ON" },
227 { LINUX_REBOOT_CMD_POWER_OFF, "LINUX_REBOOT_CMD_POWER_OFF" },
228 { LINUX_REBOOT_CMD_RESTART2, "LINUX_REBOOT_CMD_RESTART2" },
229 { 0, NULL },
230};
231
232int
233sys_reboot(tcp)
234struct tcb *tcp;
235{
236 if (entering(tcp)) {
Roland McGrathb2dee132005-06-01 19:02:36 +0000237 printflags(bootflags1, tcp->u_arg[0], "LINUX_REBOOT_MAGIC_???");
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000238 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000239 printflags(bootflags2, tcp->u_arg[1], "LINUX_REBOOT_MAGIC_???");
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000240 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000241 printflags(bootflags3, tcp->u_arg[2], "LINUX_REBOOT_CMD_???");
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000242 if (tcp->u_arg[2] == LINUX_REBOOT_CMD_RESTART2) {
243 tprintf(", ");
244 printstr(tcp, tcp->u_arg[3], -1);
245 }
246 }
247 return 0;
248}
249
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000250#ifdef M68K
Roland McGrathd9f816f2004-09-04 03:39:20 +0000251static const struct xlat cacheflush_scope[] = {
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000252#ifdef FLUSH_SCOPE_LINE
253 { FLUSH_SCOPE_LINE, "FLUSH_SCOPE_LINE" },
254#endif
255#ifdef FLUSH_SCOPE_PAGE
256 { FLUSH_SCOPE_PAGE, "FLUSH_SCOPE_PAGE" },
257#endif
258#ifdef FLUSH_SCOPE_ALL
259 { FLUSH_SCOPE_ALL, "FLUSH_SCOPE_ALL" },
260#endif
261 { 0, NULL },
262};
263
Roland McGrathd9f816f2004-09-04 03:39:20 +0000264static const struct xlat cacheflush_flags[] = {
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000265#ifdef FLUSH_CACHE_BOTH
266 { FLUSH_CACHE_BOTH, "FLUSH_CACHE_BOTH" },
267#endif
268#ifdef FLUSH_CACHE_DATA
269 { FLUSH_CACHE_DATA, "FLUSH_CACHE_DATA" },
270#endif
271#ifdef FLUSH_CACHE_INSN
272 { FLUSH_CACHE_INSN, "FLUSH_CACHE_INSN" },
273#endif
274 { 0, NULL },
275};
276
277int
278sys_cacheflush(tcp)
279struct tcb *tcp;
280{
281 if (entering(tcp)) {
282 /* addr */
283 tprintf("%#lx, ", tcp->u_arg[0]);
284 /* scope */
285 printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???");
286 tprintf(", ");
287 /* flags */
Roland McGrathb2dee132005-06-01 19:02:36 +0000288 printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???");
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000289 /* len */
290 tprintf(", %lu", tcp->u_arg[3]);
291 }
292 return 0;
293}
294#endif /* M68K */
295
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000296#ifdef BFIN
297
298#include <bfin_sram.h>
299
300static const struct xlat sram_alloc_flags[] = {
301 { L1_INST_SRAM, "L1_INST_SRAM" },
302 { L1_DATA_A_SRAM, "L1_DATA_A_SRAM" },
303 { L1_DATA_B_SRAM, "L1_DATA_B_SRAM" },
304 { L1_DATA_SRAM, "L1_DATA_SRAM" },
Denys Vlasenko132c52a2009-03-23 13:12:46 +0000305 { L2_SRAM, "L2_SRAM" },
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000306 { 0, NULL },
307};
308
309int
Denys Vlasenko132c52a2009-03-23 13:12:46 +0000310sys_sram_alloc(struct tcb *tcp)
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000311{
312 if (entering(tcp)) {
313 /* size */
Denys Vlasenko132c52a2009-03-23 13:12:46 +0000314 tprintf("%lu, ", tcp->u_arg[0]);
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000315 /* flags */
Denys Vlasenko132c52a2009-03-23 13:12:46 +0000316 printxval(sram_alloc_flags, tcp->u_arg[1], "???_SRAM");
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000317 }
318 return 1;
319}
320
Mike Frysinger260e5712010-09-11 15:04:18 -0400321#include <asm/cachectl.h>
322
323static const struct xlat cacheflush_flags[] = {
324 { ICACHE, "ICACHE" },
325 { DCACHE, "DCACHE" },
326 { BCACHE, "BCACHE" },
327 { 0, NULL },
328};
329
330int
331sys_cacheflush(struct tcb *tcp)
332{
333 if (entering(tcp)) {
334 /* start addr */
335 tprintf("%#lx, ", tcp->u_arg[0]);
336 /* length */
337 tprintf("%ld, ", tcp->u_arg[1]);
338 /* flags */
339 printxval(cacheflush_flags, tcp->u_arg[1], "?CACHE");
340 }
341 return 0;
342}
343
Dmitry V. Levin87ea1f42008-11-10 22:21:41 +0000344#endif
345
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000346#endif /* LINUX */
347
348#ifdef SUNOS4
349
350#include <sys/reboot.h>
351#define NFSCLIENT
352#define LOFS
353#define RFS
354#define PCFS
355#include <sys/mount.h>
356#include <sys/socket.h>
357#include <nfs/export.h>
358#include <rpc/types.h>
359#include <rpc/auth.h>
360
361/*ARGSUSED*/
362int
363sys_sync(tcp)
364struct tcb *tcp;
365{
366 return 0;
367}
368
Roland McGrathd9f816f2004-09-04 03:39:20 +0000369static const struct xlat bootflags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000370 { RB_AUTOBOOT, "RB_AUTOBOOT" }, /* for system auto-booting itself */
371 { RB_ASKNAME, "RB_ASKNAME" }, /* ask for file name to reboot from */
372 { RB_SINGLE, "RB_SINGLE" }, /* reboot to single user only */
373 { RB_NOSYNC, "RB_NOSYNC" }, /* dont sync before reboot */
374 { RB_HALT, "RB_HALT" }, /* don't reboot, just halt */
375 { RB_INITNAME, "RB_INITNAME" }, /* name given for /etc/init */
376 { RB_NOBOOTRC, "RB_NOBOOTRC" }, /* don't run /etc/rc.boot */
377 { RB_DEBUG, "RB_DEBUG" }, /* being run under debugger */
378 { RB_DUMP, "RB_DUMP" }, /* dump system core */
379 { RB_WRITABLE, "RB_WRITABLE" }, /* mount root read/write */
380 { RB_STRING, "RB_STRING" }, /* pass boot args to prom monitor */
381 { 0, NULL },
382};
383
384int
385sys_reboot(tcp)
386struct tcb *tcp;
387{
388 if (entering(tcp)) {
Roland McGrathb2dee132005-06-01 19:02:36 +0000389 printflags(bootflags, tcp->u_arg[0], "RB_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000390 if (tcp->u_arg[0] & RB_STRING) {
391 printstr(tcp, tcp->u_arg[1], -1);
392 }
393 }
394 return 0;
395}
396
397int
398sys_sysacct(tcp)
399struct tcb *tcp;
400{
401 if (entering(tcp)) {
402 printstr(tcp, tcp->u_arg[0], -1);
403 }
404 return 0;
405}
406
407int
408sys_swapon(tcp)
409struct tcb *tcp;
410{
411 if (entering(tcp)) {
412 printstr(tcp, tcp->u_arg[0], -1);
413 }
414 return 0;
415}
416
417int
418sys_nfs_svc(tcp)
419struct tcb *tcp;
420{
421 if (entering(tcp)) {
422 printsock(tcp, tcp->u_arg[0]);
423 }
424 return 0;
425}
426
Roland McGrathd9f816f2004-09-04 03:39:20 +0000427static const struct xlat mountflags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000428 { M_RDONLY, "M_RDONLY" },
429 { M_NOSUID, "M_NOSUID" },
430 { M_NEWTYPE, "M_NEWTYPE" },
431 { M_GRPID, "M_GRPID" },
432#ifdef M_REMOUNT
433 { M_REMOUNT, "M_REMOUNT" },
434#endif
435#ifdef M_NOSUB
436 { M_NOSUB, "M_NOSUB" },
437#endif
438#ifdef M_MULTI
439 { M_MULTI, "M_MULTI" },
440#endif
441#ifdef M_SYS5
442 { M_SYS5, "M_SYS5" },
443#endif
444 { 0, NULL },
445};
446
Roland McGrathd9f816f2004-09-04 03:39:20 +0000447static const struct xlat nfsflags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000448 { NFSMNT_SOFT, "NFSMNT_SOFT" },
449 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
450 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
451 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
452 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
453 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
454 { NFSMNT_INT, "NFSMNT_INT" },
455 { NFSMNT_NOAC, "NFSMNT_NOAC" },
456 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
457 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
458 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
459 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
460#ifdef NFSMNT_SECURE
461 { NFSMNT_SECURE, "NFSMNT_SECURE" },
462#endif
463#ifdef NFSMNT_NOCTO
464 { NFSMNT_NOCTO, "NFSMNT_NOCTO" },
465#endif
466#ifdef NFSMNT_POSIX
467 { NFSMNT_POSIX, "NFSMNT_POSIX" },
468#endif
469 { 0, NULL },
470};
471
472int
473sys_mount(tcp)
474struct tcb *tcp;
475{
476 char type[4];
477
478 if (entering(tcp)) {
479 if (!(tcp->u_arg[2] & M_NEWTYPE) || umovestr(tcp,
480 tcp->u_arg[0], sizeof type, type) < 0) {
481 tprintf("OLDTYPE:#%lx", tcp->u_arg[0]);
482 } else {
483 tprintf("\"%s\", ", type);
484 }
485 printstr(tcp, tcp->u_arg[1], -1);
486 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000487 printflags(mountflags, tcp->u_arg[2] & ~M_NEWTYPE, "M_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000488 tprintf(", ");
489
490 if (strcmp(type, "4.2") == 0) {
491 struct ufs_args a;
492 if (umove(tcp, tcp->u_arg[3], &a) < 0)
493 return 0;
494 printstr(tcp, (int)a.fspec, -1);
495 } else if (strcmp(type, "lo") == 0) {
496 struct lo_args a;
497 if (umove(tcp, tcp->u_arg[3], &a) < 0)
498 return 0;
499 printstr(tcp, (int)a.fsdir, -1);
500 } else if (strcmp(type, "nfs") == 0) {
501 struct nfs_args a;
502 if (umove(tcp, tcp->u_arg[3], &a) < 0)
503 return 0;
504 tprintf("[");
505 printsock(tcp, (int) a.addr);
506 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000507 printflags(nfsflags, a.flags, "NFSMNT_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000508 tprintf(", ws:%u,rs:%u,to:%u,re:%u,",
509 a.wsize, a.rsize, a.timeo, a.retrans);
510 if (a.flags & NFSMNT_HOSTNAME && a.hostname)
511 printstr(tcp, (int)a.hostname, -1);
512 else
513 tprintf("%#lx", (unsigned long) a.hostname);
514 tprintf(",reg-min:%u,max:%u,dir-min:%u,max:%u,",
515 a.acregmin, a.acregmax, a.acdirmin, a.acdirmax);
516 if ((a.flags & NFSMNT_SECURE) && a.netname)
517 printstr(tcp, (int) a.netname, -1);
518 else
519 tprintf("%#lx", (unsigned long) a.netname);
520 tprintf("]");
521 } else if (strcmp(type, "rfs") == 0) {
522 struct rfs_args a;
523 struct token t;
524 if (umove(tcp, tcp->u_arg[3], &a) < 0)
525 return 0;
526 tprintf("[");
527 printstr(tcp, (int)a.rmtfs, -1);
528 if (umove(tcp, (int)a.token, &t) < 0)
529 return 0;
530 tprintf(", %u, %s]", t.t_id, t.t_uname);
531 } else if (strcmp(type, "pcfs") == 0) {
532 struct pc_args a;
533 if (umove(tcp, tcp->u_arg[3], &a) < 0)
534 return 0;
535 printstr(tcp, (int)a.fspec, -1);
536 }
537 }
538 return 0;
539}
540
541int
542sys_unmount(tcp)
543struct tcb *tcp;
544{
545 if (entering(tcp)) {
546 printstr(tcp, tcp->u_arg[0], -1);
547 }
548 return 0;
549}
550
551int
552sys_umount(tcp)
553struct tcb *tcp;
554{
555 return sys_unmount(tcp);
556}
557
558int
559sys_auditsys(tcp)
560struct tcb *tcp;
561{
562 /* XXX - no information available */
563 return printargs(tcp);
564}
565
Roland McGrathd9f816f2004-09-04 03:39:20 +0000566static const struct xlat ex_auth_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000567 { AUTH_UNIX, "AUTH_UNIX" },
568 { AUTH_DES, "AUTH_DES" },
569 { 0, NULL },
570};
571
572int
573sys_exportfs(tcp)
574struct tcb *tcp;
575{
576 struct export e;
577 int i;
578
579 if (entering(tcp)) {
580 printstr(tcp, tcp->u_arg[0], -1);
581 if (umove(tcp, tcp->u_arg[1], &e) < 0) {
582 tprintf("%#lx", tcp->u_arg[1]);
583 return 0;
584 }
585 tprintf("{fl:%u, anon:%u, ", e.ex_flags, e.ex_anon);
586 printxval(ex_auth_flags, e.ex_auth, "AUTH_???");
587 tprintf(", roots:[");
588 if (e.ex_auth == AUTH_UNIX) {
589 for (i=0; i<e.ex_u.exunix.rootaddrs.naddrs; i++) {
590 printsock(tcp,
591 (int)&e.ex_u.exunix.rootaddrs.addrvec[i]);
592 }
593 tprintf("], writers:[");
594 for (i=0; i<e.ex_writeaddrs.naddrs; i++) {
595 printsock(tcp,
596 (int)&e.ex_writeaddrs.addrvec[i]);
597 }
598 tprintf("]");
599 } else {
600 for (i=0; i<e.ex_u.exdes.nnames; i++) {
601 printsock(tcp,
602 (int)&e.ex_u.exdes.rootnames[i]);
603 tprintf(", ");
604 }
605 tprintf("], window:%u", e.ex_u.exdes.window);
606 }
607 tprintf("}");
608 }
609 return 0;
610}
611
Roland McGrathd9f816f2004-09-04 03:39:20 +0000612static const struct xlat sysconflimits[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000613#ifdef _SC_ARG_MAX
614 { _SC_ARG_MAX, "_SC_ARG_MAX" }, /* space for argv & envp */
615#endif
616#ifdef _SC_CHILD_MAX
617 { _SC_CHILD_MAX, "_SC_CHILD_MAX" }, /* maximum children per process??? */
618#endif
619#ifdef _SC_CLK_TCK
620 { _SC_CLK_TCK, "_SC_CLK_TCK" }, /* clock ticks/sec */
621#endif
622#ifdef _SC_NGROUPS_MAX
623 { _SC_NGROUPS_MAX, "_SC_NGROUPS_MAX" }, /* number of groups if multple supp. */
624#endif
625#ifdef _SC_OPEN_MAX
626 { _SC_OPEN_MAX, "_SC_OPEN_MAX" }, /* max open files per process */
627#endif
628#ifdef _SC_JOB_CONTROL
629 { _SC_JOB_CONTROL, "_SC_JOB_CONTROL" }, /* do we have job control */
630#endif
631#ifdef _SC_SAVED_IDS
632 { _SC_SAVED_IDS, "_SC_SAVED_IDS" }, /* do we have saved uid/gids */
633#endif
634#ifdef _SC_VERSION
635 { _SC_VERSION, "_SC_VERSION" }, /* POSIX version supported */
636#endif
637 { 0, NULL },
638};
639
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000640int
641sys_sysconf(tcp)
642struct tcb *tcp;
643{
644 if (entering(tcp)) {
645 printxval(sysconflimits, tcp->u_arg[0], "_SC_???");
646 }
647 return 0;
648}
649
650#endif /* SUNOS4 */
651
652#if defined(SUNOS4) || defined(FREEBSD)
Roland McGrathd9f816f2004-09-04 03:39:20 +0000653static const struct xlat pathconflimits[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000654#ifdef _PC_LINK_MAX
655 { _PC_LINK_MAX, "_PC_LINK_MAX" }, /* max links to file/dir */
656#endif
657#ifdef _PC_MAX_CANON
658 { _PC_MAX_CANON, "_PC_MAX_CANON" }, /* max line length */
659#endif
660#ifdef _PC_MAX_INPUT
661 { _PC_MAX_INPUT, "_PC_MAX_INPUT" }, /* max "packet" to a tty device */
662#endif
663#ifdef _PC_NAME_MAX
664 { _PC_NAME_MAX, "_PC_NAME_MAX" }, /* max pathname component length */
665#endif
666#ifdef _PC_PATH_MAX
667 { _PC_PATH_MAX, "_PC_PATH_MAX" }, /* max pathname length */
668#endif
669#ifdef _PC_PIPE_BUF
670 { _PC_PIPE_BUF, "_PC_PIPE_BUF" }, /* size of a pipe */
671#endif
672#ifdef _PC_CHOWN_RESTRICTED
673 { _PC_CHOWN_RESTRICTED, "_PC_CHOWN_RESTRICTED" }, /* can we give away files */
674#endif
675#ifdef _PC_NO_TRUNC
676 { _PC_NO_TRUNC, "_PC_NO_TRUNC" }, /* trunc or error on >NAME_MAX */
677#endif
678#ifdef _PC_VDISABLE
679 { _PC_VDISABLE, "_PC_VDISABLE" }, /* best char to shut off tty c_cc */
680#endif
681 { 0, NULL },
682};
683
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000684
685int
686sys_pathconf(tcp)
687struct tcb *tcp;
688{
689 if (entering(tcp)) {
690 printstr(tcp, tcp->u_arg[0], -1);
691 tprintf(", ");
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000692 printxval(pathconflimits, tcp->u_arg[1], "_PC_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000693 }
694 return 0;
695}
696
697int
698sys_fpathconf(tcp)
699struct tcb *tcp;
700{
701 if (entering(tcp)) {
702 tprintf("%lu, ", tcp->u_arg[0]);
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000703 printxval(pathconflimits, tcp->u_arg[1], "_PC_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000704 }
705 return 0;
706}
707
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000708#endif /* SUNOS4 || FREEBSD */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000709
710#ifdef SVR4
711
712#ifdef HAVE_SYS_SYSCONFIG_H
713#include <sys/sysconfig.h>
714#endif /* HAVE_SYS_SYSCONFIG_H */
715
716#include <sys/mount.h>
717#include <sys/systeminfo.h>
718#include <sys/utsname.h>
719
Roland McGrathd9f816f2004-09-04 03:39:20 +0000720static const struct xlat sysconfig_options[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000721#ifdef _CONFIG_NGROUPS
722 { _CONFIG_NGROUPS, "_CONFIG_NGROUPS" },
723#endif
724#ifdef _CONFIG_CHILD_MAX
725 { _CONFIG_CHILD_MAX, "_CONFIG_CHILD_MAX" },
726#endif
727#ifdef _CONFIG_OPEN_FILES
728 { _CONFIG_OPEN_FILES, "_CONFIG_OPEN_FILES" },
729#endif
730#ifdef _CONFIG_POSIX_VER
731 { _CONFIG_POSIX_VER, "_CONFIG_POSIX_VER" },
732#endif
733#ifdef _CONFIG_PAGESIZE
734 { _CONFIG_PAGESIZE, "_CONFIG_PAGESIZE" },
735#endif
736#ifdef _CONFIG_CLK_TCK
737 { _CONFIG_CLK_TCK, "_CONFIG_CLK_TCK" },
738#endif
739#ifdef _CONFIG_XOPEN_VER
740 { _CONFIG_XOPEN_VER, "_CONFIG_XOPEN_VER" },
741#endif
742#ifdef _CONFIG_PROF_TCK
743 { _CONFIG_PROF_TCK, "_CONFIG_PROF_TCK" },
744#endif
745#ifdef _CONFIG_NPROC_CONF
746 { _CONFIG_NPROC_CONF, "_CONFIG_NPROC_CONF" },
747#endif
748#ifdef _CONFIG_NPROC_ONLN
749 { _CONFIG_NPROC_ONLN, "_CONFIG_NPROC_ONLN" },
750#endif
751#ifdef _CONFIG_AIO_LISTIO_MAX
752 { _CONFIG_AIO_LISTIO_MAX, "_CONFIG_AIO_LISTIO_MAX" },
753#endif
754#ifdef _CONFIG_AIO_MAX
755 { _CONFIG_AIO_MAX, "_CONFIG_AIO_MAX" },
756#endif
757#ifdef _CONFIG_AIO_PRIO_DELTA_MAX
758 { _CONFIG_AIO_PRIO_DELTA_MAX, "_CONFIG_AIO_PRIO_DELTA_MAX" },
759#endif
760#ifdef _CONFIG_CONFIG_DELAYTIMER_MAX
761 { _CONFIG_DELAYTIMER_MAX, "_CONFIG_DELAYTIMER_MAX" },
762#endif
763#ifdef _CONFIG_MQ_OPEN_MAX
764 { _CONFIG_MQ_OPEN_MAX, "_CONFIG_MQ_OPEN_MAX" },
765#endif
766#ifdef _CONFIG_MQ_PRIO_MAX
767 { _CONFIG_MQ_PRIO_MAX, "_CONFIG_MQ_PRIO_MAX" },
768#endif
769#ifdef _CONFIG_RTSIG_MAX
770 { _CONFIG_RTSIG_MAX, "_CONFIG_RTSIG_MAX" },
771#endif
772#ifdef _CONFIG_SEM_NSEMS_MAX
773 { _CONFIG_SEM_NSEMS_MAX, "_CONFIG_SEM_NSEMS_MAX" },
774#endif
775#ifdef _CONFIG_SEM_VALUE_MAX
776 { _CONFIG_SEM_VALUE_MAX, "_CONFIG_SEM_VALUE_MAX" },
777#endif
778#ifdef _CONFIG_SIGQUEUE_MAX
779 { _CONFIG_SIGQUEUE_MAX, "_CONFIG_SIGQUEUE_MAX" },
780#endif
781#ifdef _CONFIG_SIGRT_MIN
782 { _CONFIG_SIGRT_MIN, "_CONFIG_SIGRT_MIN" },
783#endif
784#ifdef _CONFIG_SIGRT_MAX
785 { _CONFIG_SIGRT_MAX, "_CONFIG_SIGRT_MAX" },
786#endif
787#ifdef _CONFIG_TIMER_MAX
788 { _CONFIG_TIMER_MAX, "_CONFIG_TIMER_MAX" },
789#endif
790#ifdef _CONFIG_CONFIG_PHYS_PAGES
791 { _CONFIG_PHYS_PAGES, "_CONFIG_PHYS_PAGES" },
792#endif
793#ifdef _CONFIG_AVPHYS_PAGES
794 { _CONFIG_AVPHYS_PAGES, "_CONFIG_AVPHYS_PAGES" },
795#endif
796 { 0, NULL },
797};
798
799int
800sys_sysconfig(tcp)
801struct tcb *tcp;
802{
803 if (entering(tcp))
804 printxval(sysconfig_options, tcp->u_arg[0], "_CONFIG_???");
805 return 0;
806}
807
Roland McGrathd9f816f2004-09-04 03:39:20 +0000808static const struct xlat sysinfo_options[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000809 { SI_SYSNAME, "SI_SYSNAME" },
810 { SI_HOSTNAME, "SI_HOSTNAME" },
811 { SI_RELEASE, "SI_RELEASE" },
812 { SI_VERSION, "SI_VERSION" },
813 { SI_MACHINE, "SI_MACHINE" },
814 { SI_ARCHITECTURE, "SI_ARCHITECTURE" },
815 { SI_HW_SERIAL, "SI_HW_SERIAL" },
816 { SI_HW_PROVIDER, "SI_HW_PROVIDER" },
817 { SI_SRPC_DOMAIN, "SI_SRPC_DOMAIN" },
818#ifdef SI_SET_HOSTNAME
819 { SI_SET_HOSTNAME, "SI_SET_HOSTNAME" },
820#endif
821#ifdef SI_SET_SRPC_DOMAIN
822 { SI_SET_SRPC_DOMAIN, "SI_SET_SRPC_DOMAIN" },
823#endif
824#ifdef SI_SET_KERB_REALM
825 { SI_SET_KERB_REALM, "SI_SET_KERB_REALM" },
826#endif
827#ifdef SI_KERB_REALM
828 { SI_KERB_REALM, "SI_KERB_REALM" },
829#endif
830 { 0, NULL },
831};
832
833int
834sys_sysinfo(tcp)
835struct tcb *tcp;
836{
837 if (entering(tcp)) {
838 printxval(sysinfo_options, tcp->u_arg[0], "SI_???");
839 tprintf(", ");
840 }
841 else {
842 /* Technically some calls write values. So what. */
843 if (syserror(tcp))
844 tprintf("%#lx", tcp->u_arg[1]);
845 else
846 printpath(tcp, tcp->u_arg[1]);
847 tprintf(", %lu", tcp->u_arg[2]);
848 }
849 return 0;
850}
851
852#ifdef MIPS
853
854#include <sys/syssgi.h>
855
Roland McGrathd9f816f2004-09-04 03:39:20 +0000856static const struct xlat syssgi_options[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000857 { SGI_SYSID, "SGI_SYSID" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000858#ifdef SGI_RDUBLK
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000859 { SGI_RDUBLK, "SGI_RDUBLK" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000860#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000861 { SGI_TUNE, "SGI_TUNE" },
862 { SGI_IDBG, "SGI_IDBG" },
863 { SGI_INVENT, "SGI_INVENT" },
864 { SGI_RDNAME, "SGI_RDNAME" },
865 { SGI_SETLED, "SGI_SETLED" },
866 { SGI_SETNVRAM, "SGI_SETNVRAM" },
867 { SGI_GETNVRAM, "SGI_GETNVRAM" },
868 { SGI_QUERY_FTIMER, "SGI_QUERY_FTIMER" },
869 { SGI_QUERY_CYCLECNTR, "SGI_QUERY_CYCLECNTR" },
870 { SGI_PROCSZ, "SGI_PROCSZ" },
871 { SGI_SIGACTION, "SGI_SIGACTION" },
872 { SGI_SIGPENDING, "SGI_SIGPENDING" },
873 { SGI_SIGPROCMASK, "SGI_SIGPROCMASK" },
874 { SGI_SIGSUSPEND, "SGI_SIGSUSPEND" },
875 { SGI_SETSID, "SGI_SETSID" },
876 { SGI_SETPGID, "SGI_SETPGID" },
877 { SGI_SYSCONF, "SGI_SYSCONF" },
878 { SGI_WAIT4, "SGI_WAIT4" },
879 { SGI_PATHCONF, "SGI_PATHCONF" },
880 { SGI_READB, "SGI_READB" },
881 { SGI_WRITEB, "SGI_WRITEB" },
882 { SGI_SETGROUPS, "SGI_SETGROUPS" },
883 { SGI_GETGROUPS, "SGI_GETGROUPS" },
884 { SGI_SETTIMEOFDAY, "SGI_SETTIMEOFDAY" },
885 { SGI_SETTIMETRIM, "SGI_SETTIMETRIM" },
886 { SGI_GETTIMETRIM, "SGI_GETTIMETRIM" },
887 { SGI_SPROFIL, "SGI_SPROFIL" },
888 { SGI_RUSAGE, "SGI_RUSAGE" },
889 { SGI_SIGSTACK, "SGI_SIGSTACK" },
890 { SGI_SIGSTATUS, "SGI_SIGSTATUS" },
891 { SGI_NETPROC, "SGI_NETPROC" },
892 { SGI_SIGALTSTACK, "SGI_SIGALTSTACK" },
893 { SGI_BDFLUSHCNT, "SGI_BDFLUSHCNT" },
894 { SGI_SSYNC, "SGI_SSYNC" },
895 { SGI_NFSCNVT, "SGI_NFSCNVT" },
896 { SGI_GETPGID, "SGI_GETPGID" },
897 { SGI_GETSID, "SGI_GETSID" },
898 { SGI_IOPROBE, "SGI_IOPROBE" },
899 { SGI_CONFIG, "SGI_CONFIG" },
900 { SGI_ELFMAP, "SGI_ELFMAP" },
901 { SGI_MCONFIG, "SGI_MCONFIG" },
902 { SGI_GETPLABEL, "SGI_GETPLABEL" },
903 { SGI_SETPLABEL, "SGI_SETPLABEL" },
904 { SGI_GETLABEL, "SGI_GETLABEL" },
905 { SGI_SETLABEL, "SGI_SETLABEL" },
906 { SGI_SATREAD, "SGI_SATREAD" },
907 { SGI_SATWRITE, "SGI_SATWRITE" },
908 { SGI_SATCTL, "SGI_SATCTL" },
909 { SGI_LOADATTR, "SGI_LOADATTR" },
910 { SGI_UNLOADATTR, "SGI_UNLOADATTR" },
911#ifdef SGI_RECVLMSG
912 { SGI_RECVLMSG, "SGI_RECVLMSG" },
913#endif
914 { SGI_PLANGMOUNT, "SGI_PLANGMOUNT" },
915 { SGI_GETPSOACL, "SGI_GETPSOACL" },
916 { SGI_SETPSOACL, "SGI_SETPSOACL" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000917#ifdef SGI_EAG_GET_ATTR
918 { SGI_EAG_GET_ATTR, "SGI_EAG_GET_ATTR" },
919#endif
920#ifdef SGI_EAG_SET_ATTR
921 { SGI_EAG_SET_ATTR, "SGI_EAG_SET_ATTR" },
922#endif
923#ifdef SGI_EAG_GET_PROCATTR
924 { SGI_EAG_GET_PROCATTR, "SGI_EAG_GET_PROCATTR" },
925#endif
926#ifdef SGI_EAG_SET_PROCATTR
927 { SGI_EAG_SET_PROCATTR, "SGI_EAG_SET_PROCATTR" },
928#endif
929#ifdef SGI_FREVOKE
930 { SGI_FREVOKE, "SGI_FREVOKE" },
931#endif
932#ifdef SGI_SBE_GET_INFO
933 { SGI_SBE_GET_INFO, "SGI_SBE_GET_INFO" },
934#endif
935#ifdef SGI_SBE_CLR_INFO
936 { SGI_SBE_CLR_INFO, "SGI_SBE_CLR_INFO" },
937#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000938 { SGI_RMI_FIXECC, "SGI_RMI_FIXECC" },
939 { SGI_R4K_CERRS, "SGI_R4K_CERRS" },
940 { SGI_GET_EVCONF, "SGI_GET_EVCONF" },
941 { SGI_MPCWAROFF, "SGI_MPCWAROFF" },
942 { SGI_SET_AUTOPWRON, "SGI_SET_AUTOPWRON" },
943 { SGI_SPIPE, "SGI_SPIPE" },
944 { SGI_SYMTAB, "SGI_SYMTAB" },
945#ifdef SGI_SET_FPDEBUG
946 { SGI_SET_FPDEBUG, "SGI_SET_FPDEBUG" },
947#endif
Wichert Akkerman8829a551999-06-11 13:18:40 +0000948#ifdef SGI_SET_FP_PRECISE
949 { SGI_SET_FP_PRECISE, "SGI_SET_FP_PRECISE" },
950#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000951 { SGI_TOSSTSAVE, "SGI_TOSSTSAVE" },
952 { SGI_FDHI, "SGI_FDHI" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000953#ifdef SGI_SET_CONFIG_SMM
954 { SGI_SET_CONFIG_SMM, "SGI_SET_CONFIG_SMM" },
955#endif
956#ifdef SGI_SET_FP_PRESERVE
957 { SGI_SET_FP_PRESERVE, "SGI_SET_FP_PRESERVE" },
958#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000959 { SGI_MINRSS, "SGI_MINRSS" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000960#ifdef SGI_GRIO
961 { SGI_GRIO, "SGI_GRIO" },
962#endif
963#ifdef SGI_XLV_SET_TAB
964 { SGI_XLV_SET_TAB, "SGI_XLV_SET_TAB" },
965#endif
966#ifdef SGI_XLV_GET_TAB
967 { SGI_XLV_GET_TAB, "SGI_XLV_GET_TAB" },
968#endif
969#ifdef SGI_GET_FP_PRECISE
970 { SGI_GET_FP_PRECISE, "SGI_GET_FP_PRECISE" },
971#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000972#ifdef SGI_GET_CONFIG_SMM
Wichert Akkerman8829a551999-06-11 13:18:40 +0000973 { SGI_GET_CONFIG_SMM, "SGI_GET_CONFIG_SMM" },
974#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000975#ifdef SGI_FP_IMPRECISE_SUPP
Wichert Akkerman8829a551999-06-11 13:18:40 +0000976 { SGI_FP_IMPRECISE_SUPP,"SGI_FP_IMPRECISE_SUPP" },
977#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000978#ifdef SGI_CONFIG_NSMM_SUPP
Wichert Akkerman8829a551999-06-11 13:18:40 +0000979 { SGI_CONFIG_NSMM_SUPP, "SGI_CONFIG_NSMM_SUPP" },
980#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000981#ifdef SGI_RT_TSTAMP_CREATE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000982 { SGI_RT_TSTAMP_CREATE, "SGI_RT_TSTAMP_CREATE" },
983#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000984#ifdef SGI_RT_TSTAMP_DELETE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000985 { SGI_RT_TSTAMP_DELETE, "SGI_RT_TSTAMP_DELETE" },
986#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000987#ifdef SGI_RT_TSTAMP_START
Wichert Akkerman8829a551999-06-11 13:18:40 +0000988 { SGI_RT_TSTAMP_START, "SGI_RT_TSTAMP_START" },
989#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000990#ifdef SGI_RT_TSTAMP_STOP
Wichert Akkerman8829a551999-06-11 13:18:40 +0000991 { SGI_RT_TSTAMP_STOP, "SGI_RT_TSTAMP_STOP" },
992#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000993#ifdef SGI_RT_TSTAMP_ADDR
Wichert Akkerman8829a551999-06-11 13:18:40 +0000994 { SGI_RT_TSTAMP_ADDR, "SGI_RT_TSTAMP_ADDR" },
995#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000996#ifdef SGI_RT_TSTAMP_MASK
Wichert Akkerman8829a551999-06-11 13:18:40 +0000997 { SGI_RT_TSTAMP_MASK, "SGI_RT_TSTAMP_MASK" },
998#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000999#ifdef SGI_RT_TSTAMP_EOB_MODE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001000 { SGI_RT_TSTAMP_EOB_MODE,"SGI_RT_TSTAMP_EOB_MODE"},
1001#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001002#ifdef SGI_USE_FP_BCOPY
Wichert Akkerman8829a551999-06-11 13:18:40 +00001003 { SGI_USE_FP_BCOPY, "SGI_USE_FP_BCOPY" },
1004#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001005#ifdef SGI_GET_UST
Wichert Akkerman8829a551999-06-11 13:18:40 +00001006 { SGI_GET_UST, "SGI_GET_UST" },
1007#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001008#ifdef SGI_SPECULATIVE_EXEC
Wichert Akkerman8829a551999-06-11 13:18:40 +00001009 { SGI_SPECULATIVE_EXEC, "SGI_SPECULATIVE_EXEC" },
1010#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001011#ifdef SGI_XLV_NEXT_RQST
Wichert Akkerman8829a551999-06-11 13:18:40 +00001012 { SGI_XLV_NEXT_RQST, "SGI_XLV_NEXT_RQST" },
1013#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001014#ifdef SGI_XLV_ATTR_CURSOR
Wichert Akkerman8829a551999-06-11 13:18:40 +00001015 { SGI_XLV_ATTR_CURSOR, "SGI_XLV_ATTR_CURSOR" },
1016#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001017#ifdef SGI_XLV_ATTR_GET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001018 { SGI_XLV_ATTR_GET, "SGI_XLV_ATTR_GET" },
1019#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001020#ifdef SGI_XLV_ATTR_SET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001021 { SGI_XLV_ATTR_SET, "SGI_XLV_ATTR_SET" },
1022#endif
1023#ifdef SGI_BTOOLSIZE
1024 { SGI_BTOOLSIZE, "SGI_BTOOLSIZE" },
1025#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001026#ifdef SGI_BTOOLGET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001027 { SGI_BTOOLGET, "SGI_BTOOLGET" },
1028#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001029#ifdef SGI_BTOOLREINIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001030 { SGI_BTOOLREINIT, "SGI_BTOOLREINIT" },
1031#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001032#ifdef SGI_CREATE_UUID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001033 { SGI_CREATE_UUID, "SGI_CREATE_UUID" },
1034#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001035#ifdef SGI_NOFPE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001036 { SGI_NOFPE, "SGI_NOFPE" },
1037#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001038#ifdef SGI_OLD_SOFTFP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001039 { SGI_OLD_SOFTFP, "SGI_OLD_SOFTFP" },
1040#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001041#ifdef SGI_FS_INUMBERS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001042 { SGI_FS_INUMBERS, "SGI_FS_INUMBERS" },
1043#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001044#ifdef SGI_FS_BULKSTAT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001045 { SGI_FS_BULKSTAT, "SGI_FS_BULKSTAT" },
1046#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001047#ifdef SGI_RT_TSTAMP_WAIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001048 { SGI_RT_TSTAMP_WAIT, "SGI_RT_TSTAMP_WAIT" },
1049#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001050#ifdef SGI_RT_TSTAMP_UPDATE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001051 { SGI_RT_TSTAMP_UPDATE, "SGI_RT_TSTAMP_UPDATE" },
1052#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001053#ifdef SGI_PATH_TO_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001054 { SGI_PATH_TO_HANDLE, "SGI_PATH_TO_HANDLE" },
1055#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001056#ifdef SGI_PATH_TO_FSHANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001057 { SGI_PATH_TO_FSHANDLE, "SGI_PATH_TO_FSHANDLE" },
1058#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001059#ifdef SGI_FD_TO_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001060 { SGI_FD_TO_HANDLE, "SGI_FD_TO_HANDLE" },
1061#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001062#ifdef SGI_OPEN_BY_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001063 { SGI_OPEN_BY_HANDLE, "SGI_OPEN_BY_HANDLE" },
1064#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001065#ifdef SGI_READLINK_BY_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001066 { SGI_READLINK_BY_HANDLE,"SGI_READLINK_BY_HANDLE"},
1067#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001068#ifdef SGI_READ_DANGID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001069 { SGI_READ_DANGID, "SGI_READ_DANGID" },
1070#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001071#ifdef SGI_CONST
Wichert Akkerman8829a551999-06-11 13:18:40 +00001072 { SGI_CONST, "SGI_CONST" },
1073#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001074#ifdef SGI_XFS_FSOPERATIONS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001075 { SGI_XFS_FSOPERATIONS, "SGI_XFS_FSOPERATIONS" },
1076#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001077#ifdef SGI_SETASH
Wichert Akkerman8829a551999-06-11 13:18:40 +00001078 { SGI_SETASH, "SGI_SETASH" },
1079#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001080#ifdef SGI_GETASH
Wichert Akkerman8829a551999-06-11 13:18:40 +00001081 { SGI_GETASH, "SGI_GETASH" },
1082#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001083#ifdef SGI_SETPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001084 { SGI_SETPRID, "SGI_SETPRID" },
1085#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001086#ifdef SGI_GETPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001087 { SGI_GETPRID, "SGI_GETPRID" },
1088#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001089#ifdef SGI_SETSPINFO
Wichert Akkerman8829a551999-06-11 13:18:40 +00001090 { SGI_SETSPINFO, "SGI_SETSPINFO" },
1091#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001092#ifdef SGI_GETSPINFO
Wichert Akkerman8829a551999-06-11 13:18:40 +00001093 { SGI_GETSPINFO, "SGI_GETSPINFO" },
1094#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001095#ifdef SGI_SHAREII
Wichert Akkerman8829a551999-06-11 13:18:40 +00001096 { SGI_SHAREII, "SGI_SHAREII" },
1097#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001098#ifdef SGI_NEWARRAYSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001099 { SGI_NEWARRAYSESS, "SGI_NEWARRAYSESS" },
1100#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001101#ifdef SGI_GETDFLTPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001102 { SGI_GETDFLTPRID, "SGI_GETDFLTPRID" },
1103#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001104#ifdef SGI_SET_DISMISSED_EXC_CNT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001105 { SGI_SET_DISMISSED_EXC_CNT,"SGI_SET_DISMISSED_EXC_CNT" },
1106#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001107#ifdef SGI_GET_DISMISSED_EXC_CNT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001108 { SGI_GET_DISMISSED_EXC_CNT,"SGI_GET_DISMISSED_EXC_CNT" },
1109#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001110#ifdef SGI_CYCLECNTR_SIZE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001111 { SGI_CYCLECNTR_SIZE, "SGI_CYCLECNTR_SIZE" },
1112#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001113#ifdef SGI_QUERY_FASTTIMER
Wichert Akkerman8829a551999-06-11 13:18:40 +00001114 { SGI_QUERY_FASTTIMER, "SGI_QUERY_FASTTIMER" },
1115#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001116#ifdef SGI_PIDSINASH
Wichert Akkerman8829a551999-06-11 13:18:40 +00001117 { SGI_PIDSINASH, "SGI_PIDSINASH" },
1118#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001119#ifdef SGI_ULI
Wichert Akkerman8829a551999-06-11 13:18:40 +00001120 { SGI_ULI, "SGI_ULI" },
1121#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001122#ifdef SGI_LPG_SHMGET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001123 { SGI_LPG_SHMGET, "SGI_LPG_SHMGET" },
1124#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001125#ifdef SGI_LPG_MAP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001126 { SGI_LPG_MAP, "SGI_LPG_MAP" },
1127#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001128#ifdef SGI_CACHEFS_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001129 { SGI_CACHEFS_SYS, "SGI_CACHEFS_SYS" },
1130#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001131#ifdef SGI_NFSNOTIFY
Wichert Akkerman8829a551999-06-11 13:18:40 +00001132 { SGI_NFSNOTIFY, "SGI_NFSNOTIFY" },
1133#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001134#ifdef SGI_LOCKDSYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001135 { SGI_LOCKDSYS, "SGI_LOCKDSYS" },
1136#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001137#ifdef SGI_EVENTCTR
Wichert Akkerman8829a551999-06-11 13:18:40 +00001138 { SGI_EVENTCTR, "SGI_EVENTCTR" },
1139#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001140#ifdef SGI_GETPRUSAGE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001141 { SGI_GETPRUSAGE, "SGI_GETPRUSAGE" },
1142#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001143#ifdef SGI_PROCMASK_LOCATION
Wichert Akkerman8829a551999-06-11 13:18:40 +00001144 { SGI_PROCMASK_LOCATION,"SGI_PROCMASK_LOCATION" },
1145#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001146#ifdef SGI_UNUSED
Wichert Akkerman8829a551999-06-11 13:18:40 +00001147 { SGI_UNUSED, "SGI_UNUSED" },
1148#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001149#ifdef SGI_CKPT_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001150 { SGI_CKPT_SYS, "SGI_CKPT_SYS" },
1151#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001152#ifdef SGI_CKPT_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001153 { SGI_CKPT_SYS, "SGI_CKPT_SYS" },
1154#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001155#ifdef SGI_GETGRPPID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001156 { SGI_GETGRPPID, "SGI_GETGRPPID" },
1157#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001158#ifdef SGI_GETSESPID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001159 { SGI_GETSESPID, "SGI_GETSESPID" },
1160#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001161#ifdef SGI_ENUMASHS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001162 { SGI_ENUMASHS, "SGI_ENUMASHS" },
1163#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001164#ifdef SGI_SETASMACHID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001165 { SGI_SETASMACHID, "SGI_SETASMACHID" },
1166#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001167#ifdef SGI_GETASMACHID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001168 { SGI_GETASMACHID, "SGI_GETASMACHID" },
1169#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001170#ifdef SGI_GETARSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001171 { SGI_GETARSESS, "SGI_GETARSESS" },
1172#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001173#ifdef SGI_JOINARRAYSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001174 { SGI_JOINARRAYSESS, "SGI_JOINARRAYSESS" },
1175#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001176#ifdef SGI_SPROC_KILL
Wichert Akkerman8829a551999-06-11 13:18:40 +00001177 { SGI_SPROC_KILL, "SGI_SPROC_KILL" },
1178#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001179#ifdef SGI_DBA_CONFIG
Wichert Akkerman8829a551999-06-11 13:18:40 +00001180 { SGI_DBA_CONFIG, "SGI_DBA_CONFIG" },
1181#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001182#ifdef SGI_RELEASE_NAME
Wichert Akkerman8829a551999-06-11 13:18:40 +00001183 { SGI_RELEASE_NAME, "SGI_RELEASE_NAME" },
1184#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001185#ifdef SGI_SYNCH_CACHE_HANDLER
Wichert Akkerman8829a551999-06-11 13:18:40 +00001186 { SGI_SYNCH_CACHE_HANDLER,"SGI_SYNCH_CACHE_HANDLER"},
1187#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001188#ifdef SGI_SWASH_INIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001189 { SGI_SWASH_INIT, "SGI_SWASH_INIT" },
1190#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001191#ifdef SGI_NUMA_MIGR_PAGE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001192 { SGI_NUMA_MIGR_PAGE, "SGI_NUMA_MIGR_PAGE" },
1193#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001194#ifdef SGI_NUMA_MIGR_PAGE_ALT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001195 { SGI_NUMA_MIGR_PAGE_ALT,"SGI_NUMA_MIGR_PAGE_ALT"},
1196#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001197#ifdef SGI_KAIO_USERINIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001198 { SGI_KAIO_USERINIT, "SGI_KAIO_USERINIT" },
1199#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001200#ifdef SGI_KAIO_READ
Wichert Akkerman8829a551999-06-11 13:18:40 +00001201 { SGI_KAIO_READ, "SGI_KAIO_READ" },
1202#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001203#ifdef SGI_KAIO_WRITE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001204 { SGI_KAIO_WRITE, "SGI_KAIO_WRITE" },
1205#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001206#ifdef SGI_KAIO_SUSPEND
Wichert Akkerman8829a551999-06-11 13:18:40 +00001207 { SGI_KAIO_SUSPEND, "SGI_KAIO_SUSPEND" },
1208#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001209#ifdef SGI_KAIO_STATS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001210 { SGI_KAIO_STATS, "SGI_KAIO_STATS" },
1211#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001212#ifdef SGI_INITIAL_PT_SPROC
Wichert Akkerman8829a551999-06-11 13:18:40 +00001213 { SGI_INITIAL_PT_SPROC, "SGI_INITIAL_PT_SPROC" },
1214#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001215 { 0, NULL },
1216};
1217
1218int
1219sys_syssgi(tcp)
1220struct tcb *tcp;
1221{
1222 int i;
1223
1224 if (entering(tcp)) {
1225 printxval(syssgi_options, tcp->u_arg[0], "SGI_???");
1226 switch (tcp->u_arg[0]) {
1227 default:
1228 for (i = 1; i < tcp->u_nargs; i++)
1229 tprintf(", %#lx", tcp->u_arg[i]);
1230 break;
1231 }
1232 }
1233 return 0;
1234}
1235
1236#include <sys/types.h>
1237#include <rpc/rpc.h>
1238struct cred;
1239struct uio;
1240#include <sys/fsid.h>
1241#include <sys/vnode.h>
1242#include <sys/fs/nfs.h>
1243#include <sys/fs/nfs_clnt.h>
1244
Roland McGrathd9f816f2004-09-04 03:39:20 +00001245static const struct xlat mount_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001246 { MS_RDONLY, "MS_RDONLY" },
1247 { MS_FSS, "MS_FSS" },
1248 { MS_DATA, "MS_DATA" },
1249 { MS_NOSUID, "MS_NOSUID" },
1250 { MS_REMOUNT, "MS_REMOUNT" },
1251 { MS_NOTRUNC, "MS_NOTRUNC" },
1252 { MS_GRPID, "MS_GRPID" },
1253 { MS_NODEV, "MS_NODEV" },
1254 { MS_BEFORE, "MS_BEFORE" },
1255 { MS_AFTER, "MS_AFTER" },
1256 { 0, NULL },
1257};
1258
Roland McGrathd9f816f2004-09-04 03:39:20 +00001259static const struct xlat nfs_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001260 { NFSMNT_SOFT, "NFSMNT_SOFT" },
1261 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
1262 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
1263 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
1264 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
1265 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001266#ifdef NFSMNT_NOINT /* IRIX 6 */
1267 { NFSMNT_NOINT, "NFSMNT_NOINT" },
1268#endif
1269#ifdef NFSMNT_INT /* IRIX 5 */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001270 { NFSMNT_INT, "NFSMNT_INT" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001271#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001272 { NFSMNT_NOAC, "NFSMNT_NOAC" },
1273 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
1274 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
1275 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
1276 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
1277 { NFSMNT_PRIVATE, "NFSMNT_PRIVATE" },
1278 { NFSMNT_SYMTTL, "NFSMNT_SYMTTL" },
1279 { NFSMNT_LOOPBACK, "NFSMNT_LOOPBACK" },
1280 { NFSMNT_BASETYPE, "NFSMNT_BASETYPE" },
1281 { NFSMNT_NAMEMAX, "NFSMNT_NAMEMAX" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001282#ifdef NFSMNT_SHORTUID /* IRIX 6 */
1283 { NFSMNT_SHORTUID, "NFSMNT_SHORTUID" },
1284#endif
1285#ifdef NFSMNT_ASYNCNLM /* IRIX 6 */
1286 { NFSMNT_ASYNCNLM, "NFSMNT_ASYNCNLM" },
1287#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001288 { 0, NULL },
1289};
1290
1291int
1292sys_mount(tcp)
1293struct tcb *tcp;
1294{
1295 if (entering(tcp)) {
1296 printpath(tcp, tcp->u_arg[0]);
1297 tprintf(", ");
1298 printpath(tcp, tcp->u_arg[1]);
1299 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001300 printflags(mount_flags, tcp->u_arg[2], "MS_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001301 if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
1302 tprintf(", ");
1303 tprintf("%ld", tcp->u_arg[3]);
1304 }
1305 if (tcp->u_arg[2] & MS_DATA) {
1306 int nfs_type = sysfs(GETFSIND, FSID_NFS);
1307
1308 tprintf(", ");
1309 if (tcp->u_arg[3] == nfs_type) {
1310 struct nfs_args args;
1311 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1312 tprintf("%#lx", tcp->u_arg[4]);
1313 else {
1314 tprintf("addr=");
1315 printsock(tcp, (int) args.addr);
1316 tprintf(", flags=");
Roland McGrathb2dee132005-06-01 19:02:36 +00001317 printflags(nfs_flags, args.flags, "NFSMNT_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001318 tprintf(", hostname=");
1319 printstr(tcp, (int) args.hostname, -1);
1320 tprintf(", ...}");
1321 }
1322 }
1323 else
1324 tprintf("%#lx", tcp->u_arg[4]);
1325 tprintf(", %ld", tcp->u_arg[5]);
1326 }
1327 }
1328 return 0;
1329}
1330
1331#else /* !MIPS */
1332
Wichert Akkerman3377df71999-11-26 13:14:41 +00001333#if UNIXWARE
1334
1335#include <sys/types.h>
1336#include <sys/fstyp.h>
1337#include <sys/mount.h>
1338#include <sys/xti.h>
1339
1340#define NFSCLIENT 1
1341#include <nfs/mount.h>
1342
1343#include <sys/fs/vx_ioctl.h>
1344
Roland McGrathd9f816f2004-09-04 03:39:20 +00001345static const struct xlat mount_flags[] = {
Wichert Akkerman3377df71999-11-26 13:14:41 +00001346 { MS_RDONLY, "MS_RDONLY" },
1347 { MS_FSS, "MS_FSS" },
1348 { MS_DATA, "MS_DATA" },
1349 { MS_HADBAD, "MS_HADBAD" },
1350 { MS_NOSUID, "MS_NOSUID" },
1351 { MS_REMOUNT, "MS_REMOUNT" },
1352 { MS_NOTRUNC, "MS_NOTRUNC" },
1353 { MS_SOFTMNT, "MS_SOFTMNT" },
1354 { MS_SYSSPACE, "MS_SYSSPACE" },
1355 { 0, NULL },
1356};
1357
1358#ifdef VX_MS_MASK
Roland McGrathd9f816f2004-09-04 03:39:20 +00001359static const struct xlat vxfs_flags[] = {
Wichert Akkerman3377df71999-11-26 13:14:41 +00001360 { VX_MS_NOLOG, "VX_MS_NOLOG" },
1361 { VX_MS_BLKCLEAR, "VX_MS_BLKCLEAR" },
1362 { VX_MS_SNAPSHOT, "VX_MS_SNAPSHOT" },
1363 { VX_MS_NODATAINLOG, "VX_MS_NODATAINLOG" },
1364 { VX_MS_DELAYLOG, "VX_MS_DELAYLOG" },
1365 { VX_MS_TMPLOG, "VX_MS_TMPLOG" },
1366 { VX_MS_FILESET, "VX_MS_FILESET" },
1367
1368 { VX_MS_CACHE_DIRECT, "VX_MS_CACHE_DIRECT" },
1369 { VX_MS_CACHE_DSYNC, "VX_MS_CACHE_DSYNC" },
1370 { VX_MS_CACHE_CLOSESYNC,"VX_MS_CACHE_CLOSESYNC" },
1371 { VX_MS_CACHE_TMPCACHE, "VX_MS_CACHE_TMPCACHE" },
1372
1373 { VX_MS_OSYNC_DIRECT, "VX_MS_OSYNC_DIRECT" },
1374 { VX_MS_OSYNC_DSYNC, "VX_MS_OSYNC_DSYNC" },
1375 { VX_MS_OSYNC_CLOSESYNC,"VX_MS_OSYNC_CLOSESYNC" },
1376 { VX_MS_OSYNC_DELAY, "VX_MS_OSYNC_DELAY" },
1377 { 0, NULL, },
1378};
1379#endif
1380
Roland McGrathd9f816f2004-09-04 03:39:20 +00001381static const struct xlat nfs_flags[] = {
Wichert Akkerman3377df71999-11-26 13:14:41 +00001382 { NFSMNT_SOFT, "NFSMNT_SOFT" },
1383 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
1384 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
1385 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
1386 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
1387 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
1388 { NFSMNT_INT, "NFSMNT_INT" },
1389 { NFSMNT_NOAC, "NFSMNT_NOAC" },
1390 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
1391 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
1392 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
1393 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
1394 { NFSMNT_SECURE, "NFSMNT_SECURE" },
1395 { NFSMNT_NOCTO, "NFSMNT_NOCTO" },
1396 { NFSMNT_GRPID, "NFSMNT_GRPID" },
1397 { NFSMNT_RPCTIMESYNC, "NFSMNT_RPCTIMESYNC" },
1398 { NFSMNT_LWPSMAX, "NFSMNT_LWPSMAX" },
1399 { 0, NULL },
1400};
1401
1402int
1403sys_mount(tcp)
1404struct tcb *tcp;
1405{
1406 if (entering(tcp)) {
1407 char fstyp [FSTYPSZ];
1408 printpath(tcp, tcp->u_arg[0]);
1409 tprintf(", ");
1410 printpath(tcp, tcp->u_arg[1]);
1411 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001412 printflags(mount_flags, tcp->u_arg[2], "MS_???");
Wichert Akkerman3377df71999-11-26 13:14:41 +00001413 /* The doc sez that the file system type is given as a
1414 fsindex, and we should use sysfs to work out the name.
1415 This appears to be untrue for UW. Maybe it's untrue
1416 for all SVR4's? */
1417 if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
1418 if (umovestr(tcp, tcp->u_arg[3], FSTYPSZ, fstyp) < 0) {
1419 *fstyp = 0;
1420 tprintf(", %ld", tcp->u_arg[3]);
1421 }
1422 else
1423 tprintf(", \"%s\"", fstyp);
1424 }
1425 if (tcp->u_arg[2] & MS_DATA) {
1426 tprintf(", ");
1427#ifdef VX_MS_MASK
1428 /* On UW7 they don't give us the defines and structs
1429 we need to see what is going on. Bummer. */
1430 if (strcmp (fstyp, "vxfs") == 0) {
1431 struct vx_mountargs5 args;
1432 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1433 tprintf("%#lx", tcp->u_arg[4]);
1434 else {
1435 tprintf("{ flags=");
Roland McGrathb2dee132005-06-01 19:02:36 +00001436 printflags(vxfs_flags, args.mflags, "VX_MS_???");
Wichert Akkerman3377df71999-11-26 13:14:41 +00001437 if (args.mflags & VX_MS_SNAPSHOT) {
1438 tprintf (", snapof=");
1439 printstr (tcp,
Roland McGrathced50da2004-08-31 06:48:46 +00001440 (long) args.primaryspec,
Wichert Akkerman3377df71999-11-26 13:14:41 +00001441 -1);
1442 if (args.snapsize > 0)
1443 tprintf (", snapsize=%ld", args.snapsize);
1444 }
1445 tprintf(" }");
1446 }
1447 }
1448 else
1449#endif
1450 if (strcmp (fstyp, "specfs") == 0) {
1451 tprintf ("dev=");
1452 printstr (tcp, tcp->u_arg[4], -1);
1453 }
1454 else
1455 if (strcmp (fstyp, "nfs") == 0) {
1456 struct nfs_args args;
1457 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1458 tprintf("%#lx", tcp->u_arg[4]);
1459 else {
1460 struct netbuf addr;
1461 tprintf("{ addr=");
1462 if (umove (tcp, (int) args.addr, &addr) < 0) {
1463 tprintf ("%#lx", (long) args.addr);
1464 }
1465 else {
1466 printsock(tcp, (int) addr.buf, addr.len);
1467 }
1468 tprintf(", flags=");
Roland McGrathb2dee132005-06-01 19:02:36 +00001469 printflags(nfs_flags, args.flags, "NFSMNT_???");
Wichert Akkerman3377df71999-11-26 13:14:41 +00001470 tprintf(", hostname=");
1471 printstr(tcp, (int) args.hostname, -1);
1472 tprintf(", ...}");
1473 }
1474 }
1475 else
1476 tprintf("%#lx", tcp->u_arg[4]);
1477 tprintf(", %ld", tcp->u_arg[5]);
1478 }
1479 }
1480 return 0;
1481}
1482
1483#else /* !UNIXWARE */
1484
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001485int
1486sys_mount(tcp)
1487struct tcb *tcp;
1488{
1489 if (entering(tcp)) {
1490 printpath(tcp, tcp->u_arg[0]);
1491 tprintf(", ");
1492 printpath(tcp, tcp->u_arg[1]);
1493 tprintf(", ...");
1494 }
1495 return 0;
1496}
Wichert Akkermanea78f0f1999-11-29 15:34:02 +00001497#endif /* !UNIXWARE */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001498
1499#endif /* !MIPS */
1500
1501#endif /* SVR4 */
1502
Nate Sammons8d5860c1999-07-03 18:53:05 +00001503#ifdef SYS_capget
Wichert Akkermanc7926982000-04-10 22:22:31 +00001504
Roland McGrathd9f816f2004-09-04 03:39:20 +00001505static const struct xlat capabilities[] = {
Wichert Akkermanc7926982000-04-10 22:22:31 +00001506 { 1<<CAP_CHOWN, "CAP_CHOWN" },
1507 { 1<<CAP_DAC_OVERRIDE, "CAP_DAC_OVERRIDE"},
1508 { 1<<CAP_DAC_READ_SEARCH,"CAP_DAC_READ_SEARCH"},
1509 { 1<<CAP_FOWNER, "CAP_FOWNER" },
1510 { 1<<CAP_FSETID, "CAP_FSETID" },
1511 { 1<<CAP_KILL, "CAP_KILL" },
1512 { 1<<CAP_SETGID, "CAP_SETGID" },
1513 { 1<<CAP_SETUID, "CAP_SETUID" },
1514 { 1<<CAP_SETPCAP, "CAP_SETPCAP" },
1515 { 1<<CAP_LINUX_IMMUTABLE,"CAP_LINUX_IMMUTABLE"},
1516 { 1<<CAP_NET_BIND_SERVICE,"CAP_NET_BIND_SERVICE"},
1517 { 1<<CAP_NET_BROADCAST, "CAP_NET_BROADCAST"},
1518 { 1<<CAP_NET_ADMIN, "CAP_NET_ADMIN" },
1519 { 1<<CAP_NET_RAW, "CAP_NET_RAW" },
1520 { 1<<CAP_IPC_LOCK, "CAP_IPC_LOCK" },
1521 { 1<<CAP_IPC_OWNER, "CAP_IPC_OWNER" },
1522 { 1<<CAP_SYS_MODULE, "CAP_SYS_MODULE"},
1523 { 1<<CAP_SYS_RAWIO, "CAP_SYS_RAWIO" },
1524 { 1<<CAP_SYS_CHROOT, "CAP_SYS_CHROOT"},
1525 { 1<<CAP_SYS_PTRACE, "CAP_SYS_PTRACE"},
1526 { 1<<CAP_SYS_PACCT, "CAP_SYS_PACCT" },
1527 { 1<<CAP_SYS_ADMIN, "CAP_SYS_ADMIN" },
1528 { 1<<CAP_SYS_BOOT, "CAP_SYS_BOOT" },
1529 { 1<<CAP_SYS_NICE, "CAP_SYS_NICE" },
1530 { 1<<CAP_SYS_RESOURCE, "CAP_SYS_RESOURCE"},
1531 { 1<<CAP_SYS_TIME, "CAP_SYS_TIME" },
1532 { 1<<CAP_SYS_TTY_CONFIG,"CAP_SYS_TTY_CONFIG"},
Dmitry V. Levin949f4512008-11-11 00:21:09 +00001533#ifdef CAP_MKNOD
1534 { 1<<CAP_MKNOD, "CAP_MKNOD" },
1535#endif
1536#ifdef CAP_LEASE
1537 { 1<<CAP_LEASE, "CAP_LEASE" },
1538#endif
1539#ifdef CAP_AUDIT_WRITE
1540 { 1<<CAP_AUDIT_WRITE, "CAP_AUDIT_WRITE"},
1541#endif
1542#ifdef CAP_AUDIT_CONTROL
1543 { 1<<CAP_AUDIT_CONTROL, "CAP_AUDIT_CONTROL"},
1544#endif
1545#ifdef CAP_SETFCAP
1546 { 1<<CAP_SETFCAP, "CAP_SETFCAP" },
1547#endif
Wichert Akkermanc7926982000-04-10 22:22:31 +00001548 { 0, NULL },
1549};
1550
1551
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001552int
1553sys_capget(tcp)
1554struct tcb *tcp;
1555{
Wichert Akkermanc7926982000-04-10 22:22:31 +00001556 static cap_user_header_t arg0 = NULL;
1557 static cap_user_data_t arg1 = NULL;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001558
1559 if(!entering(tcp)) {
Wichert Akkermanc7926982000-04-10 22:22:31 +00001560 if (!arg0) {
1561 if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001562 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001563 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001564 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001565 }
1566 }
1567 if (!arg1) {
1568 if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001569 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001570 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001571 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001572 }
1573 }
1574
1575 if (!tcp->u_arg[0])
1576 tprintf("NULL");
1577 else if (!verbose(tcp))
1578 tprintf("%#lx", tcp->u_arg[0]);
1579 else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
1580 tprintf("???");
1581 else {
1582 tprintf("%#x, %d", arg0->version, arg0->pid);
1583 }
1584 tprintf(", ");
1585 if (!tcp->u_arg[1])
1586 tprintf("NULL");
1587 else if (!verbose(tcp))
1588 tprintf("%#lx", tcp->u_arg[1]);
1589 else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
1590 tprintf("???");
1591 else {
1592 tprintf("{");
Roland McGrathb2dee132005-06-01 19:02:36 +00001593 printflags(capabilities, arg1->effective, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001594 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001595 printflags(capabilities, arg1->permitted, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001596 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001597 printflags(capabilities, arg1->inheritable, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001598 tprintf("}");
Roland McGrathced50da2004-08-31 06:48:46 +00001599 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001600 }
1601 return 0;
1602}
1603
1604int
1605sys_capset(tcp)
1606struct tcb *tcp;
1607{
Wichert Akkermanc7926982000-04-10 22:22:31 +00001608 static cap_user_header_t arg0 = NULL;
1609 static cap_user_data_t arg1 = NULL;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001610
Wichert Akkermanc7926982000-04-10 22:22:31 +00001611 if(entering(tcp)) {
1612 if (!arg0) {
1613 if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001614 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001615 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001616 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001617 }
1618 }
1619 if (!arg1) {
1620 if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001621 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001622 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001623 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001624 }
1625 }
1626
1627 if (!tcp->u_arg[0])
1628 tprintf("NULL");
1629 else if (!verbose(tcp))
1630 tprintf("%#lx", tcp->u_arg[0]);
1631 else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
1632 tprintf("???");
1633 else {
1634 tprintf("%#x, %d", arg0->version, arg0->pid);
1635 }
1636 tprintf(", ");
1637 if (!tcp->u_arg[1])
1638 tprintf("NULL");
1639 else if (!verbose(tcp))
1640 tprintf("%#lx", tcp->u_arg[1]);
1641 else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
1642 tprintf("???");
1643 else {
1644 tprintf("{");
Roland McGrathb2dee132005-06-01 19:02:36 +00001645 printflags(capabilities, arg1->effective, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001646 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001647 printflags(capabilities, arg1->permitted, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001648 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001649 printflags(capabilities, arg1->inheritable, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001650 tprintf("}");
Roland McGrathced50da2004-08-31 06:48:46 +00001651 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001652 }
1653 return 0;
1654}
1655
1656#else
1657
1658int sys_capget(tcp)
1659struct tcb *tcp;
1660{
1661 return printargs(tcp);
1662}
1663
1664int sys_capset(tcp)
1665struct tcb *tcp;
1666{
1667 return printargs(tcp);
1668}
1669
1670#endif
1671
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001672#ifdef LINUX
Dmitry V. Levin35a55782006-12-04 13:48:10 +00001673/* Linux 2.6.18+ headers removed CTL_PROC enum. */
1674# define CTL_PROC 4
Roland McGrath5eb1aa52007-01-11 22:48:39 +00001675# define CTL_CPU 10 /* older headers lack */
Roland McGrathd9f816f2004-09-04 03:39:20 +00001676static const struct xlat sysctl_root[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001677 { CTL_KERN, "CTL_KERN" },
1678 { CTL_VM, "CTL_VM" },
1679 { CTL_NET, "CTL_NET" },
1680 { CTL_PROC, "CTL_PROC" },
1681 { CTL_FS, "CTL_FS" },
1682 { CTL_DEBUG, "CTL_DEBUG" },
1683 { CTL_DEV, "CTL_DEV" },
Dmitry V. Levin35a55782006-12-04 13:48:10 +00001684 { CTL_BUS, "CTL_BUS" },
1685 { CTL_ABI, "CTL_ABI" },
1686 { CTL_CPU, "CTL_CPU" },
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001687 { 0, NULL }
1688};
1689
Roland McGrathd9f816f2004-09-04 03:39:20 +00001690static const struct xlat sysctl_kern[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001691 { KERN_OSTYPE, "KERN_OSTYPE" },
1692 { KERN_OSRELEASE, "KERN_OSRELEASE" },
1693 { KERN_OSREV, "KERN_OSREV" },
1694 { KERN_VERSION, "KERN_VERSION" },
1695 { KERN_SECUREMASK, "KERN_SECUREMASK" },
1696 { KERN_PROF, "KERN_PROF" },
1697 { KERN_NODENAME, "KERN_NODENAME" },
1698 { KERN_DOMAINNAME, "KERN_DOMAINNAME" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001699#ifdef KERN_SECURELVL
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001700 { KERN_SECURELVL, "KERN_SECURELVL" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001701#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001702 { KERN_PANIC, "KERN_PANIC" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001703#ifdef KERN_REALROOTDEV
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001704 { KERN_REALROOTDEV, "KERN_REALROOTDEV" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001705#endif
1706#ifdef KERN_JAVA_INTERPRETER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001707 { KERN_JAVA_INTERPRETER, "KERN_JAVA_INTERPRETER" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001708#endif
1709#ifdef KERN_JAVA_APPLETVIEWER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001710 { KERN_JAVA_APPLETVIEWER, "KERN_JAVA_APPLETVIEWER" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001711#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001712 { KERN_SPARC_REBOOT, "KERN_SPARC_REBOOT" },
1713 { KERN_CTLALTDEL, "KERN_CTLALTDEL" },
1714 { KERN_PRINTK, "KERN_PRINTK" },
1715 { KERN_NAMETRANS, "KERN_NAMETRANS" },
1716 { KERN_PPC_HTABRECLAIM, "KERN_PPC_HTABRECLAIM" },
1717 { KERN_PPC_ZEROPAGED, "KERN_PPC_ZEROPAGED" },
1718 { KERN_PPC_POWERSAVE_NAP, "KERN_PPC_POWERSAVE_NAP" },
1719 { KERN_MODPROBE, "KERN_MODPROBE" },
1720 { KERN_SG_BIG_BUFF, "KERN_SG_BIG_BUFF" },
1721 { KERN_ACCT, "KERN_ACCT" },
1722 { KERN_PPC_L2CR, "KERN_PPC_L2CR" },
1723 { KERN_RTSIGNR, "KERN_RTSIGNR" },
1724 { KERN_RTSIGMAX, "KERN_RTSIGMAX" },
1725 { KERN_SHMMAX, "KERN_SHMMAX" },
1726 { KERN_MSGMAX, "KERN_MSGMAX" },
1727 { KERN_MSGMNB, "KERN_MSGMNB" },
1728 { KERN_MSGPOOL, "KERN_MSGPOOL" },
1729 { 0, NULL }
1730};
1731
Roland McGrathd9f816f2004-09-04 03:39:20 +00001732static const struct xlat sysctl_vm[] = {
Roland McGratha796fd02004-03-01 22:10:54 +00001733#ifdef VM_SWAPCTL
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001734 { VM_SWAPCTL, "VM_SWAPCTL" },
Roland McGratha796fd02004-03-01 22:10:54 +00001735#endif
1736#ifdef VM_UNUSED1
1737 { VM_UNUSED1, "VM_UNUSED1" },
1738#endif
1739#ifdef VM_SWAPOUT
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001740 { VM_SWAPOUT, "VM_SWAPOUT" },
Roland McGratha796fd02004-03-01 22:10:54 +00001741#endif
1742#ifdef VM_UNUSED2
1743 { VM_UNUSED2, "VM_UNUSED2" },
1744#endif
1745#ifdef VM_FREEPG
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001746 { VM_FREEPG, "VM_FREEPG" },
Roland McGratha796fd02004-03-01 22:10:54 +00001747#endif
1748#ifdef VM_UNUSED3
1749 { VM_UNUSED3, "VM_UNUSED3" },
1750#endif
1751#ifdef VM_BDFLUSH
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001752 { VM_BDFLUSH, "VM_BDFLUSH" },
Roland McGratha796fd02004-03-01 22:10:54 +00001753#endif
1754#ifdef VM_UNUSED4
1755 { VM_UNUSED4, "VM_UNUSED4" },
1756#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001757 { VM_OVERCOMMIT_MEMORY, "VM_OVERCOMMIT_MEMORY" },
Roland McGratha796fd02004-03-01 22:10:54 +00001758#ifdef VM_BUFFERMEM
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001759 { VM_BUFFERMEM, "VM_BUFFERMEM" },
Roland McGratha796fd02004-03-01 22:10:54 +00001760#endif
1761#ifdef VM_UNUSED5
1762 { VM_UNUSED5, "VM_UNUSED5" },
1763#endif
1764#ifdef VM_PAGECACHE
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001765 { VM_PAGECACHE, "VM_PAGECACHE" },
Roland McGratha796fd02004-03-01 22:10:54 +00001766#endif
1767#ifdef VM_UNUSED7
1768 { VM_UNUSED7, "VM_UNUSED7" },
1769#endif
1770#ifdef VM_PAGERDAEMON
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001771 { VM_PAGERDAEMON, "VM_PAGERDAEMON" },
Roland McGratha796fd02004-03-01 22:10:54 +00001772#endif
1773#ifdef VM_UNUSED8
1774 { VM_UNUSED8, "VM_UNUSED8" },
1775#endif
1776#ifdef VM_PGT_CACHE
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001777 { VM_PGT_CACHE, "VM_PGT_CACHE" },
Roland McGratha796fd02004-03-01 22:10:54 +00001778#endif
1779#ifdef VM_UNUSED9
1780 { VM_UNUSED9, "VM_UNUSED9" },
1781#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001782 { VM_PAGE_CLUSTER, "VM_PAGE_CLUSTER" },
1783 { 0, NULL },
1784};
1785
Roland McGrathd9f816f2004-09-04 03:39:20 +00001786static const struct xlat sysctl_net[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001787 { NET_CORE, "NET_CORE" },
1788 { NET_ETHER, "NET_ETHER" },
1789 { NET_802, "NET_802" },
1790 { NET_UNIX, "NET_UNIX" },
1791 { NET_IPV4, "NET_IPV4" },
1792 { NET_IPX, "NET_IPX" },
1793 { NET_ATALK, "NET_ATALK" },
1794 { NET_NETROM, "NET_NETROM" },
1795 { NET_AX25, "NET_AX25" },
1796 { NET_BRIDGE, "NET_BRIDGE" },
1797 { NET_ROSE, "NET_ROSE" },
1798 { NET_IPV6, "NET_IPV6" },
1799 { NET_X25, "NET_X25" },
1800 { NET_TR, "NET_TR" },
1801 { NET_DECNET, "NET_DECNET" },
1802 { 0, NULL }
1803};
1804
Roland McGrathd9f816f2004-09-04 03:39:20 +00001805static const struct xlat sysctl_net_core[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001806 { NET_CORE_WMEM_MAX, "NET_CORE_WMEM_MAX" },
1807 { NET_CORE_RMEM_MAX, "NET_CORE_RMEM_MAX" },
1808 { NET_CORE_WMEM_DEFAULT, "NET_CORE_WMEM_DEFAULT" },
1809 { NET_CORE_RMEM_DEFAULT, "NET_CORE_RMEM_DEFAULT" },
1810 { NET_CORE_MAX_BACKLOG, "NET_CORE_MAX_BACKLOG" },
1811 { NET_CORE_FASTROUTE, "NET_CORE_FASTROUTE" },
1812 { NET_CORE_MSG_COST, "NET_CORE_MSG_COST" },
1813 { NET_CORE_MSG_BURST, "NET_CORE_MSG_BURST" },
1814 { NET_CORE_OPTMEM_MAX, "NET_CORE_OPTMEM_MAX" },
1815 { 0, NULL }
1816};
1817
Roland McGrathd9f816f2004-09-04 03:39:20 +00001818static const struct xlat sysctl_net_unix[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001819 { NET_UNIX_DESTROY_DELAY, "NET_UNIX_DESTROY_DELAY" },
1820 { NET_UNIX_DELETE_DELAY, "NET_UNIX_DELETE_DELAY" },
1821 { 0, NULL }
1822};
1823
Roland McGrathd9f816f2004-09-04 03:39:20 +00001824static const struct xlat sysctl_net_ipv4[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001825 { NET_IPV4_FORWARD, "NET_IPV4_FORWARD" },
1826 { NET_IPV4_DYNADDR, "NET_IPV4_DYNADDR" },
1827 { NET_IPV4_CONF, "NET_IPV4_CONF" },
1828 { NET_IPV4_NEIGH, "NET_IPV4_NEIGH" },
1829 { NET_IPV4_ROUTE, "NET_IPV4_ROUTE" },
1830 { NET_IPV4_FIB_HASH, "NET_IPV4_FIB_HASH" },
1831 { NET_IPV4_TCP_TIMESTAMPS, "NET_IPV4_TCP_TIMESTAMPS" },
1832 { NET_IPV4_TCP_WINDOW_SCALING, "NET_IPV4_TCP_WINDOW_SCALING" },
1833 { NET_IPV4_TCP_SACK, "NET_IPV4_TCP_SACK" },
1834 { NET_IPV4_TCP_RETRANS_COLLAPSE, "NET_IPV4_TCP_RETRANS_COLLAPSE" },
1835 { NET_IPV4_DEFAULT_TTL, "NET_IPV4_DEFAULT_TTL" },
1836 { NET_IPV4_AUTOCONFIG, "NET_IPV4_AUTOCONFIG" },
1837 { NET_IPV4_NO_PMTU_DISC, "NET_IPV4_NO_PMTU_DISC" },
1838 { NET_IPV4_TCP_SYN_RETRIES, "NET_IPV4_TCP_SYN_RETRIES" },
1839 { NET_IPV4_IPFRAG_HIGH_THRESH, "NET_IPV4_IPFRAG_HIGH_THRESH" },
1840 { NET_IPV4_IPFRAG_LOW_THRESH, "NET_IPV4_IPFRAG_LOW_THRESH" },
1841 { NET_IPV4_IPFRAG_TIME, "NET_IPV4_IPFRAG_TIME" },
1842 { NET_IPV4_TCP_MAX_KA_PROBES, "NET_IPV4_TCP_MAX_KA_PROBES" },
1843 { NET_IPV4_TCP_KEEPALIVE_TIME, "NET_IPV4_TCP_KEEPALIVE_TIME" },
1844 { NET_IPV4_TCP_KEEPALIVE_PROBES, "NET_IPV4_TCP_KEEPALIVE_PROBES" },
1845 { NET_IPV4_TCP_RETRIES1, "NET_IPV4_TCP_RETRIES1" },
1846 { NET_IPV4_TCP_RETRIES2, "NET_IPV4_TCP_RETRIES2" },
1847 { NET_IPV4_TCP_FIN_TIMEOUT, "NET_IPV4_TCP_FIN_TIMEOUT" },
1848 { NET_IPV4_IP_MASQ_DEBUG, "NET_IPV4_IP_MASQ_DEBUG" },
1849 { NET_TCP_SYNCOOKIES, "NET_TCP_SYNCOOKIES" },
1850 { NET_TCP_STDURG, "NET_TCP_STDURG" },
1851 { NET_TCP_RFC1337, "NET_TCP_RFC1337" },
1852 { NET_TCP_SYN_TAILDROP, "NET_TCP_SYN_TAILDROP" },
1853 { NET_TCP_MAX_SYN_BACKLOG, "NET_TCP_MAX_SYN_BACKLOG" },
1854 { NET_IPV4_LOCAL_PORT_RANGE, "NET_IPV4_LOCAL_PORT_RANGE" },
1855 { NET_IPV4_ICMP_ECHO_IGNORE_ALL, "NET_IPV4_ICMP_ECHO_IGNORE_ALL" },
1856 { NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS" },
1857 { NET_IPV4_ICMP_SOURCEQUENCH_RATE, "NET_IPV4_ICMP_SOURCEQUENCH_RATE" },
1858 { NET_IPV4_ICMP_DESTUNREACH_RATE, "NET_IPV4_ICMP_DESTUNREACH_RATE" },
1859 { NET_IPV4_ICMP_TIMEEXCEED_RATE, "NET_IPV4_ICMP_TIMEEXCEED_RATE" },
1860 { NET_IPV4_ICMP_PARAMPROB_RATE, "NET_IPV4_ICMP_PARAMPROB_RATE" },
1861 { NET_IPV4_ICMP_ECHOREPLY_RATE, "NET_IPV4_ICMP_ECHOREPLY_RATE" },
1862 { NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES" },
1863 { NET_IPV4_IGMP_MAX_MEMBERSHIPS, "NET_IPV4_IGMP_MAX_MEMBERSHIPS" },
1864 { 0, NULL }
1865};
1866
Roland McGrathd9f816f2004-09-04 03:39:20 +00001867static const struct xlat sysctl_net_ipv4_route[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001868 { NET_IPV4_ROUTE_FLUSH, "NET_IPV4_ROUTE_FLUSH" },
1869 { NET_IPV4_ROUTE_MIN_DELAY, "NET_IPV4_ROUTE_MIN_DELAY" },
1870 { NET_IPV4_ROUTE_MAX_DELAY, "NET_IPV4_ROUTE_MAX_DELAY" },
1871 { NET_IPV4_ROUTE_GC_THRESH, "NET_IPV4_ROUTE_GC_THRESH" },
1872 { NET_IPV4_ROUTE_MAX_SIZE, "NET_IPV4_ROUTE_MAX_SIZE" },
1873 { NET_IPV4_ROUTE_GC_MIN_INTERVAL, "NET_IPV4_ROUTE_GC_MIN_INTERVAL" },
1874 { NET_IPV4_ROUTE_GC_TIMEOUT, "NET_IPV4_ROUTE_GC_TIMEOUT" },
1875 { NET_IPV4_ROUTE_GC_INTERVAL, "NET_IPV4_ROUTE_GC_INTERVAL" },
1876 { NET_IPV4_ROUTE_REDIRECT_LOAD, "NET_IPV4_ROUTE_REDIRECT_LOAD" },
1877 { NET_IPV4_ROUTE_REDIRECT_NUMBER, "NET_IPV4_ROUTE_REDIRECT_NUMBER" },
1878 { NET_IPV4_ROUTE_REDIRECT_SILENCE, "NET_IPV4_ROUTE_REDIRECT_SILENCE" },
1879 { NET_IPV4_ROUTE_ERROR_COST, "NET_IPV4_ROUTE_ERROR_COST" },
1880 { NET_IPV4_ROUTE_ERROR_BURST, "NET_IPV4_ROUTE_ERROR_BURST" },
1881 { NET_IPV4_ROUTE_GC_ELASTICITY, "NET_IPV4_ROUTE_GC_ELASTICITY" },
1882 { 0, NULL }
1883};
1884
Roland McGrathd9f816f2004-09-04 03:39:20 +00001885static const struct xlat sysctl_net_ipv4_conf[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001886 { NET_IPV4_CONF_FORWARDING, "NET_IPV4_CONF_FORWARDING" },
1887 { NET_IPV4_CONF_MC_FORWARDING, "NET_IPV4_CONF_MC_FORWARDING" },
1888 { NET_IPV4_CONF_PROXY_ARP, "NET_IPV4_CONF_PROXY_ARP" },
1889 { NET_IPV4_CONF_ACCEPT_REDIRECTS, "NET_IPV4_CONF_ACCEPT_REDIRECTS" },
1890 { NET_IPV4_CONF_SECURE_REDIRECTS, "NET_IPV4_CONF_SECURE_REDIRECTS" },
1891 { NET_IPV4_CONF_SEND_REDIRECTS, "NET_IPV4_CONF_SEND_REDIRECTS" },
1892 { NET_IPV4_CONF_SHARED_MEDIA, "NET_IPV4_CONF_SHARED_MEDIA" },
1893 { NET_IPV4_CONF_RP_FILTER, "NET_IPV4_CONF_RP_FILTER" },
1894 { NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, "NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE" },
1895 { NET_IPV4_CONF_BOOTP_RELAY, "NET_IPV4_CONF_BOOTP_RELAY" },
1896 { NET_IPV4_CONF_LOG_MARTIANS, "NET_IPV4_CONF_LOG_MARTIANS" },
1897 { 0, NULL }
1898};
1899
Roland McGrathd9f816f2004-09-04 03:39:20 +00001900static const struct xlat sysctl_net_ipv6[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001901 { NET_IPV6_CONF, "NET_IPV6_CONF" },
1902 { NET_IPV6_NEIGH, "NET_IPV6_NEIGH" },
1903 { NET_IPV6_ROUTE, "NET_IPV6_ROUTE" },
1904 { 0, NULL }
1905};
1906
Roland McGrathd9f816f2004-09-04 03:39:20 +00001907static const struct xlat sysctl_net_ipv6_route[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001908 { NET_IPV6_ROUTE_FLUSH, "NET_IPV6_ROUTE_FLUSH" },
1909 { NET_IPV6_ROUTE_GC_THRESH, "NET_IPV6_ROUTE_GC_THRESH" },
1910 { NET_IPV6_ROUTE_MAX_SIZE, "NET_IPV6_ROUTE_MAX_SIZE" },
1911 { NET_IPV6_ROUTE_GC_MIN_INTERVAL, "NET_IPV6_ROUTE_GC_MIN_INTERVAL" },
1912 { NET_IPV6_ROUTE_GC_TIMEOUT, "NET_IPV6_ROUTE_GC_TIMEOUT" },
1913 { NET_IPV6_ROUTE_GC_INTERVAL, "NET_IPV6_ROUTE_GC_INTERVAL" },
1914 { NET_IPV6_ROUTE_GC_ELASTICITY, "NET_IPV6_ROUTE_GC_ELASTICITY" },
1915 { 0, NULL }
1916};
1917
1918int
1919sys_sysctl(tcp)
1920struct tcb *tcp;
1921{
1922 struct __sysctl_args info;
1923 int *name;
Roland McGrathaa524c82005-06-01 19:22:06 +00001924 unsigned long size;
1925
Roland McGrath2cbe44e2005-05-26 23:21:09 +00001926 if (umove (tcp, tcp->u_arg[0], &info) < 0)
1927 return printargs(tcp);
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001928
Roland McGrathaa524c82005-06-01 19:22:06 +00001929 size = sizeof (int) * (unsigned long) info.nlen;
1930 name = (size / sizeof (int) != info.nlen) ? NULL : malloc (size);
Roland McGrath2cbe44e2005-05-26 23:21:09 +00001931 if (name == NULL ||
Roland McGrathaa524c82005-06-01 19:22:06 +00001932 umoven(tcp, (unsigned long) info.name, size, (char *) name) < 0) {
1933 free(name);
1934 if (entering(tcp))
1935 tprintf("{%p, %d, %p, %p, %p, %Zu}",
1936 info.name, info.nlen, info.oldval,
1937 info.oldlenp, info.newval, info.newlen);
Roland McGrath2cbe44e2005-05-26 23:21:09 +00001938 return 0;
1939 }
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001940
1941 if (entering(tcp)) {
Roland McGrathaa524c82005-06-01 19:22:06 +00001942 int cnt = 0, max_cnt;
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001943
1944 tprintf("{{");
1945
1946 if (info.nlen == 0)
1947 goto out;
1948 printxval(sysctl_root, name[0], "CTL_???");
1949 ++cnt;
1950
1951 if (info.nlen == 1)
1952 goto out;
1953 switch (name[0]) {
1954 case CTL_KERN:
1955 tprintf(", ");
1956 printxval(sysctl_kern, name[1], "KERN_???");
1957 ++cnt;
1958 break;
1959 case CTL_VM:
1960 tprintf(", ");
1961 printxval(sysctl_vm, name[1], "VM_???");
1962 ++cnt;
1963 break;
1964 case CTL_NET:
1965 tprintf(", ");
1966 printxval(sysctl_net, name[1], "NET_???");
1967 ++cnt;
1968
1969 if (info.nlen == 2)
1970 goto out;
1971 switch (name[1]) {
1972 case NET_CORE:
1973 tprintf(", ");
1974 printxval(sysctl_net_core, name[2],
1975 "NET_CORE_???");
1976 break;
1977 case NET_UNIX:
1978 tprintf(", ");
1979 printxval(sysctl_net_unix, name[2],
1980 "NET_UNIX_???");
1981 break;
1982 case NET_IPV4:
1983 tprintf(", ");
1984 printxval(sysctl_net_ipv4, name[2],
1985 "NET_IPV4_???");
1986
1987 if (info.nlen == 3)
1988 goto out;
1989 switch (name[2]) {
1990 case NET_IPV4_ROUTE:
1991 tprintf(", ");
1992 printxval(sysctl_net_ipv4_route,
1993 name[3],
1994 "NET_IPV4_ROUTE_???");
1995 break;
1996 case NET_IPV4_CONF:
1997 tprintf(", ");
1998 printxval(sysctl_net_ipv4_conf,
1999 name[3],
2000 "NET_IPV4_CONF_???");
2001 break;
2002 default:
2003 goto out;
2004 }
2005 break;
2006 case NET_IPV6:
2007 tprintf(", ");
2008 printxval(sysctl_net_ipv6, name[2],
2009 "NET_IPV6_???");
2010
2011 if (info.nlen == 3)
2012 goto out;
2013 switch (name[2]) {
2014 case NET_IPV6_ROUTE:
2015 tprintf(", ");
2016 printxval(sysctl_net_ipv6_route,
2017 name[3],
2018 "NET_IPV6_ROUTE_???");
2019 break;
2020 default:
2021 goto out;
2022 }
2023 break;
2024 default:
2025 goto out;
2026 }
2027 break;
2028 default:
2029 goto out;
2030 }
2031 out:
Roland McGrath8e4a3e62006-01-12 11:03:46 +00002032 max_cnt = info.nlen;
2033 if (abbrev(tcp) && max_cnt > max_strlen)
2034 max_cnt = max_strlen;
Roland McGrathaa524c82005-06-01 19:22:06 +00002035 while (cnt < max_cnt)
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002036 tprintf(", %x", name[cnt++]);
Roland McGrathaa524c82005-06-01 19:22:06 +00002037 if (cnt < info.nlen)
2038 tprintf(", ...");
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002039 tprintf("}, %d, ", info.nlen);
2040 } else {
2041 size_t oldlen;
Roland McGrathaa524c82005-06-01 19:22:06 +00002042 if (umove(tcp, (size_t)info.oldlenp, &oldlen) >= 0
2043 && info.nlen >= 2
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002044 && ((name[0] == CTL_KERN
2045 && (name[1] == KERN_OSRELEASE
2046 || name[1] == KERN_OSTYPE
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00002047#ifdef KERN_JAVA_INTERPRETER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002048 || name[1] == KERN_JAVA_INTERPRETER
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00002049#endif
2050#ifdef KERN_JAVA_APPLETVIEWER
2051 || name[1] == KERN_JAVA_APPLETVIEWER
2052#endif
2053 )))) {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002054 printpath(tcp, (size_t)info.oldval);
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +00002055 tprintf(", %Zu, ", oldlen);
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002056 if (info.newval == 0)
2057 tprintf("NULL");
2058 else if (syserror(tcp))
2059 tprintf("%p", info.newval);
2060 else
2061 printpath(tcp, (size_t)info.newval);
2062 tprintf(", %Zd", info.newlen);
2063 } else {
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +00002064 tprintf("%p, %Zd, %p, %Zd", info.oldval, oldlen,
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002065 info.newval, info.newlen);
2066 }
2067 tprintf("}");
2068 }
Roland McGrath2cbe44e2005-05-26 23:21:09 +00002069
2070 free(name);
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002071 return 0;
2072}
2073#else
2074int sys_sysctl(tcp)
2075struct tcb *tcp;
2076{
2077 return printargs(tcp);
2078}
2079#endif
2080
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00002081#ifdef FREEBSD
2082#include <sys/sysctl.h>
2083
2084int sys___sysctl(tcp)
2085struct tcb *tcp;
2086{
2087 int qoid[CTL_MAXNAME+2];
2088 char ctl[1024];
2089 size_t len;
2090 int i, numeric;
Roland McGrathced50da2004-08-31 06:48:46 +00002091
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00002092 if (entering(tcp)) {
2093 if (tcp->u_arg[1] < 0 || tcp->u_arg[1] > CTL_MAXNAME ||
2094 (umoven(tcp, tcp->u_arg[0], tcp->u_arg[1] * sizeof(int),
2095 (char *) (qoid + 2)) < 0))
2096 tprintf("[...], ");
2097 else {
2098 /* Use sysctl to ask the name of the current MIB
2099 This uses the undocumented "Staff-functions" used
2100 by the sysctl program. See kern_sysctl.c for
2101 details. */
2102 qoid[0] = 0; /* sysctl */
2103 qoid[1] = 1; /* name */
2104 i = sizeof(ctl);
2105 tprintf("[");
2106 if (sysctl(qoid, tcp->u_arg[1] + 2, ctl, &i, 0, 0) >= 0) {
2107 numeric = !abbrev(tcp);
2108 tprintf("%s%s", ctl, numeric ? ", " : "");
2109 } else
2110 numeric = 1;
2111 if (numeric) {
2112 for (i = 0; i < tcp->u_arg[1]; i++)
2113 tprintf("%s%d", i ? "." : "", qoid[i + 2]);
2114 }
2115 tprintf("], ");
2116 tprintf("%lu, ", tcp->u_arg[1]);
2117 }
2118 } else {
2119 if (!syserror(tcp) && (umove(tcp, tcp->u_arg[3], &len) >= 0)) {
2120 printstr(tcp, tcp->u_arg[2], len);
2121 tprintf(", [%u], ", len);
Roland McGrathced50da2004-08-31 06:48:46 +00002122 } else
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00002123 tprintf("%#lx, %#lx, ", tcp->u_arg[2], tcp->u_arg[3]);
2124 printstr(tcp, tcp->u_arg[4], tcp->u_arg[5]);
2125 tprintf(", %lu", tcp->u_arg[5]);
2126 }
2127 return 0;
2128}
2129#endif
Wichert Akkerman16a03d22000-08-10 02:14:04 +00002130
2131#if UNIXWARE >= 2
2132
2133#include <sys/ksym.h>
2134#include <sys/elf.h>
2135
Roland McGrathd9f816f2004-09-04 03:39:20 +00002136static const struct xlat ksym_flags[] = {
Roland McGrathced50da2004-08-31 06:48:46 +00002137 { STT_NOTYPE, "STT_NOTYPE" },
2138 { STT_FUNC, "STT_FUNC" },
2139 { STT_OBJECT, "STT_OBJECT" },
Wichert Akkerman16a03d22000-08-10 02:14:04 +00002140 { 0, NULL },
2141};
2142
2143int
2144sys_getksym(tcp)
2145struct tcb *tcp;
2146{
2147 if (entering (tcp)) {
2148 printstr(tcp, tcp->u_arg[0], -1);
2149 tprintf(", ");
2150 }
2151 else {
2152 if (syserror(tcp)) {
2153 tprintf("%#lx, %#lx",
2154 tcp->u_arg[1], tcp->u_arg[2]);
2155 }
2156 else {
2157 int val;
2158 printnum (tcp, tcp->u_arg[1], "%#lx");
2159 tprintf(", ");
2160 if (umove(tcp, tcp->u_arg[2], &val) < 0) {
2161 tprintf("%#lx", tcp->u_arg[2]);
2162 }
2163 else {
2164 tprintf("[");
2165 printxval (ksym_flags, val, "STT_???");
2166 tprintf("]");
2167 }
2168 }
2169 }
2170
2171 return 0;
2172}
2173
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002174#ifdef HAVE_SYS_NSCSYS_H
John Hughes4e36a812001-04-18 15:11:51 +00002175
John Hughes0aadba42001-10-16 18:19:52 +00002176struct cred;
John Hughes4e36a812001-04-18 15:11:51 +00002177#include <sys/nscsys.h>
2178
Roland McGrathd9f816f2004-09-04 03:39:20 +00002179static const struct xlat ssi_cmd [] = {
John Hughes4e36a812001-04-18 15:11:51 +00002180 { SSISYS_BADOP, "SSISYS_BADOP" },
2181 { SSISYS_LDLVL_INIT,"SSISYS_LDLVL_INIT"},
2182 { SSISYS_LDLVL_GETVEC,"SSISYS_LDLVL_GETVEC"},
2183 { SSISYS_LDLVL_PUTVEC,"SSISYS_LDLVL_PUTVEC"},
2184 { SSISYS_LDLVL_PUTRCMDS,"SSISYS_LDLVL_PUTRCMDS"},
2185 { SSISYS_LDLVL_SETREXEC,"SSISYS_LDLVL_SETREXEC"},
2186 { SSISYS_CMS_CLUSTERID,"SSISYS_CMS_CLUSTERID"},
2187 { SSISYS_CFS_STATVFS,"SSISYS_CFS_STATVFS"},
2188 { SSISYS_NODE_GETNUM,"SSISYS_NODE_GETNUM"},
2189 { SSISYS_NODE_TABLE,"SSISYS_NODE_TABLE"},
2190 { SSISYS_NODE_DOWN,"SSISYS_NODE_DOWN"},
2191 { SSISYS_RECLAIM_CHILD,"SSISYS_RECLAIM_CHILD"},
2192 { SSISYS_IPC_GETINFO,"SSISYS_IPC_GETINFO"},
2193 { SSISYS_ICS_TEST,"SSISYS_ICS_TEST"},
2194 { SSISYS_NODE_PID,"SSISYS_NODE_PID"},
2195 { SSISYS_ISLOCAL,"SSISYS_ISLOCAL"},
2196 { SSISYS_CFS_ISSTACKED,"SSISYS_CFS_ISSTACKED"},
2197 { SSISYS_DNET_SYNC,"SSISYS_DNET_SYNC"},
2198 { SSISYS_CFS_WAIT_MODE,"SSISYS_CFS_WAIT_MODE"},
2199 { SSISYS_CFS_UMOUNT,"SSISYS_CFS_UMOUNT"},
2200 { SSISYS_LLSTAT,"SSISYS_LLSTAT" },
2201 { SSISYS_LTS_PERFTEST,"SSISYS_LTS_PERFTEST"},
2202 { SSISYS_LTS_CONFIG,"SSISYS_LTS_CONFIG"},
2203 { SSISYS_SNET_PERFTEST,"SSISYS_SNET_PERFTEST"},
2204 { SSISYS_IGNORE_HALFUP,"SSISYS_IGNORE_HALFUP"},
2205 { SSISYS_NODE_ROOTDEV,"SSISYS_NODE_ROOTDEV"},
2206 { SSISYS_GET_PRIMARY,"SSISYS_GET_PRIMARY"},
2207 { SSISYS_GET_SECONDARY,"SSISYS_GET_SECONDARY"},
2208 { SSISYS_GET_ROOTDISK,"SSISYS_GET_ROOTDISK"},
2209 { SSISYS_CLUSTERNODE_NUM,"SSISYS_CLUSTERNODE_NUM"},
2210 { SSISYS_CLUSTER_MEMBERSHIP,"SSISYS_CLUSTER_MEMBERSHIP"},
2211 { SSISYS_CLUSTER_DETAILEDTRANS,"SSISYS_CLUSTER_DETAILEDTRANS"},
2212 { SSISYS_CLUSTERNODE_INFO,"SSISYS_CLUSTERNODE_INFO"},
2213 { SSISYS_CLUSTERNODE_SETINFO,"SSISYS_CLUSTERNODE_SETINFO"},
2214 { SSISYS_CLUSTERNODE_AVAIL,"SSISYS_CLUSTERNODE_AVAIL"},
2215 { SSISYS_CLUSTER_MAXNODES,"SSISYS_CLUSTER_MAXNODES"},
2216 { SSISYS_SET_MEMPRIO,"SSISYS_SET_MEMPRIO"},
2217 { SSISYS_GET_USERS,"SSISYS_GET_USERS"},
2218 { SSISYS_FORCE_ROOT_NODE,"SSISYS_FORCE_ROOT_NODE"},
2219 { SSISYS_CVIP_SET,"SSISYS_CVIP_SET"},
2220 { SSISYS_CVIP_GET,"SSISYS_CVIP_GET"},
2221 { SSISYS_GET_NODE_COUNTS,"SSISYS_GET_NODE_COUNTS"},
2222 { SSISYS_GET_TRANSPORT,"SSISYS_GET_TRANSPORT"},
2223 { 0, NULL },
2224};
2225
2226int sys_ssisys (tcp)
2227struct tcb *tcp;
2228{
2229 struct ssisys_iovec iov;
John Hughes2d8b2c52001-10-18 14:52:24 +00002230 cls_nodeinfo_args_t cni;
2231 clusternode_info_t info;
2232
John Hughes4e36a812001-04-18 15:11:51 +00002233 if (entering (tcp)) {
John Hughes0aadba42001-10-16 18:19:52 +00002234 ts_reclaim_child_inargs_t trc;
John Hughes4e36a812001-04-18 15:11:51 +00002235 if (tcp->u_arg[1] != sizeof iov ||
2236 umove (tcp, tcp->u_arg[0], &iov) < 0)
2237 {
2238 tprintf ("%#lx, %ld", tcp->u_arg[0], tcp->u_arg[1]);
2239 return 0;
2240 }
2241 tprintf ("{id=");
2242 printxval(ssi_cmd, iov.tio_id.id_cmd, "SSISYS_???");
2243 tprintf (":%d", iov.tio_id.id_ver);
2244 switch (iov.tio_id.id_cmd) {
John Hughes0aadba42001-10-16 18:19:52 +00002245 case SSISYS_RECLAIM_CHILD:
2246 if (iov.tio_udatainlen != sizeof trc ||
2247 umove (tcp, (long) iov.tio_udatain, &trc) < 0)
2248 goto bad;
2249 tprintf (", in={pid=%ld, start=%ld}",
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002250 trc.trc_pid, trc.trc_start);
John Hughes0aadba42001-10-16 18:19:52 +00002251 break;
2252 case SSISYS_CLUSTERNODE_INFO:
2253 if (iov.tio_udatainlen != sizeof cni ||
2254 umove (tcp, (long) iov.tio_udatain, &cni) < 0)
2255 goto bad;
2256 tprintf (", in={node=%ld, len=%d}",
2257 cni.nodenum, cni.info_len);
2258 break;
John Hughes4e36a812001-04-18 15:11:51 +00002259 default:
John Hughes0aadba42001-10-16 18:19:52 +00002260 bad:
John Hughes4e36a812001-04-18 15:11:51 +00002261 if (iov.tio_udatainlen) {
2262 tprintf (", in=[/* %d bytes */]",
2263 iov.tio_udatainlen);
2264 }
2265 }
2266 }
2267 else {
John Hughes2d8b2c52001-10-18 14:52:24 +00002268 if (tcp->u_arg[1] != sizeof iov ||
2269 umove (tcp, tcp->u_arg[0], &iov) < 0)
2270 goto done;
John Hughes4e36a812001-04-18 15:11:51 +00002271 switch (iov.tio_id.id_cmd) {
John Hughes2d8b2c52001-10-18 14:52:24 +00002272 case SSISYS_CLUSTERNODE_INFO:
2273 if (iov.tio_udatainlen != sizeof cni ||
2274 umove (tcp, (long) iov.tio_udatain, &cni) < 0)
2275 goto bad_out;
Roland McGrathced50da2004-08-31 06:48:46 +00002276 if (cni.info_len != sizeof info ||
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002277 iov.tio_udataoutlen != sizeof &info ||
John Hughes2d8b2c52001-10-18 14:52:24 +00002278 umove (tcp, (long) iov.tio_udataout, &info) < 0)
2279 goto bad_out;
2280 tprintf (", out={node=%ld, cpus=%d, online=%d}",
2281 info.node_num, info.node_totalcpus,
2282 info.node_onlinecpus);
2283 break;
Roland McGrathced50da2004-08-31 06:48:46 +00002284
John Hughes4e36a812001-04-18 15:11:51 +00002285 default:
John Hughes2d8b2c52001-10-18 14:52:24 +00002286 bad_out:
John Hughes4e36a812001-04-18 15:11:51 +00002287 if (iov.tio_udataoutlen) {
2288 tprintf (", out=[/* %d bytes */]",
2289 iov.tio_udataoutlen);
2290 }
2291 }
John Hughes2d8b2c52001-10-18 14:52:24 +00002292 done:
John Hughes4e36a812001-04-18 15:11:51 +00002293 tprintf ("}, %ld", tcp->u_arg[1]);
2294 }
2295 return 0;
2296}
2297
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002298#endif
John Hughes4e36a812001-04-18 15:11:51 +00002299
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002300#endif /* UNIXWARE > 2 */
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002301
2302#ifdef MIPS
2303
Wichert Akkermand6b92492001-04-07 21:37:12 +00002304#ifndef __NEW_UTS_LEN
2305#define __NEW_UTS_LEN 64
2306#endif
2307
Roland McGrathd9f816f2004-09-04 03:39:20 +00002308static const struct xlat sysmips_operations[] = {
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002309 { SETNAME, "SETNAME" },
2310 { FLUSH_CACHE, "FLUSH_CACHE" },
2311 { MIPS_FIXADE, "MIPS_FIXADE" },
2312 { MIPS_RDNVRAM, "MIPS_RDNVRAM" },
2313 { MIPS_ATOMIC_SET, "MIPS_ATOMIC_SET" },
2314 { 0, NULL }
2315};
2316
2317int sys_sysmips(tcp)
2318struct tcb *tcp;
2319{
2320 if (entering(tcp)) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002321 printxval(sysmips_operations, tcp->u_arg[0], "???");
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002322 if (!verbose(tcp)) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002323 tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002324 } else if (tcp->u_arg[0]==SETNAME) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002325 char nodename[__NEW_UTS_LEN + 1];
2326 if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), nodename) < 0)
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002327 tprintf(", %#lx", tcp->u_arg[1]);
2328 else
2329 tprintf(", \"%s\"", nodename);
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002330 } else if (tcp->u_arg[0] == MIPS_ATOMIC_SET) {
2331 tprintf(", %#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]);
2332 } else if (tcp->u_arg[0] == MIPS_FIXADE) {
2333 tprintf(", 0x%lx", tcp->u_arg[1]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002334 } else {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002335 tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002336 }
2337 }
2338
2339 return 0;
2340}
2341
2342#endif /* MIPS */