blob: f0641c30236b903595ce487da815d287e4f6a503 [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
Carmelo AMOROSOf8e56502010-12-01 14:27:07 +0100346#ifdef SH
347static const struct xlat cacheflush_flags[] = {
348#ifdef CACHEFLUSH_D_INVAL
349 { CACHEFLUSH_D_INVAL, "CACHEFLUSH_D_INVAL" },
350#endif
351#ifdef CACHEFLUSH_D_WB
352 { CACHEFLUSH_D_WB, "CACHEFLUSH_D_WB" },
353#endif
354#ifdef CACHEFLUSH_D_PURGE
355 { CACHEFLUSH_D_PURGE, "CACHEFLUSH_D_PURGE" },
356#endif
357#ifdef CACHEFLUSH_I
358 { CACHEFLUSH_I, "CACHEFLUSH_I" },
359#endif
360 { 0, NULL },
361};
362
363int
364sys_cacheflush(struct tcb *tcp)
365{
366 if (entering(tcp)) {
367 /* addr */
368 tprintf("%#lx, ", tcp->u_arg[0]);
369 /* len */
370 tprintf("%lu, ", tcp->u_arg[1]);
371 /* flags */
372 printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???");
373 }
374 return 0;
375}
376#endif /* SH */
377
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000378#endif /* LINUX */
379
380#ifdef SUNOS4
381
382#include <sys/reboot.h>
383#define NFSCLIENT
384#define LOFS
385#define RFS
386#define PCFS
387#include <sys/mount.h>
388#include <sys/socket.h>
389#include <nfs/export.h>
390#include <rpc/types.h>
391#include <rpc/auth.h>
392
393/*ARGSUSED*/
394int
395sys_sync(tcp)
396struct tcb *tcp;
397{
398 return 0;
399}
400
Roland McGrathd9f816f2004-09-04 03:39:20 +0000401static const struct xlat bootflags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000402 { RB_AUTOBOOT, "RB_AUTOBOOT" }, /* for system auto-booting itself */
403 { RB_ASKNAME, "RB_ASKNAME" }, /* ask for file name to reboot from */
404 { RB_SINGLE, "RB_SINGLE" }, /* reboot to single user only */
405 { RB_NOSYNC, "RB_NOSYNC" }, /* dont sync before reboot */
406 { RB_HALT, "RB_HALT" }, /* don't reboot, just halt */
407 { RB_INITNAME, "RB_INITNAME" }, /* name given for /etc/init */
408 { RB_NOBOOTRC, "RB_NOBOOTRC" }, /* don't run /etc/rc.boot */
409 { RB_DEBUG, "RB_DEBUG" }, /* being run under debugger */
410 { RB_DUMP, "RB_DUMP" }, /* dump system core */
411 { RB_WRITABLE, "RB_WRITABLE" }, /* mount root read/write */
412 { RB_STRING, "RB_STRING" }, /* pass boot args to prom monitor */
413 { 0, NULL },
414};
415
416int
417sys_reboot(tcp)
418struct tcb *tcp;
419{
420 if (entering(tcp)) {
Roland McGrathb2dee132005-06-01 19:02:36 +0000421 printflags(bootflags, tcp->u_arg[0], "RB_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000422 if (tcp->u_arg[0] & RB_STRING) {
423 printstr(tcp, tcp->u_arg[1], -1);
424 }
425 }
426 return 0;
427}
428
429int
430sys_sysacct(tcp)
431struct tcb *tcp;
432{
433 if (entering(tcp)) {
434 printstr(tcp, tcp->u_arg[0], -1);
435 }
436 return 0;
437}
438
439int
440sys_swapon(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_nfs_svc(tcp)
451struct tcb *tcp;
452{
453 if (entering(tcp)) {
454 printsock(tcp, tcp->u_arg[0]);
455 }
456 return 0;
457}
458
Roland McGrathd9f816f2004-09-04 03:39:20 +0000459static const struct xlat mountflags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000460 { M_RDONLY, "M_RDONLY" },
461 { M_NOSUID, "M_NOSUID" },
462 { M_NEWTYPE, "M_NEWTYPE" },
463 { M_GRPID, "M_GRPID" },
464#ifdef M_REMOUNT
465 { M_REMOUNT, "M_REMOUNT" },
466#endif
467#ifdef M_NOSUB
468 { M_NOSUB, "M_NOSUB" },
469#endif
470#ifdef M_MULTI
471 { M_MULTI, "M_MULTI" },
472#endif
473#ifdef M_SYS5
474 { M_SYS5, "M_SYS5" },
475#endif
476 { 0, NULL },
477};
478
Roland McGrathd9f816f2004-09-04 03:39:20 +0000479static const struct xlat nfsflags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000480 { NFSMNT_SOFT, "NFSMNT_SOFT" },
481 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
482 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
483 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
484 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
485 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
486 { NFSMNT_INT, "NFSMNT_INT" },
487 { NFSMNT_NOAC, "NFSMNT_NOAC" },
488 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
489 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
490 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
491 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
492#ifdef NFSMNT_SECURE
493 { NFSMNT_SECURE, "NFSMNT_SECURE" },
494#endif
495#ifdef NFSMNT_NOCTO
496 { NFSMNT_NOCTO, "NFSMNT_NOCTO" },
497#endif
498#ifdef NFSMNT_POSIX
499 { NFSMNT_POSIX, "NFSMNT_POSIX" },
500#endif
501 { 0, NULL },
502};
503
504int
505sys_mount(tcp)
506struct tcb *tcp;
507{
508 char type[4];
509
510 if (entering(tcp)) {
511 if (!(tcp->u_arg[2] & M_NEWTYPE) || umovestr(tcp,
512 tcp->u_arg[0], sizeof type, type) < 0) {
513 tprintf("OLDTYPE:#%lx", tcp->u_arg[0]);
514 } else {
515 tprintf("\"%s\", ", type);
516 }
517 printstr(tcp, tcp->u_arg[1], -1);
518 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000519 printflags(mountflags, tcp->u_arg[2] & ~M_NEWTYPE, "M_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000520 tprintf(", ");
521
522 if (strcmp(type, "4.2") == 0) {
523 struct ufs_args a;
524 if (umove(tcp, tcp->u_arg[3], &a) < 0)
525 return 0;
526 printstr(tcp, (int)a.fspec, -1);
527 } else if (strcmp(type, "lo") == 0) {
528 struct lo_args a;
529 if (umove(tcp, tcp->u_arg[3], &a) < 0)
530 return 0;
531 printstr(tcp, (int)a.fsdir, -1);
532 } else if (strcmp(type, "nfs") == 0) {
533 struct nfs_args a;
534 if (umove(tcp, tcp->u_arg[3], &a) < 0)
535 return 0;
536 tprintf("[");
537 printsock(tcp, (int) a.addr);
538 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000539 printflags(nfsflags, a.flags, "NFSMNT_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000540 tprintf(", ws:%u,rs:%u,to:%u,re:%u,",
541 a.wsize, a.rsize, a.timeo, a.retrans);
542 if (a.flags & NFSMNT_HOSTNAME && a.hostname)
543 printstr(tcp, (int)a.hostname, -1);
544 else
545 tprintf("%#lx", (unsigned long) a.hostname);
546 tprintf(",reg-min:%u,max:%u,dir-min:%u,max:%u,",
547 a.acregmin, a.acregmax, a.acdirmin, a.acdirmax);
548 if ((a.flags & NFSMNT_SECURE) && a.netname)
549 printstr(tcp, (int) a.netname, -1);
550 else
551 tprintf("%#lx", (unsigned long) a.netname);
552 tprintf("]");
553 } else if (strcmp(type, "rfs") == 0) {
554 struct rfs_args a;
555 struct token t;
556 if (umove(tcp, tcp->u_arg[3], &a) < 0)
557 return 0;
558 tprintf("[");
559 printstr(tcp, (int)a.rmtfs, -1);
560 if (umove(tcp, (int)a.token, &t) < 0)
561 return 0;
562 tprintf(", %u, %s]", t.t_id, t.t_uname);
563 } else if (strcmp(type, "pcfs") == 0) {
564 struct pc_args a;
565 if (umove(tcp, tcp->u_arg[3], &a) < 0)
566 return 0;
567 printstr(tcp, (int)a.fspec, -1);
568 }
569 }
570 return 0;
571}
572
573int
574sys_unmount(tcp)
575struct tcb *tcp;
576{
577 if (entering(tcp)) {
578 printstr(tcp, tcp->u_arg[0], -1);
579 }
580 return 0;
581}
582
583int
584sys_umount(tcp)
585struct tcb *tcp;
586{
587 return sys_unmount(tcp);
588}
589
590int
591sys_auditsys(tcp)
592struct tcb *tcp;
593{
594 /* XXX - no information available */
595 return printargs(tcp);
596}
597
Roland McGrathd9f816f2004-09-04 03:39:20 +0000598static const struct xlat ex_auth_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000599 { AUTH_UNIX, "AUTH_UNIX" },
600 { AUTH_DES, "AUTH_DES" },
601 { 0, NULL },
602};
603
604int
605sys_exportfs(tcp)
606struct tcb *tcp;
607{
608 struct export e;
609 int i;
610
611 if (entering(tcp)) {
612 printstr(tcp, tcp->u_arg[0], -1);
613 if (umove(tcp, tcp->u_arg[1], &e) < 0) {
614 tprintf("%#lx", tcp->u_arg[1]);
615 return 0;
616 }
617 tprintf("{fl:%u, anon:%u, ", e.ex_flags, e.ex_anon);
618 printxval(ex_auth_flags, e.ex_auth, "AUTH_???");
619 tprintf(", roots:[");
620 if (e.ex_auth == AUTH_UNIX) {
621 for (i=0; i<e.ex_u.exunix.rootaddrs.naddrs; i++) {
622 printsock(tcp,
623 (int)&e.ex_u.exunix.rootaddrs.addrvec[i]);
624 }
625 tprintf("], writers:[");
626 for (i=0; i<e.ex_writeaddrs.naddrs; i++) {
627 printsock(tcp,
628 (int)&e.ex_writeaddrs.addrvec[i]);
629 }
630 tprintf("]");
631 } else {
632 for (i=0; i<e.ex_u.exdes.nnames; i++) {
633 printsock(tcp,
634 (int)&e.ex_u.exdes.rootnames[i]);
635 tprintf(", ");
636 }
637 tprintf("], window:%u", e.ex_u.exdes.window);
638 }
639 tprintf("}");
640 }
641 return 0;
642}
643
Roland McGrathd9f816f2004-09-04 03:39:20 +0000644static const struct xlat sysconflimits[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000645#ifdef _SC_ARG_MAX
646 { _SC_ARG_MAX, "_SC_ARG_MAX" }, /* space for argv & envp */
647#endif
648#ifdef _SC_CHILD_MAX
649 { _SC_CHILD_MAX, "_SC_CHILD_MAX" }, /* maximum children per process??? */
650#endif
651#ifdef _SC_CLK_TCK
652 { _SC_CLK_TCK, "_SC_CLK_TCK" }, /* clock ticks/sec */
653#endif
654#ifdef _SC_NGROUPS_MAX
655 { _SC_NGROUPS_MAX, "_SC_NGROUPS_MAX" }, /* number of groups if multple supp. */
656#endif
657#ifdef _SC_OPEN_MAX
658 { _SC_OPEN_MAX, "_SC_OPEN_MAX" }, /* max open files per process */
659#endif
660#ifdef _SC_JOB_CONTROL
661 { _SC_JOB_CONTROL, "_SC_JOB_CONTROL" }, /* do we have job control */
662#endif
663#ifdef _SC_SAVED_IDS
664 { _SC_SAVED_IDS, "_SC_SAVED_IDS" }, /* do we have saved uid/gids */
665#endif
666#ifdef _SC_VERSION
667 { _SC_VERSION, "_SC_VERSION" }, /* POSIX version supported */
668#endif
669 { 0, NULL },
670};
671
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000672int
673sys_sysconf(tcp)
674struct tcb *tcp;
675{
676 if (entering(tcp)) {
677 printxval(sysconflimits, tcp->u_arg[0], "_SC_???");
678 }
679 return 0;
680}
681
682#endif /* SUNOS4 */
683
684#if defined(SUNOS4) || defined(FREEBSD)
Roland McGrathd9f816f2004-09-04 03:39:20 +0000685static const struct xlat pathconflimits[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000686#ifdef _PC_LINK_MAX
687 { _PC_LINK_MAX, "_PC_LINK_MAX" }, /* max links to file/dir */
688#endif
689#ifdef _PC_MAX_CANON
690 { _PC_MAX_CANON, "_PC_MAX_CANON" }, /* max line length */
691#endif
692#ifdef _PC_MAX_INPUT
693 { _PC_MAX_INPUT, "_PC_MAX_INPUT" }, /* max "packet" to a tty device */
694#endif
695#ifdef _PC_NAME_MAX
696 { _PC_NAME_MAX, "_PC_NAME_MAX" }, /* max pathname component length */
697#endif
698#ifdef _PC_PATH_MAX
699 { _PC_PATH_MAX, "_PC_PATH_MAX" }, /* max pathname length */
700#endif
701#ifdef _PC_PIPE_BUF
702 { _PC_PIPE_BUF, "_PC_PIPE_BUF" }, /* size of a pipe */
703#endif
704#ifdef _PC_CHOWN_RESTRICTED
705 { _PC_CHOWN_RESTRICTED, "_PC_CHOWN_RESTRICTED" }, /* can we give away files */
706#endif
707#ifdef _PC_NO_TRUNC
708 { _PC_NO_TRUNC, "_PC_NO_TRUNC" }, /* trunc or error on >NAME_MAX */
709#endif
710#ifdef _PC_VDISABLE
711 { _PC_VDISABLE, "_PC_VDISABLE" }, /* best char to shut off tty c_cc */
712#endif
713 { 0, NULL },
714};
715
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000716
717int
718sys_pathconf(tcp)
719struct tcb *tcp;
720{
721 if (entering(tcp)) {
722 printstr(tcp, tcp->u_arg[0], -1);
723 tprintf(", ");
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000724 printxval(pathconflimits, tcp->u_arg[1], "_PC_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000725 }
726 return 0;
727}
728
729int
730sys_fpathconf(tcp)
731struct tcb *tcp;
732{
733 if (entering(tcp)) {
734 tprintf("%lu, ", tcp->u_arg[0]);
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000735 printxval(pathconflimits, tcp->u_arg[1], "_PC_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000736 }
737 return 0;
738}
739
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000740#endif /* SUNOS4 || FREEBSD */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000741
742#ifdef SVR4
743
744#ifdef HAVE_SYS_SYSCONFIG_H
745#include <sys/sysconfig.h>
746#endif /* HAVE_SYS_SYSCONFIG_H */
747
748#include <sys/mount.h>
749#include <sys/systeminfo.h>
750#include <sys/utsname.h>
751
Roland McGrathd9f816f2004-09-04 03:39:20 +0000752static const struct xlat sysconfig_options[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000753#ifdef _CONFIG_NGROUPS
754 { _CONFIG_NGROUPS, "_CONFIG_NGROUPS" },
755#endif
756#ifdef _CONFIG_CHILD_MAX
757 { _CONFIG_CHILD_MAX, "_CONFIG_CHILD_MAX" },
758#endif
759#ifdef _CONFIG_OPEN_FILES
760 { _CONFIG_OPEN_FILES, "_CONFIG_OPEN_FILES" },
761#endif
762#ifdef _CONFIG_POSIX_VER
763 { _CONFIG_POSIX_VER, "_CONFIG_POSIX_VER" },
764#endif
765#ifdef _CONFIG_PAGESIZE
766 { _CONFIG_PAGESIZE, "_CONFIG_PAGESIZE" },
767#endif
768#ifdef _CONFIG_CLK_TCK
769 { _CONFIG_CLK_TCK, "_CONFIG_CLK_TCK" },
770#endif
771#ifdef _CONFIG_XOPEN_VER
772 { _CONFIG_XOPEN_VER, "_CONFIG_XOPEN_VER" },
773#endif
774#ifdef _CONFIG_PROF_TCK
775 { _CONFIG_PROF_TCK, "_CONFIG_PROF_TCK" },
776#endif
777#ifdef _CONFIG_NPROC_CONF
778 { _CONFIG_NPROC_CONF, "_CONFIG_NPROC_CONF" },
779#endif
780#ifdef _CONFIG_NPROC_ONLN
781 { _CONFIG_NPROC_ONLN, "_CONFIG_NPROC_ONLN" },
782#endif
783#ifdef _CONFIG_AIO_LISTIO_MAX
784 { _CONFIG_AIO_LISTIO_MAX, "_CONFIG_AIO_LISTIO_MAX" },
785#endif
786#ifdef _CONFIG_AIO_MAX
787 { _CONFIG_AIO_MAX, "_CONFIG_AIO_MAX" },
788#endif
789#ifdef _CONFIG_AIO_PRIO_DELTA_MAX
790 { _CONFIG_AIO_PRIO_DELTA_MAX, "_CONFIG_AIO_PRIO_DELTA_MAX" },
791#endif
792#ifdef _CONFIG_CONFIG_DELAYTIMER_MAX
793 { _CONFIG_DELAYTIMER_MAX, "_CONFIG_DELAYTIMER_MAX" },
794#endif
795#ifdef _CONFIG_MQ_OPEN_MAX
796 { _CONFIG_MQ_OPEN_MAX, "_CONFIG_MQ_OPEN_MAX" },
797#endif
798#ifdef _CONFIG_MQ_PRIO_MAX
799 { _CONFIG_MQ_PRIO_MAX, "_CONFIG_MQ_PRIO_MAX" },
800#endif
801#ifdef _CONFIG_RTSIG_MAX
802 { _CONFIG_RTSIG_MAX, "_CONFIG_RTSIG_MAX" },
803#endif
804#ifdef _CONFIG_SEM_NSEMS_MAX
805 { _CONFIG_SEM_NSEMS_MAX, "_CONFIG_SEM_NSEMS_MAX" },
806#endif
807#ifdef _CONFIG_SEM_VALUE_MAX
808 { _CONFIG_SEM_VALUE_MAX, "_CONFIG_SEM_VALUE_MAX" },
809#endif
810#ifdef _CONFIG_SIGQUEUE_MAX
811 { _CONFIG_SIGQUEUE_MAX, "_CONFIG_SIGQUEUE_MAX" },
812#endif
813#ifdef _CONFIG_SIGRT_MIN
814 { _CONFIG_SIGRT_MIN, "_CONFIG_SIGRT_MIN" },
815#endif
816#ifdef _CONFIG_SIGRT_MAX
817 { _CONFIG_SIGRT_MAX, "_CONFIG_SIGRT_MAX" },
818#endif
819#ifdef _CONFIG_TIMER_MAX
820 { _CONFIG_TIMER_MAX, "_CONFIG_TIMER_MAX" },
821#endif
822#ifdef _CONFIG_CONFIG_PHYS_PAGES
823 { _CONFIG_PHYS_PAGES, "_CONFIG_PHYS_PAGES" },
824#endif
825#ifdef _CONFIG_AVPHYS_PAGES
826 { _CONFIG_AVPHYS_PAGES, "_CONFIG_AVPHYS_PAGES" },
827#endif
828 { 0, NULL },
829};
830
831int
832sys_sysconfig(tcp)
833struct tcb *tcp;
834{
835 if (entering(tcp))
836 printxval(sysconfig_options, tcp->u_arg[0], "_CONFIG_???");
837 return 0;
838}
839
Roland McGrathd9f816f2004-09-04 03:39:20 +0000840static const struct xlat sysinfo_options[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000841 { SI_SYSNAME, "SI_SYSNAME" },
842 { SI_HOSTNAME, "SI_HOSTNAME" },
843 { SI_RELEASE, "SI_RELEASE" },
844 { SI_VERSION, "SI_VERSION" },
845 { SI_MACHINE, "SI_MACHINE" },
846 { SI_ARCHITECTURE, "SI_ARCHITECTURE" },
847 { SI_HW_SERIAL, "SI_HW_SERIAL" },
848 { SI_HW_PROVIDER, "SI_HW_PROVIDER" },
849 { SI_SRPC_DOMAIN, "SI_SRPC_DOMAIN" },
850#ifdef SI_SET_HOSTNAME
851 { SI_SET_HOSTNAME, "SI_SET_HOSTNAME" },
852#endif
853#ifdef SI_SET_SRPC_DOMAIN
854 { SI_SET_SRPC_DOMAIN, "SI_SET_SRPC_DOMAIN" },
855#endif
856#ifdef SI_SET_KERB_REALM
857 { SI_SET_KERB_REALM, "SI_SET_KERB_REALM" },
858#endif
859#ifdef SI_KERB_REALM
860 { SI_KERB_REALM, "SI_KERB_REALM" },
861#endif
862 { 0, NULL },
863};
864
865int
866sys_sysinfo(tcp)
867struct tcb *tcp;
868{
869 if (entering(tcp)) {
870 printxval(sysinfo_options, tcp->u_arg[0], "SI_???");
871 tprintf(", ");
872 }
873 else {
874 /* Technically some calls write values. So what. */
875 if (syserror(tcp))
876 tprintf("%#lx", tcp->u_arg[1]);
877 else
878 printpath(tcp, tcp->u_arg[1]);
879 tprintf(", %lu", tcp->u_arg[2]);
880 }
881 return 0;
882}
883
884#ifdef MIPS
885
886#include <sys/syssgi.h>
887
Roland McGrathd9f816f2004-09-04 03:39:20 +0000888static const struct xlat syssgi_options[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000889 { SGI_SYSID, "SGI_SYSID" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000890#ifdef SGI_RDUBLK
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000891 { SGI_RDUBLK, "SGI_RDUBLK" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000892#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000893 { SGI_TUNE, "SGI_TUNE" },
894 { SGI_IDBG, "SGI_IDBG" },
895 { SGI_INVENT, "SGI_INVENT" },
896 { SGI_RDNAME, "SGI_RDNAME" },
897 { SGI_SETLED, "SGI_SETLED" },
898 { SGI_SETNVRAM, "SGI_SETNVRAM" },
899 { SGI_GETNVRAM, "SGI_GETNVRAM" },
900 { SGI_QUERY_FTIMER, "SGI_QUERY_FTIMER" },
901 { SGI_QUERY_CYCLECNTR, "SGI_QUERY_CYCLECNTR" },
902 { SGI_PROCSZ, "SGI_PROCSZ" },
903 { SGI_SIGACTION, "SGI_SIGACTION" },
904 { SGI_SIGPENDING, "SGI_SIGPENDING" },
905 { SGI_SIGPROCMASK, "SGI_SIGPROCMASK" },
906 { SGI_SIGSUSPEND, "SGI_SIGSUSPEND" },
907 { SGI_SETSID, "SGI_SETSID" },
908 { SGI_SETPGID, "SGI_SETPGID" },
909 { SGI_SYSCONF, "SGI_SYSCONF" },
910 { SGI_WAIT4, "SGI_WAIT4" },
911 { SGI_PATHCONF, "SGI_PATHCONF" },
912 { SGI_READB, "SGI_READB" },
913 { SGI_WRITEB, "SGI_WRITEB" },
914 { SGI_SETGROUPS, "SGI_SETGROUPS" },
915 { SGI_GETGROUPS, "SGI_GETGROUPS" },
916 { SGI_SETTIMEOFDAY, "SGI_SETTIMEOFDAY" },
917 { SGI_SETTIMETRIM, "SGI_SETTIMETRIM" },
918 { SGI_GETTIMETRIM, "SGI_GETTIMETRIM" },
919 { SGI_SPROFIL, "SGI_SPROFIL" },
920 { SGI_RUSAGE, "SGI_RUSAGE" },
921 { SGI_SIGSTACK, "SGI_SIGSTACK" },
922 { SGI_SIGSTATUS, "SGI_SIGSTATUS" },
923 { SGI_NETPROC, "SGI_NETPROC" },
924 { SGI_SIGALTSTACK, "SGI_SIGALTSTACK" },
925 { SGI_BDFLUSHCNT, "SGI_BDFLUSHCNT" },
926 { SGI_SSYNC, "SGI_SSYNC" },
927 { SGI_NFSCNVT, "SGI_NFSCNVT" },
928 { SGI_GETPGID, "SGI_GETPGID" },
929 { SGI_GETSID, "SGI_GETSID" },
930 { SGI_IOPROBE, "SGI_IOPROBE" },
931 { SGI_CONFIG, "SGI_CONFIG" },
932 { SGI_ELFMAP, "SGI_ELFMAP" },
933 { SGI_MCONFIG, "SGI_MCONFIG" },
934 { SGI_GETPLABEL, "SGI_GETPLABEL" },
935 { SGI_SETPLABEL, "SGI_SETPLABEL" },
936 { SGI_GETLABEL, "SGI_GETLABEL" },
937 { SGI_SETLABEL, "SGI_SETLABEL" },
938 { SGI_SATREAD, "SGI_SATREAD" },
939 { SGI_SATWRITE, "SGI_SATWRITE" },
940 { SGI_SATCTL, "SGI_SATCTL" },
941 { SGI_LOADATTR, "SGI_LOADATTR" },
942 { SGI_UNLOADATTR, "SGI_UNLOADATTR" },
943#ifdef SGI_RECVLMSG
944 { SGI_RECVLMSG, "SGI_RECVLMSG" },
945#endif
946 { SGI_PLANGMOUNT, "SGI_PLANGMOUNT" },
947 { SGI_GETPSOACL, "SGI_GETPSOACL" },
948 { SGI_SETPSOACL, "SGI_SETPSOACL" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000949#ifdef SGI_EAG_GET_ATTR
950 { SGI_EAG_GET_ATTR, "SGI_EAG_GET_ATTR" },
951#endif
952#ifdef SGI_EAG_SET_ATTR
953 { SGI_EAG_SET_ATTR, "SGI_EAG_SET_ATTR" },
954#endif
955#ifdef SGI_EAG_GET_PROCATTR
956 { SGI_EAG_GET_PROCATTR, "SGI_EAG_GET_PROCATTR" },
957#endif
958#ifdef SGI_EAG_SET_PROCATTR
959 { SGI_EAG_SET_PROCATTR, "SGI_EAG_SET_PROCATTR" },
960#endif
961#ifdef SGI_FREVOKE
962 { SGI_FREVOKE, "SGI_FREVOKE" },
963#endif
964#ifdef SGI_SBE_GET_INFO
965 { SGI_SBE_GET_INFO, "SGI_SBE_GET_INFO" },
966#endif
967#ifdef SGI_SBE_CLR_INFO
968 { SGI_SBE_CLR_INFO, "SGI_SBE_CLR_INFO" },
969#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000970 { SGI_RMI_FIXECC, "SGI_RMI_FIXECC" },
971 { SGI_R4K_CERRS, "SGI_R4K_CERRS" },
972 { SGI_GET_EVCONF, "SGI_GET_EVCONF" },
973 { SGI_MPCWAROFF, "SGI_MPCWAROFF" },
974 { SGI_SET_AUTOPWRON, "SGI_SET_AUTOPWRON" },
975 { SGI_SPIPE, "SGI_SPIPE" },
976 { SGI_SYMTAB, "SGI_SYMTAB" },
977#ifdef SGI_SET_FPDEBUG
978 { SGI_SET_FPDEBUG, "SGI_SET_FPDEBUG" },
979#endif
Wichert Akkerman8829a551999-06-11 13:18:40 +0000980#ifdef SGI_SET_FP_PRECISE
981 { SGI_SET_FP_PRECISE, "SGI_SET_FP_PRECISE" },
982#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000983 { SGI_TOSSTSAVE, "SGI_TOSSTSAVE" },
984 { SGI_FDHI, "SGI_FDHI" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000985#ifdef SGI_SET_CONFIG_SMM
986 { SGI_SET_CONFIG_SMM, "SGI_SET_CONFIG_SMM" },
987#endif
988#ifdef SGI_SET_FP_PRESERVE
989 { SGI_SET_FP_PRESERVE, "SGI_SET_FP_PRESERVE" },
990#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000991 { SGI_MINRSS, "SGI_MINRSS" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000992#ifdef SGI_GRIO
993 { SGI_GRIO, "SGI_GRIO" },
994#endif
995#ifdef SGI_XLV_SET_TAB
996 { SGI_XLV_SET_TAB, "SGI_XLV_SET_TAB" },
997#endif
998#ifdef SGI_XLV_GET_TAB
999 { SGI_XLV_GET_TAB, "SGI_XLV_GET_TAB" },
1000#endif
1001#ifdef SGI_GET_FP_PRECISE
1002 { SGI_GET_FP_PRECISE, "SGI_GET_FP_PRECISE" },
1003#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001004#ifdef SGI_GET_CONFIG_SMM
Wichert Akkerman8829a551999-06-11 13:18:40 +00001005 { SGI_GET_CONFIG_SMM, "SGI_GET_CONFIG_SMM" },
1006#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001007#ifdef SGI_FP_IMPRECISE_SUPP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001008 { SGI_FP_IMPRECISE_SUPP,"SGI_FP_IMPRECISE_SUPP" },
1009#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001010#ifdef SGI_CONFIG_NSMM_SUPP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001011 { SGI_CONFIG_NSMM_SUPP, "SGI_CONFIG_NSMM_SUPP" },
1012#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001013#ifdef SGI_RT_TSTAMP_CREATE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001014 { SGI_RT_TSTAMP_CREATE, "SGI_RT_TSTAMP_CREATE" },
1015#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001016#ifdef SGI_RT_TSTAMP_DELETE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001017 { SGI_RT_TSTAMP_DELETE, "SGI_RT_TSTAMP_DELETE" },
1018#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001019#ifdef SGI_RT_TSTAMP_START
Wichert Akkerman8829a551999-06-11 13:18:40 +00001020 { SGI_RT_TSTAMP_START, "SGI_RT_TSTAMP_START" },
1021#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001022#ifdef SGI_RT_TSTAMP_STOP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001023 { SGI_RT_TSTAMP_STOP, "SGI_RT_TSTAMP_STOP" },
1024#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001025#ifdef SGI_RT_TSTAMP_ADDR
Wichert Akkerman8829a551999-06-11 13:18:40 +00001026 { SGI_RT_TSTAMP_ADDR, "SGI_RT_TSTAMP_ADDR" },
1027#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001028#ifdef SGI_RT_TSTAMP_MASK
Wichert Akkerman8829a551999-06-11 13:18:40 +00001029 { SGI_RT_TSTAMP_MASK, "SGI_RT_TSTAMP_MASK" },
1030#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001031#ifdef SGI_RT_TSTAMP_EOB_MODE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001032 { SGI_RT_TSTAMP_EOB_MODE,"SGI_RT_TSTAMP_EOB_MODE"},
1033#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001034#ifdef SGI_USE_FP_BCOPY
Wichert Akkerman8829a551999-06-11 13:18:40 +00001035 { SGI_USE_FP_BCOPY, "SGI_USE_FP_BCOPY" },
1036#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001037#ifdef SGI_GET_UST
Wichert Akkerman8829a551999-06-11 13:18:40 +00001038 { SGI_GET_UST, "SGI_GET_UST" },
1039#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001040#ifdef SGI_SPECULATIVE_EXEC
Wichert Akkerman8829a551999-06-11 13:18:40 +00001041 { SGI_SPECULATIVE_EXEC, "SGI_SPECULATIVE_EXEC" },
1042#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001043#ifdef SGI_XLV_NEXT_RQST
Wichert Akkerman8829a551999-06-11 13:18:40 +00001044 { SGI_XLV_NEXT_RQST, "SGI_XLV_NEXT_RQST" },
1045#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001046#ifdef SGI_XLV_ATTR_CURSOR
Wichert Akkerman8829a551999-06-11 13:18:40 +00001047 { SGI_XLV_ATTR_CURSOR, "SGI_XLV_ATTR_CURSOR" },
1048#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001049#ifdef SGI_XLV_ATTR_GET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001050 { SGI_XLV_ATTR_GET, "SGI_XLV_ATTR_GET" },
1051#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001052#ifdef SGI_XLV_ATTR_SET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001053 { SGI_XLV_ATTR_SET, "SGI_XLV_ATTR_SET" },
1054#endif
1055#ifdef SGI_BTOOLSIZE
1056 { SGI_BTOOLSIZE, "SGI_BTOOLSIZE" },
1057#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001058#ifdef SGI_BTOOLGET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001059 { SGI_BTOOLGET, "SGI_BTOOLGET" },
1060#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001061#ifdef SGI_BTOOLREINIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001062 { SGI_BTOOLREINIT, "SGI_BTOOLREINIT" },
1063#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001064#ifdef SGI_CREATE_UUID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001065 { SGI_CREATE_UUID, "SGI_CREATE_UUID" },
1066#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001067#ifdef SGI_NOFPE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001068 { SGI_NOFPE, "SGI_NOFPE" },
1069#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001070#ifdef SGI_OLD_SOFTFP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001071 { SGI_OLD_SOFTFP, "SGI_OLD_SOFTFP" },
1072#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001073#ifdef SGI_FS_INUMBERS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001074 { SGI_FS_INUMBERS, "SGI_FS_INUMBERS" },
1075#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001076#ifdef SGI_FS_BULKSTAT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001077 { SGI_FS_BULKSTAT, "SGI_FS_BULKSTAT" },
1078#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001079#ifdef SGI_RT_TSTAMP_WAIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001080 { SGI_RT_TSTAMP_WAIT, "SGI_RT_TSTAMP_WAIT" },
1081#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001082#ifdef SGI_RT_TSTAMP_UPDATE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001083 { SGI_RT_TSTAMP_UPDATE, "SGI_RT_TSTAMP_UPDATE" },
1084#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001085#ifdef SGI_PATH_TO_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001086 { SGI_PATH_TO_HANDLE, "SGI_PATH_TO_HANDLE" },
1087#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001088#ifdef SGI_PATH_TO_FSHANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001089 { SGI_PATH_TO_FSHANDLE, "SGI_PATH_TO_FSHANDLE" },
1090#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001091#ifdef SGI_FD_TO_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001092 { SGI_FD_TO_HANDLE, "SGI_FD_TO_HANDLE" },
1093#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001094#ifdef SGI_OPEN_BY_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001095 { SGI_OPEN_BY_HANDLE, "SGI_OPEN_BY_HANDLE" },
1096#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001097#ifdef SGI_READLINK_BY_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001098 { SGI_READLINK_BY_HANDLE,"SGI_READLINK_BY_HANDLE"},
1099#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001100#ifdef SGI_READ_DANGID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001101 { SGI_READ_DANGID, "SGI_READ_DANGID" },
1102#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001103#ifdef SGI_CONST
Wichert Akkerman8829a551999-06-11 13:18:40 +00001104 { SGI_CONST, "SGI_CONST" },
1105#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001106#ifdef SGI_XFS_FSOPERATIONS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001107 { SGI_XFS_FSOPERATIONS, "SGI_XFS_FSOPERATIONS" },
1108#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001109#ifdef SGI_SETASH
Wichert Akkerman8829a551999-06-11 13:18:40 +00001110 { SGI_SETASH, "SGI_SETASH" },
1111#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001112#ifdef SGI_GETASH
Wichert Akkerman8829a551999-06-11 13:18:40 +00001113 { SGI_GETASH, "SGI_GETASH" },
1114#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001115#ifdef SGI_SETPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001116 { SGI_SETPRID, "SGI_SETPRID" },
1117#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001118#ifdef SGI_GETPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001119 { SGI_GETPRID, "SGI_GETPRID" },
1120#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001121#ifdef SGI_SETSPINFO
Wichert Akkerman8829a551999-06-11 13:18:40 +00001122 { SGI_SETSPINFO, "SGI_SETSPINFO" },
1123#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001124#ifdef SGI_GETSPINFO
Wichert Akkerman8829a551999-06-11 13:18:40 +00001125 { SGI_GETSPINFO, "SGI_GETSPINFO" },
1126#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001127#ifdef SGI_SHAREII
Wichert Akkerman8829a551999-06-11 13:18:40 +00001128 { SGI_SHAREII, "SGI_SHAREII" },
1129#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001130#ifdef SGI_NEWARRAYSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001131 { SGI_NEWARRAYSESS, "SGI_NEWARRAYSESS" },
1132#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001133#ifdef SGI_GETDFLTPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001134 { SGI_GETDFLTPRID, "SGI_GETDFLTPRID" },
1135#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001136#ifdef SGI_SET_DISMISSED_EXC_CNT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001137 { SGI_SET_DISMISSED_EXC_CNT,"SGI_SET_DISMISSED_EXC_CNT" },
1138#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001139#ifdef SGI_GET_DISMISSED_EXC_CNT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001140 { SGI_GET_DISMISSED_EXC_CNT,"SGI_GET_DISMISSED_EXC_CNT" },
1141#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001142#ifdef SGI_CYCLECNTR_SIZE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001143 { SGI_CYCLECNTR_SIZE, "SGI_CYCLECNTR_SIZE" },
1144#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001145#ifdef SGI_QUERY_FASTTIMER
Wichert Akkerman8829a551999-06-11 13:18:40 +00001146 { SGI_QUERY_FASTTIMER, "SGI_QUERY_FASTTIMER" },
1147#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001148#ifdef SGI_PIDSINASH
Wichert Akkerman8829a551999-06-11 13:18:40 +00001149 { SGI_PIDSINASH, "SGI_PIDSINASH" },
1150#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001151#ifdef SGI_ULI
Wichert Akkerman8829a551999-06-11 13:18:40 +00001152 { SGI_ULI, "SGI_ULI" },
1153#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001154#ifdef SGI_LPG_SHMGET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001155 { SGI_LPG_SHMGET, "SGI_LPG_SHMGET" },
1156#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001157#ifdef SGI_LPG_MAP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001158 { SGI_LPG_MAP, "SGI_LPG_MAP" },
1159#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001160#ifdef SGI_CACHEFS_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001161 { SGI_CACHEFS_SYS, "SGI_CACHEFS_SYS" },
1162#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001163#ifdef SGI_NFSNOTIFY
Wichert Akkerman8829a551999-06-11 13:18:40 +00001164 { SGI_NFSNOTIFY, "SGI_NFSNOTIFY" },
1165#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001166#ifdef SGI_LOCKDSYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001167 { SGI_LOCKDSYS, "SGI_LOCKDSYS" },
1168#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001169#ifdef SGI_EVENTCTR
Wichert Akkerman8829a551999-06-11 13:18:40 +00001170 { SGI_EVENTCTR, "SGI_EVENTCTR" },
1171#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001172#ifdef SGI_GETPRUSAGE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001173 { SGI_GETPRUSAGE, "SGI_GETPRUSAGE" },
1174#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001175#ifdef SGI_PROCMASK_LOCATION
Wichert Akkerman8829a551999-06-11 13:18:40 +00001176 { SGI_PROCMASK_LOCATION,"SGI_PROCMASK_LOCATION" },
1177#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001178#ifdef SGI_UNUSED
Wichert Akkerman8829a551999-06-11 13:18:40 +00001179 { SGI_UNUSED, "SGI_UNUSED" },
1180#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001181#ifdef SGI_CKPT_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001182 { SGI_CKPT_SYS, "SGI_CKPT_SYS" },
1183#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001184#ifdef SGI_CKPT_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001185 { SGI_CKPT_SYS, "SGI_CKPT_SYS" },
1186#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001187#ifdef SGI_GETGRPPID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001188 { SGI_GETGRPPID, "SGI_GETGRPPID" },
1189#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001190#ifdef SGI_GETSESPID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001191 { SGI_GETSESPID, "SGI_GETSESPID" },
1192#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001193#ifdef SGI_ENUMASHS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001194 { SGI_ENUMASHS, "SGI_ENUMASHS" },
1195#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001196#ifdef SGI_SETASMACHID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001197 { SGI_SETASMACHID, "SGI_SETASMACHID" },
1198#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001199#ifdef SGI_GETASMACHID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001200 { SGI_GETASMACHID, "SGI_GETASMACHID" },
1201#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001202#ifdef SGI_GETARSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001203 { SGI_GETARSESS, "SGI_GETARSESS" },
1204#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001205#ifdef SGI_JOINARRAYSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001206 { SGI_JOINARRAYSESS, "SGI_JOINARRAYSESS" },
1207#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001208#ifdef SGI_SPROC_KILL
Wichert Akkerman8829a551999-06-11 13:18:40 +00001209 { SGI_SPROC_KILL, "SGI_SPROC_KILL" },
1210#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001211#ifdef SGI_DBA_CONFIG
Wichert Akkerman8829a551999-06-11 13:18:40 +00001212 { SGI_DBA_CONFIG, "SGI_DBA_CONFIG" },
1213#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001214#ifdef SGI_RELEASE_NAME
Wichert Akkerman8829a551999-06-11 13:18:40 +00001215 { SGI_RELEASE_NAME, "SGI_RELEASE_NAME" },
1216#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001217#ifdef SGI_SYNCH_CACHE_HANDLER
Wichert Akkerman8829a551999-06-11 13:18:40 +00001218 { SGI_SYNCH_CACHE_HANDLER,"SGI_SYNCH_CACHE_HANDLER"},
1219#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001220#ifdef SGI_SWASH_INIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001221 { SGI_SWASH_INIT, "SGI_SWASH_INIT" },
1222#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001223#ifdef SGI_NUMA_MIGR_PAGE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001224 { SGI_NUMA_MIGR_PAGE, "SGI_NUMA_MIGR_PAGE" },
1225#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001226#ifdef SGI_NUMA_MIGR_PAGE_ALT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001227 { SGI_NUMA_MIGR_PAGE_ALT,"SGI_NUMA_MIGR_PAGE_ALT"},
1228#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001229#ifdef SGI_KAIO_USERINIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001230 { SGI_KAIO_USERINIT, "SGI_KAIO_USERINIT" },
1231#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001232#ifdef SGI_KAIO_READ
Wichert Akkerman8829a551999-06-11 13:18:40 +00001233 { SGI_KAIO_READ, "SGI_KAIO_READ" },
1234#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001235#ifdef SGI_KAIO_WRITE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001236 { SGI_KAIO_WRITE, "SGI_KAIO_WRITE" },
1237#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001238#ifdef SGI_KAIO_SUSPEND
Wichert Akkerman8829a551999-06-11 13:18:40 +00001239 { SGI_KAIO_SUSPEND, "SGI_KAIO_SUSPEND" },
1240#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001241#ifdef SGI_KAIO_STATS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001242 { SGI_KAIO_STATS, "SGI_KAIO_STATS" },
1243#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001244#ifdef SGI_INITIAL_PT_SPROC
Wichert Akkerman8829a551999-06-11 13:18:40 +00001245 { SGI_INITIAL_PT_SPROC, "SGI_INITIAL_PT_SPROC" },
1246#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001247 { 0, NULL },
1248};
1249
1250int
1251sys_syssgi(tcp)
1252struct tcb *tcp;
1253{
1254 int i;
1255
1256 if (entering(tcp)) {
1257 printxval(syssgi_options, tcp->u_arg[0], "SGI_???");
1258 switch (tcp->u_arg[0]) {
1259 default:
1260 for (i = 1; i < tcp->u_nargs; i++)
1261 tprintf(", %#lx", tcp->u_arg[i]);
1262 break;
1263 }
1264 }
1265 return 0;
1266}
1267
1268#include <sys/types.h>
1269#include <rpc/rpc.h>
1270struct cred;
1271struct uio;
1272#include <sys/fsid.h>
1273#include <sys/vnode.h>
1274#include <sys/fs/nfs.h>
1275#include <sys/fs/nfs_clnt.h>
1276
Roland McGrathd9f816f2004-09-04 03:39:20 +00001277static const struct xlat mount_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001278 { MS_RDONLY, "MS_RDONLY" },
1279 { MS_FSS, "MS_FSS" },
1280 { MS_DATA, "MS_DATA" },
1281 { MS_NOSUID, "MS_NOSUID" },
1282 { MS_REMOUNT, "MS_REMOUNT" },
1283 { MS_NOTRUNC, "MS_NOTRUNC" },
1284 { MS_GRPID, "MS_GRPID" },
1285 { MS_NODEV, "MS_NODEV" },
1286 { MS_BEFORE, "MS_BEFORE" },
1287 { MS_AFTER, "MS_AFTER" },
1288 { 0, NULL },
1289};
1290
Roland McGrathd9f816f2004-09-04 03:39:20 +00001291static const struct xlat nfs_flags[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001292 { NFSMNT_SOFT, "NFSMNT_SOFT" },
1293 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
1294 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
1295 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
1296 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
1297 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001298#ifdef NFSMNT_NOINT /* IRIX 6 */
1299 { NFSMNT_NOINT, "NFSMNT_NOINT" },
1300#endif
1301#ifdef NFSMNT_INT /* IRIX 5 */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001302 { NFSMNT_INT, "NFSMNT_INT" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001303#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001304 { NFSMNT_NOAC, "NFSMNT_NOAC" },
1305 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
1306 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
1307 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
1308 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
1309 { NFSMNT_PRIVATE, "NFSMNT_PRIVATE" },
1310 { NFSMNT_SYMTTL, "NFSMNT_SYMTTL" },
1311 { NFSMNT_LOOPBACK, "NFSMNT_LOOPBACK" },
1312 { NFSMNT_BASETYPE, "NFSMNT_BASETYPE" },
1313 { NFSMNT_NAMEMAX, "NFSMNT_NAMEMAX" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001314#ifdef NFSMNT_SHORTUID /* IRIX 6 */
1315 { NFSMNT_SHORTUID, "NFSMNT_SHORTUID" },
1316#endif
1317#ifdef NFSMNT_ASYNCNLM /* IRIX 6 */
1318 { NFSMNT_ASYNCNLM, "NFSMNT_ASYNCNLM" },
1319#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001320 { 0, NULL },
1321};
1322
1323int
1324sys_mount(tcp)
1325struct tcb *tcp;
1326{
1327 if (entering(tcp)) {
1328 printpath(tcp, tcp->u_arg[0]);
1329 tprintf(", ");
1330 printpath(tcp, tcp->u_arg[1]);
1331 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001332 printflags(mount_flags, tcp->u_arg[2], "MS_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001333 if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
1334 tprintf(", ");
1335 tprintf("%ld", tcp->u_arg[3]);
1336 }
1337 if (tcp->u_arg[2] & MS_DATA) {
1338 int nfs_type = sysfs(GETFSIND, FSID_NFS);
1339
1340 tprintf(", ");
1341 if (tcp->u_arg[3] == nfs_type) {
1342 struct nfs_args args;
1343 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1344 tprintf("%#lx", tcp->u_arg[4]);
1345 else {
1346 tprintf("addr=");
1347 printsock(tcp, (int) args.addr);
1348 tprintf(", flags=");
Roland McGrathb2dee132005-06-01 19:02:36 +00001349 printflags(nfs_flags, args.flags, "NFSMNT_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001350 tprintf(", hostname=");
1351 printstr(tcp, (int) args.hostname, -1);
1352 tprintf(", ...}");
1353 }
1354 }
1355 else
1356 tprintf("%#lx", tcp->u_arg[4]);
1357 tprintf(", %ld", tcp->u_arg[5]);
1358 }
1359 }
1360 return 0;
1361}
1362
1363#else /* !MIPS */
1364
Wichert Akkerman3377df71999-11-26 13:14:41 +00001365#if UNIXWARE
1366
1367#include <sys/types.h>
1368#include <sys/fstyp.h>
1369#include <sys/mount.h>
1370#include <sys/xti.h>
1371
1372#define NFSCLIENT 1
1373#include <nfs/mount.h>
1374
1375#include <sys/fs/vx_ioctl.h>
1376
Roland McGrathd9f816f2004-09-04 03:39:20 +00001377static const struct xlat mount_flags[] = {
Wichert Akkerman3377df71999-11-26 13:14:41 +00001378 { MS_RDONLY, "MS_RDONLY" },
1379 { MS_FSS, "MS_FSS" },
1380 { MS_DATA, "MS_DATA" },
1381 { MS_HADBAD, "MS_HADBAD" },
1382 { MS_NOSUID, "MS_NOSUID" },
1383 { MS_REMOUNT, "MS_REMOUNT" },
1384 { MS_NOTRUNC, "MS_NOTRUNC" },
1385 { MS_SOFTMNT, "MS_SOFTMNT" },
1386 { MS_SYSSPACE, "MS_SYSSPACE" },
1387 { 0, NULL },
1388};
1389
1390#ifdef VX_MS_MASK
Roland McGrathd9f816f2004-09-04 03:39:20 +00001391static const struct xlat vxfs_flags[] = {
Wichert Akkerman3377df71999-11-26 13:14:41 +00001392 { VX_MS_NOLOG, "VX_MS_NOLOG" },
1393 { VX_MS_BLKCLEAR, "VX_MS_BLKCLEAR" },
1394 { VX_MS_SNAPSHOT, "VX_MS_SNAPSHOT" },
1395 { VX_MS_NODATAINLOG, "VX_MS_NODATAINLOG" },
1396 { VX_MS_DELAYLOG, "VX_MS_DELAYLOG" },
1397 { VX_MS_TMPLOG, "VX_MS_TMPLOG" },
1398 { VX_MS_FILESET, "VX_MS_FILESET" },
1399
1400 { VX_MS_CACHE_DIRECT, "VX_MS_CACHE_DIRECT" },
1401 { VX_MS_CACHE_DSYNC, "VX_MS_CACHE_DSYNC" },
1402 { VX_MS_CACHE_CLOSESYNC,"VX_MS_CACHE_CLOSESYNC" },
1403 { VX_MS_CACHE_TMPCACHE, "VX_MS_CACHE_TMPCACHE" },
1404
1405 { VX_MS_OSYNC_DIRECT, "VX_MS_OSYNC_DIRECT" },
1406 { VX_MS_OSYNC_DSYNC, "VX_MS_OSYNC_DSYNC" },
1407 { VX_MS_OSYNC_CLOSESYNC,"VX_MS_OSYNC_CLOSESYNC" },
1408 { VX_MS_OSYNC_DELAY, "VX_MS_OSYNC_DELAY" },
1409 { 0, NULL, },
1410};
1411#endif
1412
Roland McGrathd9f816f2004-09-04 03:39:20 +00001413static const struct xlat nfs_flags[] = {
Wichert Akkerman3377df71999-11-26 13:14:41 +00001414 { NFSMNT_SOFT, "NFSMNT_SOFT" },
1415 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
1416 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
1417 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
1418 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
1419 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
1420 { NFSMNT_INT, "NFSMNT_INT" },
1421 { NFSMNT_NOAC, "NFSMNT_NOAC" },
1422 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
1423 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
1424 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
1425 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
1426 { NFSMNT_SECURE, "NFSMNT_SECURE" },
1427 { NFSMNT_NOCTO, "NFSMNT_NOCTO" },
1428 { NFSMNT_GRPID, "NFSMNT_GRPID" },
1429 { NFSMNT_RPCTIMESYNC, "NFSMNT_RPCTIMESYNC" },
1430 { NFSMNT_LWPSMAX, "NFSMNT_LWPSMAX" },
1431 { 0, NULL },
1432};
1433
1434int
1435sys_mount(tcp)
1436struct tcb *tcp;
1437{
1438 if (entering(tcp)) {
1439 char fstyp [FSTYPSZ];
1440 printpath(tcp, tcp->u_arg[0]);
1441 tprintf(", ");
1442 printpath(tcp, tcp->u_arg[1]);
1443 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001444 printflags(mount_flags, tcp->u_arg[2], "MS_???");
Wichert Akkerman3377df71999-11-26 13:14:41 +00001445 /* The doc sez that the file system type is given as a
1446 fsindex, and we should use sysfs to work out the name.
1447 This appears to be untrue for UW. Maybe it's untrue
1448 for all SVR4's? */
1449 if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
1450 if (umovestr(tcp, tcp->u_arg[3], FSTYPSZ, fstyp) < 0) {
1451 *fstyp = 0;
1452 tprintf(", %ld", tcp->u_arg[3]);
1453 }
1454 else
1455 tprintf(", \"%s\"", fstyp);
1456 }
1457 if (tcp->u_arg[2] & MS_DATA) {
1458 tprintf(", ");
1459#ifdef VX_MS_MASK
1460 /* On UW7 they don't give us the defines and structs
1461 we need to see what is going on. Bummer. */
1462 if (strcmp (fstyp, "vxfs") == 0) {
1463 struct vx_mountargs5 args;
1464 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1465 tprintf("%#lx", tcp->u_arg[4]);
1466 else {
1467 tprintf("{ flags=");
Roland McGrathb2dee132005-06-01 19:02:36 +00001468 printflags(vxfs_flags, args.mflags, "VX_MS_???");
Wichert Akkerman3377df71999-11-26 13:14:41 +00001469 if (args.mflags & VX_MS_SNAPSHOT) {
1470 tprintf (", snapof=");
1471 printstr (tcp,
Roland McGrathced50da2004-08-31 06:48:46 +00001472 (long) args.primaryspec,
Wichert Akkerman3377df71999-11-26 13:14:41 +00001473 -1);
1474 if (args.snapsize > 0)
1475 tprintf (", snapsize=%ld", args.snapsize);
1476 }
1477 tprintf(" }");
1478 }
1479 }
1480 else
1481#endif
1482 if (strcmp (fstyp, "specfs") == 0) {
1483 tprintf ("dev=");
1484 printstr (tcp, tcp->u_arg[4], -1);
1485 }
1486 else
1487 if (strcmp (fstyp, "nfs") == 0) {
1488 struct nfs_args args;
1489 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1490 tprintf("%#lx", tcp->u_arg[4]);
1491 else {
1492 struct netbuf addr;
1493 tprintf("{ addr=");
1494 if (umove (tcp, (int) args.addr, &addr) < 0) {
1495 tprintf ("%#lx", (long) args.addr);
1496 }
1497 else {
1498 printsock(tcp, (int) addr.buf, addr.len);
1499 }
1500 tprintf(", flags=");
Roland McGrathb2dee132005-06-01 19:02:36 +00001501 printflags(nfs_flags, args.flags, "NFSMNT_???");
Wichert Akkerman3377df71999-11-26 13:14:41 +00001502 tprintf(", hostname=");
1503 printstr(tcp, (int) args.hostname, -1);
1504 tprintf(", ...}");
1505 }
1506 }
1507 else
1508 tprintf("%#lx", tcp->u_arg[4]);
1509 tprintf(", %ld", tcp->u_arg[5]);
1510 }
1511 }
1512 return 0;
1513}
1514
1515#else /* !UNIXWARE */
1516
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001517int
1518sys_mount(tcp)
1519struct tcb *tcp;
1520{
1521 if (entering(tcp)) {
1522 printpath(tcp, tcp->u_arg[0]);
1523 tprintf(", ");
1524 printpath(tcp, tcp->u_arg[1]);
1525 tprintf(", ...");
1526 }
1527 return 0;
1528}
Wichert Akkermanea78f0f1999-11-29 15:34:02 +00001529#endif /* !UNIXWARE */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001530
1531#endif /* !MIPS */
1532
1533#endif /* SVR4 */
1534
Nate Sammons8d5860c1999-07-03 18:53:05 +00001535#ifdef SYS_capget
Wichert Akkermanc7926982000-04-10 22:22:31 +00001536
Roland McGrathd9f816f2004-09-04 03:39:20 +00001537static const struct xlat capabilities[] = {
Wichert Akkermanc7926982000-04-10 22:22:31 +00001538 { 1<<CAP_CHOWN, "CAP_CHOWN" },
1539 { 1<<CAP_DAC_OVERRIDE, "CAP_DAC_OVERRIDE"},
1540 { 1<<CAP_DAC_READ_SEARCH,"CAP_DAC_READ_SEARCH"},
1541 { 1<<CAP_FOWNER, "CAP_FOWNER" },
1542 { 1<<CAP_FSETID, "CAP_FSETID" },
1543 { 1<<CAP_KILL, "CAP_KILL" },
1544 { 1<<CAP_SETGID, "CAP_SETGID" },
1545 { 1<<CAP_SETUID, "CAP_SETUID" },
1546 { 1<<CAP_SETPCAP, "CAP_SETPCAP" },
1547 { 1<<CAP_LINUX_IMMUTABLE,"CAP_LINUX_IMMUTABLE"},
1548 { 1<<CAP_NET_BIND_SERVICE,"CAP_NET_BIND_SERVICE"},
1549 { 1<<CAP_NET_BROADCAST, "CAP_NET_BROADCAST"},
1550 { 1<<CAP_NET_ADMIN, "CAP_NET_ADMIN" },
1551 { 1<<CAP_NET_RAW, "CAP_NET_RAW" },
1552 { 1<<CAP_IPC_LOCK, "CAP_IPC_LOCK" },
1553 { 1<<CAP_IPC_OWNER, "CAP_IPC_OWNER" },
1554 { 1<<CAP_SYS_MODULE, "CAP_SYS_MODULE"},
1555 { 1<<CAP_SYS_RAWIO, "CAP_SYS_RAWIO" },
1556 { 1<<CAP_SYS_CHROOT, "CAP_SYS_CHROOT"},
1557 { 1<<CAP_SYS_PTRACE, "CAP_SYS_PTRACE"},
1558 { 1<<CAP_SYS_PACCT, "CAP_SYS_PACCT" },
1559 { 1<<CAP_SYS_ADMIN, "CAP_SYS_ADMIN" },
1560 { 1<<CAP_SYS_BOOT, "CAP_SYS_BOOT" },
1561 { 1<<CAP_SYS_NICE, "CAP_SYS_NICE" },
1562 { 1<<CAP_SYS_RESOURCE, "CAP_SYS_RESOURCE"},
1563 { 1<<CAP_SYS_TIME, "CAP_SYS_TIME" },
1564 { 1<<CAP_SYS_TTY_CONFIG,"CAP_SYS_TTY_CONFIG"},
Dmitry V. Levin949f4512008-11-11 00:21:09 +00001565#ifdef CAP_MKNOD
1566 { 1<<CAP_MKNOD, "CAP_MKNOD" },
1567#endif
1568#ifdef CAP_LEASE
1569 { 1<<CAP_LEASE, "CAP_LEASE" },
1570#endif
1571#ifdef CAP_AUDIT_WRITE
1572 { 1<<CAP_AUDIT_WRITE, "CAP_AUDIT_WRITE"},
1573#endif
1574#ifdef CAP_AUDIT_CONTROL
1575 { 1<<CAP_AUDIT_CONTROL, "CAP_AUDIT_CONTROL"},
1576#endif
1577#ifdef CAP_SETFCAP
1578 { 1<<CAP_SETFCAP, "CAP_SETFCAP" },
1579#endif
Wichert Akkermanc7926982000-04-10 22:22:31 +00001580 { 0, NULL },
1581};
1582
1583
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001584int
1585sys_capget(tcp)
1586struct tcb *tcp;
1587{
Wichert Akkermanc7926982000-04-10 22:22:31 +00001588 static cap_user_header_t arg0 = NULL;
1589 static cap_user_data_t arg1 = NULL;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001590
1591 if(!entering(tcp)) {
Wichert Akkermanc7926982000-04-10 22:22:31 +00001592 if (!arg0) {
1593 if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001594 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001595 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001596 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001597 }
1598 }
1599 if (!arg1) {
1600 if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001601 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001602 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001603 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001604 }
1605 }
1606
1607 if (!tcp->u_arg[0])
1608 tprintf("NULL");
1609 else if (!verbose(tcp))
1610 tprintf("%#lx", tcp->u_arg[0]);
1611 else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
1612 tprintf("???");
1613 else {
1614 tprintf("%#x, %d", arg0->version, arg0->pid);
1615 }
1616 tprintf(", ");
1617 if (!tcp->u_arg[1])
1618 tprintf("NULL");
1619 else if (!verbose(tcp))
1620 tprintf("%#lx", tcp->u_arg[1]);
1621 else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
1622 tprintf("???");
1623 else {
1624 tprintf("{");
Roland McGrathb2dee132005-06-01 19:02:36 +00001625 printflags(capabilities, arg1->effective, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001626 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001627 printflags(capabilities, arg1->permitted, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001628 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001629 printflags(capabilities, arg1->inheritable, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001630 tprintf("}");
Roland McGrathced50da2004-08-31 06:48:46 +00001631 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001632 }
1633 return 0;
1634}
1635
1636int
1637sys_capset(tcp)
1638struct tcb *tcp;
1639{
Wichert Akkermanc7926982000-04-10 22:22:31 +00001640 static cap_user_header_t arg0 = NULL;
1641 static cap_user_data_t arg1 = NULL;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001642
Wichert Akkermanc7926982000-04-10 22:22:31 +00001643 if(entering(tcp)) {
1644 if (!arg0) {
1645 if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001646 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001647 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001648 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001649 }
1650 }
1651 if (!arg1) {
1652 if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
Roland McGrath46100d02005-06-01 18:55:42 +00001653 fprintf(stderr, "out of memory\n");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001654 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001655 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001656 }
1657 }
1658
1659 if (!tcp->u_arg[0])
1660 tprintf("NULL");
1661 else if (!verbose(tcp))
1662 tprintf("%#lx", tcp->u_arg[0]);
1663 else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
1664 tprintf("???");
1665 else {
1666 tprintf("%#x, %d", arg0->version, arg0->pid);
1667 }
1668 tprintf(", ");
1669 if (!tcp->u_arg[1])
1670 tprintf("NULL");
1671 else if (!verbose(tcp))
1672 tprintf("%#lx", tcp->u_arg[1]);
1673 else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
1674 tprintf("???");
1675 else {
1676 tprintf("{");
Roland McGrathb2dee132005-06-01 19:02:36 +00001677 printflags(capabilities, arg1->effective, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001678 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001679 printflags(capabilities, arg1->permitted, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001680 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +00001681 printflags(capabilities, arg1->inheritable, "CAP_???");
Wichert Akkermanc7926982000-04-10 22:22:31 +00001682 tprintf("}");
Roland McGrathced50da2004-08-31 06:48:46 +00001683 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001684 }
1685 return 0;
1686}
1687
1688#else
1689
1690int sys_capget(tcp)
1691struct tcb *tcp;
1692{
1693 return printargs(tcp);
1694}
1695
1696int sys_capset(tcp)
1697struct tcb *tcp;
1698{
1699 return printargs(tcp);
1700}
1701
1702#endif
1703
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001704#ifdef LINUX
Dmitry V. Levin35a55782006-12-04 13:48:10 +00001705/* Linux 2.6.18+ headers removed CTL_PROC enum. */
1706# define CTL_PROC 4
Roland McGrath5eb1aa52007-01-11 22:48:39 +00001707# define CTL_CPU 10 /* older headers lack */
Roland McGrathd9f816f2004-09-04 03:39:20 +00001708static const struct xlat sysctl_root[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001709 { CTL_KERN, "CTL_KERN" },
1710 { CTL_VM, "CTL_VM" },
1711 { CTL_NET, "CTL_NET" },
1712 { CTL_PROC, "CTL_PROC" },
1713 { CTL_FS, "CTL_FS" },
1714 { CTL_DEBUG, "CTL_DEBUG" },
1715 { CTL_DEV, "CTL_DEV" },
Dmitry V. Levin35a55782006-12-04 13:48:10 +00001716 { CTL_BUS, "CTL_BUS" },
1717 { CTL_ABI, "CTL_ABI" },
1718 { CTL_CPU, "CTL_CPU" },
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001719 { 0, NULL }
1720};
1721
Roland McGrathd9f816f2004-09-04 03:39:20 +00001722static const struct xlat sysctl_kern[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001723 { KERN_OSTYPE, "KERN_OSTYPE" },
1724 { KERN_OSRELEASE, "KERN_OSRELEASE" },
1725 { KERN_OSREV, "KERN_OSREV" },
1726 { KERN_VERSION, "KERN_VERSION" },
1727 { KERN_SECUREMASK, "KERN_SECUREMASK" },
1728 { KERN_PROF, "KERN_PROF" },
1729 { KERN_NODENAME, "KERN_NODENAME" },
1730 { KERN_DOMAINNAME, "KERN_DOMAINNAME" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001731#ifdef KERN_SECURELVL
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001732 { KERN_SECURELVL, "KERN_SECURELVL" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001733#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001734 { KERN_PANIC, "KERN_PANIC" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001735#ifdef KERN_REALROOTDEV
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001736 { KERN_REALROOTDEV, "KERN_REALROOTDEV" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001737#endif
1738#ifdef KERN_JAVA_INTERPRETER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001739 { KERN_JAVA_INTERPRETER, "KERN_JAVA_INTERPRETER" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001740#endif
1741#ifdef KERN_JAVA_APPLETVIEWER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001742 { KERN_JAVA_APPLETVIEWER, "KERN_JAVA_APPLETVIEWER" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001743#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001744 { KERN_SPARC_REBOOT, "KERN_SPARC_REBOOT" },
1745 { KERN_CTLALTDEL, "KERN_CTLALTDEL" },
1746 { KERN_PRINTK, "KERN_PRINTK" },
1747 { KERN_NAMETRANS, "KERN_NAMETRANS" },
1748 { KERN_PPC_HTABRECLAIM, "KERN_PPC_HTABRECLAIM" },
1749 { KERN_PPC_ZEROPAGED, "KERN_PPC_ZEROPAGED" },
1750 { KERN_PPC_POWERSAVE_NAP, "KERN_PPC_POWERSAVE_NAP" },
1751 { KERN_MODPROBE, "KERN_MODPROBE" },
1752 { KERN_SG_BIG_BUFF, "KERN_SG_BIG_BUFF" },
1753 { KERN_ACCT, "KERN_ACCT" },
1754 { KERN_PPC_L2CR, "KERN_PPC_L2CR" },
1755 { KERN_RTSIGNR, "KERN_RTSIGNR" },
1756 { KERN_RTSIGMAX, "KERN_RTSIGMAX" },
1757 { KERN_SHMMAX, "KERN_SHMMAX" },
1758 { KERN_MSGMAX, "KERN_MSGMAX" },
1759 { KERN_MSGMNB, "KERN_MSGMNB" },
1760 { KERN_MSGPOOL, "KERN_MSGPOOL" },
1761 { 0, NULL }
1762};
1763
Roland McGrathd9f816f2004-09-04 03:39:20 +00001764static const struct xlat sysctl_vm[] = {
Roland McGratha796fd02004-03-01 22:10:54 +00001765#ifdef VM_SWAPCTL
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001766 { VM_SWAPCTL, "VM_SWAPCTL" },
Roland McGratha796fd02004-03-01 22:10:54 +00001767#endif
1768#ifdef VM_UNUSED1
1769 { VM_UNUSED1, "VM_UNUSED1" },
1770#endif
1771#ifdef VM_SWAPOUT
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001772 { VM_SWAPOUT, "VM_SWAPOUT" },
Roland McGratha796fd02004-03-01 22:10:54 +00001773#endif
1774#ifdef VM_UNUSED2
1775 { VM_UNUSED2, "VM_UNUSED2" },
1776#endif
1777#ifdef VM_FREEPG
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001778 { VM_FREEPG, "VM_FREEPG" },
Roland McGratha796fd02004-03-01 22:10:54 +00001779#endif
1780#ifdef VM_UNUSED3
1781 { VM_UNUSED3, "VM_UNUSED3" },
1782#endif
1783#ifdef VM_BDFLUSH
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001784 { VM_BDFLUSH, "VM_BDFLUSH" },
Roland McGratha796fd02004-03-01 22:10:54 +00001785#endif
1786#ifdef VM_UNUSED4
1787 { VM_UNUSED4, "VM_UNUSED4" },
1788#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001789 { VM_OVERCOMMIT_MEMORY, "VM_OVERCOMMIT_MEMORY" },
Roland McGratha796fd02004-03-01 22:10:54 +00001790#ifdef VM_BUFFERMEM
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001791 { VM_BUFFERMEM, "VM_BUFFERMEM" },
Roland McGratha796fd02004-03-01 22:10:54 +00001792#endif
1793#ifdef VM_UNUSED5
1794 { VM_UNUSED5, "VM_UNUSED5" },
1795#endif
1796#ifdef VM_PAGECACHE
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001797 { VM_PAGECACHE, "VM_PAGECACHE" },
Roland McGratha796fd02004-03-01 22:10:54 +00001798#endif
1799#ifdef VM_UNUSED7
1800 { VM_UNUSED7, "VM_UNUSED7" },
1801#endif
1802#ifdef VM_PAGERDAEMON
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001803 { VM_PAGERDAEMON, "VM_PAGERDAEMON" },
Roland McGratha796fd02004-03-01 22:10:54 +00001804#endif
1805#ifdef VM_UNUSED8
1806 { VM_UNUSED8, "VM_UNUSED8" },
1807#endif
1808#ifdef VM_PGT_CACHE
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001809 { VM_PGT_CACHE, "VM_PGT_CACHE" },
Roland McGratha796fd02004-03-01 22:10:54 +00001810#endif
1811#ifdef VM_UNUSED9
1812 { VM_UNUSED9, "VM_UNUSED9" },
1813#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001814 { VM_PAGE_CLUSTER, "VM_PAGE_CLUSTER" },
1815 { 0, NULL },
1816};
1817
Roland McGrathd9f816f2004-09-04 03:39:20 +00001818static const struct xlat sysctl_net[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001819 { NET_CORE, "NET_CORE" },
1820 { NET_ETHER, "NET_ETHER" },
1821 { NET_802, "NET_802" },
1822 { NET_UNIX, "NET_UNIX" },
1823 { NET_IPV4, "NET_IPV4" },
1824 { NET_IPX, "NET_IPX" },
1825 { NET_ATALK, "NET_ATALK" },
1826 { NET_NETROM, "NET_NETROM" },
1827 { NET_AX25, "NET_AX25" },
1828 { NET_BRIDGE, "NET_BRIDGE" },
1829 { NET_ROSE, "NET_ROSE" },
1830 { NET_IPV6, "NET_IPV6" },
1831 { NET_X25, "NET_X25" },
1832 { NET_TR, "NET_TR" },
1833 { NET_DECNET, "NET_DECNET" },
1834 { 0, NULL }
1835};
1836
Roland McGrathd9f816f2004-09-04 03:39:20 +00001837static const struct xlat sysctl_net_core[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001838 { NET_CORE_WMEM_MAX, "NET_CORE_WMEM_MAX" },
1839 { NET_CORE_RMEM_MAX, "NET_CORE_RMEM_MAX" },
1840 { NET_CORE_WMEM_DEFAULT, "NET_CORE_WMEM_DEFAULT" },
1841 { NET_CORE_RMEM_DEFAULT, "NET_CORE_RMEM_DEFAULT" },
1842 { NET_CORE_MAX_BACKLOG, "NET_CORE_MAX_BACKLOG" },
1843 { NET_CORE_FASTROUTE, "NET_CORE_FASTROUTE" },
1844 { NET_CORE_MSG_COST, "NET_CORE_MSG_COST" },
1845 { NET_CORE_MSG_BURST, "NET_CORE_MSG_BURST" },
1846 { NET_CORE_OPTMEM_MAX, "NET_CORE_OPTMEM_MAX" },
1847 { 0, NULL }
1848};
1849
Roland McGrathd9f816f2004-09-04 03:39:20 +00001850static const struct xlat sysctl_net_unix[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001851 { NET_UNIX_DESTROY_DELAY, "NET_UNIX_DESTROY_DELAY" },
1852 { NET_UNIX_DELETE_DELAY, "NET_UNIX_DELETE_DELAY" },
1853 { 0, NULL }
1854};
1855
Roland McGrathd9f816f2004-09-04 03:39:20 +00001856static const struct xlat sysctl_net_ipv4[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001857 { NET_IPV4_FORWARD, "NET_IPV4_FORWARD" },
1858 { NET_IPV4_DYNADDR, "NET_IPV4_DYNADDR" },
1859 { NET_IPV4_CONF, "NET_IPV4_CONF" },
1860 { NET_IPV4_NEIGH, "NET_IPV4_NEIGH" },
1861 { NET_IPV4_ROUTE, "NET_IPV4_ROUTE" },
1862 { NET_IPV4_FIB_HASH, "NET_IPV4_FIB_HASH" },
1863 { NET_IPV4_TCP_TIMESTAMPS, "NET_IPV4_TCP_TIMESTAMPS" },
1864 { NET_IPV4_TCP_WINDOW_SCALING, "NET_IPV4_TCP_WINDOW_SCALING" },
1865 { NET_IPV4_TCP_SACK, "NET_IPV4_TCP_SACK" },
1866 { NET_IPV4_TCP_RETRANS_COLLAPSE, "NET_IPV4_TCP_RETRANS_COLLAPSE" },
1867 { NET_IPV4_DEFAULT_TTL, "NET_IPV4_DEFAULT_TTL" },
1868 { NET_IPV4_AUTOCONFIG, "NET_IPV4_AUTOCONFIG" },
1869 { NET_IPV4_NO_PMTU_DISC, "NET_IPV4_NO_PMTU_DISC" },
1870 { NET_IPV4_TCP_SYN_RETRIES, "NET_IPV4_TCP_SYN_RETRIES" },
1871 { NET_IPV4_IPFRAG_HIGH_THRESH, "NET_IPV4_IPFRAG_HIGH_THRESH" },
1872 { NET_IPV4_IPFRAG_LOW_THRESH, "NET_IPV4_IPFRAG_LOW_THRESH" },
1873 { NET_IPV4_IPFRAG_TIME, "NET_IPV4_IPFRAG_TIME" },
1874 { NET_IPV4_TCP_MAX_KA_PROBES, "NET_IPV4_TCP_MAX_KA_PROBES" },
1875 { NET_IPV4_TCP_KEEPALIVE_TIME, "NET_IPV4_TCP_KEEPALIVE_TIME" },
1876 { NET_IPV4_TCP_KEEPALIVE_PROBES, "NET_IPV4_TCP_KEEPALIVE_PROBES" },
1877 { NET_IPV4_TCP_RETRIES1, "NET_IPV4_TCP_RETRIES1" },
1878 { NET_IPV4_TCP_RETRIES2, "NET_IPV4_TCP_RETRIES2" },
1879 { NET_IPV4_TCP_FIN_TIMEOUT, "NET_IPV4_TCP_FIN_TIMEOUT" },
1880 { NET_IPV4_IP_MASQ_DEBUG, "NET_IPV4_IP_MASQ_DEBUG" },
1881 { NET_TCP_SYNCOOKIES, "NET_TCP_SYNCOOKIES" },
1882 { NET_TCP_STDURG, "NET_TCP_STDURG" },
1883 { NET_TCP_RFC1337, "NET_TCP_RFC1337" },
1884 { NET_TCP_SYN_TAILDROP, "NET_TCP_SYN_TAILDROP" },
1885 { NET_TCP_MAX_SYN_BACKLOG, "NET_TCP_MAX_SYN_BACKLOG" },
1886 { NET_IPV4_LOCAL_PORT_RANGE, "NET_IPV4_LOCAL_PORT_RANGE" },
1887 { NET_IPV4_ICMP_ECHO_IGNORE_ALL, "NET_IPV4_ICMP_ECHO_IGNORE_ALL" },
1888 { NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS" },
1889 { NET_IPV4_ICMP_SOURCEQUENCH_RATE, "NET_IPV4_ICMP_SOURCEQUENCH_RATE" },
1890 { NET_IPV4_ICMP_DESTUNREACH_RATE, "NET_IPV4_ICMP_DESTUNREACH_RATE" },
1891 { NET_IPV4_ICMP_TIMEEXCEED_RATE, "NET_IPV4_ICMP_TIMEEXCEED_RATE" },
1892 { NET_IPV4_ICMP_PARAMPROB_RATE, "NET_IPV4_ICMP_PARAMPROB_RATE" },
1893 { NET_IPV4_ICMP_ECHOREPLY_RATE, "NET_IPV4_ICMP_ECHOREPLY_RATE" },
1894 { NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES" },
1895 { NET_IPV4_IGMP_MAX_MEMBERSHIPS, "NET_IPV4_IGMP_MAX_MEMBERSHIPS" },
1896 { 0, NULL }
1897};
1898
Roland McGrathd9f816f2004-09-04 03:39:20 +00001899static const struct xlat sysctl_net_ipv4_route[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001900 { NET_IPV4_ROUTE_FLUSH, "NET_IPV4_ROUTE_FLUSH" },
1901 { NET_IPV4_ROUTE_MIN_DELAY, "NET_IPV4_ROUTE_MIN_DELAY" },
1902 { NET_IPV4_ROUTE_MAX_DELAY, "NET_IPV4_ROUTE_MAX_DELAY" },
1903 { NET_IPV4_ROUTE_GC_THRESH, "NET_IPV4_ROUTE_GC_THRESH" },
1904 { NET_IPV4_ROUTE_MAX_SIZE, "NET_IPV4_ROUTE_MAX_SIZE" },
1905 { NET_IPV4_ROUTE_GC_MIN_INTERVAL, "NET_IPV4_ROUTE_GC_MIN_INTERVAL" },
1906 { NET_IPV4_ROUTE_GC_TIMEOUT, "NET_IPV4_ROUTE_GC_TIMEOUT" },
1907 { NET_IPV4_ROUTE_GC_INTERVAL, "NET_IPV4_ROUTE_GC_INTERVAL" },
1908 { NET_IPV4_ROUTE_REDIRECT_LOAD, "NET_IPV4_ROUTE_REDIRECT_LOAD" },
1909 { NET_IPV4_ROUTE_REDIRECT_NUMBER, "NET_IPV4_ROUTE_REDIRECT_NUMBER" },
1910 { NET_IPV4_ROUTE_REDIRECT_SILENCE, "NET_IPV4_ROUTE_REDIRECT_SILENCE" },
1911 { NET_IPV4_ROUTE_ERROR_COST, "NET_IPV4_ROUTE_ERROR_COST" },
1912 { NET_IPV4_ROUTE_ERROR_BURST, "NET_IPV4_ROUTE_ERROR_BURST" },
1913 { NET_IPV4_ROUTE_GC_ELASTICITY, "NET_IPV4_ROUTE_GC_ELASTICITY" },
1914 { 0, NULL }
1915};
1916
Roland McGrathd9f816f2004-09-04 03:39:20 +00001917static const struct xlat sysctl_net_ipv4_conf[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001918 { NET_IPV4_CONF_FORWARDING, "NET_IPV4_CONF_FORWARDING" },
1919 { NET_IPV4_CONF_MC_FORWARDING, "NET_IPV4_CONF_MC_FORWARDING" },
1920 { NET_IPV4_CONF_PROXY_ARP, "NET_IPV4_CONF_PROXY_ARP" },
1921 { NET_IPV4_CONF_ACCEPT_REDIRECTS, "NET_IPV4_CONF_ACCEPT_REDIRECTS" },
1922 { NET_IPV4_CONF_SECURE_REDIRECTS, "NET_IPV4_CONF_SECURE_REDIRECTS" },
1923 { NET_IPV4_CONF_SEND_REDIRECTS, "NET_IPV4_CONF_SEND_REDIRECTS" },
1924 { NET_IPV4_CONF_SHARED_MEDIA, "NET_IPV4_CONF_SHARED_MEDIA" },
1925 { NET_IPV4_CONF_RP_FILTER, "NET_IPV4_CONF_RP_FILTER" },
1926 { NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, "NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE" },
1927 { NET_IPV4_CONF_BOOTP_RELAY, "NET_IPV4_CONF_BOOTP_RELAY" },
1928 { NET_IPV4_CONF_LOG_MARTIANS, "NET_IPV4_CONF_LOG_MARTIANS" },
1929 { 0, NULL }
1930};
1931
Roland McGrathd9f816f2004-09-04 03:39:20 +00001932static const struct xlat sysctl_net_ipv6[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001933 { NET_IPV6_CONF, "NET_IPV6_CONF" },
1934 { NET_IPV6_NEIGH, "NET_IPV6_NEIGH" },
1935 { NET_IPV6_ROUTE, "NET_IPV6_ROUTE" },
1936 { 0, NULL }
1937};
1938
Roland McGrathd9f816f2004-09-04 03:39:20 +00001939static const struct xlat sysctl_net_ipv6_route[] = {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001940 { NET_IPV6_ROUTE_FLUSH, "NET_IPV6_ROUTE_FLUSH" },
1941 { NET_IPV6_ROUTE_GC_THRESH, "NET_IPV6_ROUTE_GC_THRESH" },
1942 { NET_IPV6_ROUTE_MAX_SIZE, "NET_IPV6_ROUTE_MAX_SIZE" },
1943 { NET_IPV6_ROUTE_GC_MIN_INTERVAL, "NET_IPV6_ROUTE_GC_MIN_INTERVAL" },
1944 { NET_IPV6_ROUTE_GC_TIMEOUT, "NET_IPV6_ROUTE_GC_TIMEOUT" },
1945 { NET_IPV6_ROUTE_GC_INTERVAL, "NET_IPV6_ROUTE_GC_INTERVAL" },
1946 { NET_IPV6_ROUTE_GC_ELASTICITY, "NET_IPV6_ROUTE_GC_ELASTICITY" },
1947 { 0, NULL }
1948};
1949
1950int
1951sys_sysctl(tcp)
1952struct tcb *tcp;
1953{
1954 struct __sysctl_args info;
1955 int *name;
Roland McGrathaa524c82005-06-01 19:22:06 +00001956 unsigned long size;
1957
Roland McGrath2cbe44e2005-05-26 23:21:09 +00001958 if (umove (tcp, tcp->u_arg[0], &info) < 0)
1959 return printargs(tcp);
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001960
Roland McGrathaa524c82005-06-01 19:22:06 +00001961 size = sizeof (int) * (unsigned long) info.nlen;
1962 name = (size / sizeof (int) != info.nlen) ? NULL : malloc (size);
Roland McGrath2cbe44e2005-05-26 23:21:09 +00001963 if (name == NULL ||
Roland McGrathaa524c82005-06-01 19:22:06 +00001964 umoven(tcp, (unsigned long) info.name, size, (char *) name) < 0) {
1965 free(name);
1966 if (entering(tcp))
1967 tprintf("{%p, %d, %p, %p, %p, %Zu}",
1968 info.name, info.nlen, info.oldval,
1969 info.oldlenp, info.newval, info.newlen);
Roland McGrath2cbe44e2005-05-26 23:21:09 +00001970 return 0;
1971 }
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001972
1973 if (entering(tcp)) {
Roland McGrathaa524c82005-06-01 19:22:06 +00001974 int cnt = 0, max_cnt;
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001975
1976 tprintf("{{");
1977
1978 if (info.nlen == 0)
1979 goto out;
1980 printxval(sysctl_root, name[0], "CTL_???");
1981 ++cnt;
1982
1983 if (info.nlen == 1)
1984 goto out;
1985 switch (name[0]) {
1986 case CTL_KERN:
1987 tprintf(", ");
1988 printxval(sysctl_kern, name[1], "KERN_???");
1989 ++cnt;
1990 break;
1991 case CTL_VM:
1992 tprintf(", ");
1993 printxval(sysctl_vm, name[1], "VM_???");
1994 ++cnt;
1995 break;
1996 case CTL_NET:
1997 tprintf(", ");
1998 printxval(sysctl_net, name[1], "NET_???");
1999 ++cnt;
2000
2001 if (info.nlen == 2)
2002 goto out;
2003 switch (name[1]) {
2004 case NET_CORE:
2005 tprintf(", ");
2006 printxval(sysctl_net_core, name[2],
2007 "NET_CORE_???");
2008 break;
2009 case NET_UNIX:
2010 tprintf(", ");
2011 printxval(sysctl_net_unix, name[2],
2012 "NET_UNIX_???");
2013 break;
2014 case NET_IPV4:
2015 tprintf(", ");
2016 printxval(sysctl_net_ipv4, name[2],
2017 "NET_IPV4_???");
2018
2019 if (info.nlen == 3)
2020 goto out;
2021 switch (name[2]) {
2022 case NET_IPV4_ROUTE:
2023 tprintf(", ");
2024 printxval(sysctl_net_ipv4_route,
2025 name[3],
2026 "NET_IPV4_ROUTE_???");
2027 break;
2028 case NET_IPV4_CONF:
2029 tprintf(", ");
2030 printxval(sysctl_net_ipv4_conf,
2031 name[3],
2032 "NET_IPV4_CONF_???");
2033 break;
2034 default:
2035 goto out;
2036 }
2037 break;
2038 case NET_IPV6:
2039 tprintf(", ");
2040 printxval(sysctl_net_ipv6, name[2],
2041 "NET_IPV6_???");
2042
2043 if (info.nlen == 3)
2044 goto out;
2045 switch (name[2]) {
2046 case NET_IPV6_ROUTE:
2047 tprintf(", ");
2048 printxval(sysctl_net_ipv6_route,
2049 name[3],
2050 "NET_IPV6_ROUTE_???");
2051 break;
2052 default:
2053 goto out;
2054 }
2055 break;
2056 default:
2057 goto out;
2058 }
2059 break;
2060 default:
2061 goto out;
2062 }
2063 out:
Roland McGrath8e4a3e62006-01-12 11:03:46 +00002064 max_cnt = info.nlen;
2065 if (abbrev(tcp) && max_cnt > max_strlen)
2066 max_cnt = max_strlen;
Roland McGrathaa524c82005-06-01 19:22:06 +00002067 while (cnt < max_cnt)
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002068 tprintf(", %x", name[cnt++]);
Roland McGrathaa524c82005-06-01 19:22:06 +00002069 if (cnt < info.nlen)
2070 tprintf(", ...");
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002071 tprintf("}, %d, ", info.nlen);
2072 } else {
2073 size_t oldlen;
Roland McGrathaa524c82005-06-01 19:22:06 +00002074 if (umove(tcp, (size_t)info.oldlenp, &oldlen) >= 0
2075 && info.nlen >= 2
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002076 && ((name[0] == CTL_KERN
2077 && (name[1] == KERN_OSRELEASE
2078 || name[1] == KERN_OSTYPE
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00002079#ifdef KERN_JAVA_INTERPRETER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002080 || name[1] == KERN_JAVA_INTERPRETER
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00002081#endif
2082#ifdef KERN_JAVA_APPLETVIEWER
2083 || name[1] == KERN_JAVA_APPLETVIEWER
2084#endif
2085 )))) {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002086 printpath(tcp, (size_t)info.oldval);
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +00002087 tprintf(", %Zu, ", oldlen);
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002088 if (info.newval == 0)
2089 tprintf("NULL");
2090 else if (syserror(tcp))
2091 tprintf("%p", info.newval);
2092 else
2093 printpath(tcp, (size_t)info.newval);
2094 tprintf(", %Zd", info.newlen);
2095 } else {
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +00002096 tprintf("%p, %Zd, %p, %Zd", info.oldval, oldlen,
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002097 info.newval, info.newlen);
2098 }
2099 tprintf("}");
2100 }
Roland McGrath2cbe44e2005-05-26 23:21:09 +00002101
2102 free(name);
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00002103 return 0;
2104}
2105#else
2106int sys_sysctl(tcp)
2107struct tcb *tcp;
2108{
2109 return printargs(tcp);
2110}
2111#endif
2112
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00002113#ifdef FREEBSD
2114#include <sys/sysctl.h>
2115
2116int sys___sysctl(tcp)
2117struct tcb *tcp;
2118{
2119 int qoid[CTL_MAXNAME+2];
2120 char ctl[1024];
2121 size_t len;
2122 int i, numeric;
Roland McGrathced50da2004-08-31 06:48:46 +00002123
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00002124 if (entering(tcp)) {
2125 if (tcp->u_arg[1] < 0 || tcp->u_arg[1] > CTL_MAXNAME ||
2126 (umoven(tcp, tcp->u_arg[0], tcp->u_arg[1] * sizeof(int),
2127 (char *) (qoid + 2)) < 0))
2128 tprintf("[...], ");
2129 else {
2130 /* Use sysctl to ask the name of the current MIB
2131 This uses the undocumented "Staff-functions" used
2132 by the sysctl program. See kern_sysctl.c for
2133 details. */
2134 qoid[0] = 0; /* sysctl */
2135 qoid[1] = 1; /* name */
2136 i = sizeof(ctl);
2137 tprintf("[");
2138 if (sysctl(qoid, tcp->u_arg[1] + 2, ctl, &i, 0, 0) >= 0) {
2139 numeric = !abbrev(tcp);
2140 tprintf("%s%s", ctl, numeric ? ", " : "");
2141 } else
2142 numeric = 1;
2143 if (numeric) {
2144 for (i = 0; i < tcp->u_arg[1]; i++)
2145 tprintf("%s%d", i ? "." : "", qoid[i + 2]);
2146 }
2147 tprintf("], ");
2148 tprintf("%lu, ", tcp->u_arg[1]);
2149 }
2150 } else {
2151 if (!syserror(tcp) && (umove(tcp, tcp->u_arg[3], &len) >= 0)) {
2152 printstr(tcp, tcp->u_arg[2], len);
2153 tprintf(", [%u], ", len);
Roland McGrathced50da2004-08-31 06:48:46 +00002154 } else
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00002155 tprintf("%#lx, %#lx, ", tcp->u_arg[2], tcp->u_arg[3]);
2156 printstr(tcp, tcp->u_arg[4], tcp->u_arg[5]);
2157 tprintf(", %lu", tcp->u_arg[5]);
2158 }
2159 return 0;
2160}
2161#endif
Wichert Akkerman16a03d22000-08-10 02:14:04 +00002162
2163#if UNIXWARE >= 2
2164
2165#include <sys/ksym.h>
2166#include <sys/elf.h>
2167
Roland McGrathd9f816f2004-09-04 03:39:20 +00002168static const struct xlat ksym_flags[] = {
Roland McGrathced50da2004-08-31 06:48:46 +00002169 { STT_NOTYPE, "STT_NOTYPE" },
2170 { STT_FUNC, "STT_FUNC" },
2171 { STT_OBJECT, "STT_OBJECT" },
Wichert Akkerman16a03d22000-08-10 02:14:04 +00002172 { 0, NULL },
2173};
2174
2175int
2176sys_getksym(tcp)
2177struct tcb *tcp;
2178{
2179 if (entering (tcp)) {
2180 printstr(tcp, tcp->u_arg[0], -1);
2181 tprintf(", ");
2182 }
2183 else {
2184 if (syserror(tcp)) {
2185 tprintf("%#lx, %#lx",
2186 tcp->u_arg[1], tcp->u_arg[2]);
2187 }
2188 else {
2189 int val;
2190 printnum (tcp, tcp->u_arg[1], "%#lx");
2191 tprintf(", ");
2192 if (umove(tcp, tcp->u_arg[2], &val) < 0) {
2193 tprintf("%#lx", tcp->u_arg[2]);
2194 }
2195 else {
2196 tprintf("[");
2197 printxval (ksym_flags, val, "STT_???");
2198 tprintf("]");
2199 }
2200 }
2201 }
2202
2203 return 0;
2204}
2205
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002206#ifdef HAVE_SYS_NSCSYS_H
John Hughes4e36a812001-04-18 15:11:51 +00002207
John Hughes0aadba42001-10-16 18:19:52 +00002208struct cred;
John Hughes4e36a812001-04-18 15:11:51 +00002209#include <sys/nscsys.h>
2210
Roland McGrathd9f816f2004-09-04 03:39:20 +00002211static const struct xlat ssi_cmd [] = {
John Hughes4e36a812001-04-18 15:11:51 +00002212 { SSISYS_BADOP, "SSISYS_BADOP" },
2213 { SSISYS_LDLVL_INIT,"SSISYS_LDLVL_INIT"},
2214 { SSISYS_LDLVL_GETVEC,"SSISYS_LDLVL_GETVEC"},
2215 { SSISYS_LDLVL_PUTVEC,"SSISYS_LDLVL_PUTVEC"},
2216 { SSISYS_LDLVL_PUTRCMDS,"SSISYS_LDLVL_PUTRCMDS"},
2217 { SSISYS_LDLVL_SETREXEC,"SSISYS_LDLVL_SETREXEC"},
2218 { SSISYS_CMS_CLUSTERID,"SSISYS_CMS_CLUSTERID"},
2219 { SSISYS_CFS_STATVFS,"SSISYS_CFS_STATVFS"},
2220 { SSISYS_NODE_GETNUM,"SSISYS_NODE_GETNUM"},
2221 { SSISYS_NODE_TABLE,"SSISYS_NODE_TABLE"},
2222 { SSISYS_NODE_DOWN,"SSISYS_NODE_DOWN"},
2223 { SSISYS_RECLAIM_CHILD,"SSISYS_RECLAIM_CHILD"},
2224 { SSISYS_IPC_GETINFO,"SSISYS_IPC_GETINFO"},
2225 { SSISYS_ICS_TEST,"SSISYS_ICS_TEST"},
2226 { SSISYS_NODE_PID,"SSISYS_NODE_PID"},
2227 { SSISYS_ISLOCAL,"SSISYS_ISLOCAL"},
2228 { SSISYS_CFS_ISSTACKED,"SSISYS_CFS_ISSTACKED"},
2229 { SSISYS_DNET_SYNC,"SSISYS_DNET_SYNC"},
2230 { SSISYS_CFS_WAIT_MODE,"SSISYS_CFS_WAIT_MODE"},
2231 { SSISYS_CFS_UMOUNT,"SSISYS_CFS_UMOUNT"},
2232 { SSISYS_LLSTAT,"SSISYS_LLSTAT" },
2233 { SSISYS_LTS_PERFTEST,"SSISYS_LTS_PERFTEST"},
2234 { SSISYS_LTS_CONFIG,"SSISYS_LTS_CONFIG"},
2235 { SSISYS_SNET_PERFTEST,"SSISYS_SNET_PERFTEST"},
2236 { SSISYS_IGNORE_HALFUP,"SSISYS_IGNORE_HALFUP"},
2237 { SSISYS_NODE_ROOTDEV,"SSISYS_NODE_ROOTDEV"},
2238 { SSISYS_GET_PRIMARY,"SSISYS_GET_PRIMARY"},
2239 { SSISYS_GET_SECONDARY,"SSISYS_GET_SECONDARY"},
2240 { SSISYS_GET_ROOTDISK,"SSISYS_GET_ROOTDISK"},
2241 { SSISYS_CLUSTERNODE_NUM,"SSISYS_CLUSTERNODE_NUM"},
2242 { SSISYS_CLUSTER_MEMBERSHIP,"SSISYS_CLUSTER_MEMBERSHIP"},
2243 { SSISYS_CLUSTER_DETAILEDTRANS,"SSISYS_CLUSTER_DETAILEDTRANS"},
2244 { SSISYS_CLUSTERNODE_INFO,"SSISYS_CLUSTERNODE_INFO"},
2245 { SSISYS_CLUSTERNODE_SETINFO,"SSISYS_CLUSTERNODE_SETINFO"},
2246 { SSISYS_CLUSTERNODE_AVAIL,"SSISYS_CLUSTERNODE_AVAIL"},
2247 { SSISYS_CLUSTER_MAXNODES,"SSISYS_CLUSTER_MAXNODES"},
2248 { SSISYS_SET_MEMPRIO,"SSISYS_SET_MEMPRIO"},
2249 { SSISYS_GET_USERS,"SSISYS_GET_USERS"},
2250 { SSISYS_FORCE_ROOT_NODE,"SSISYS_FORCE_ROOT_NODE"},
2251 { SSISYS_CVIP_SET,"SSISYS_CVIP_SET"},
2252 { SSISYS_CVIP_GET,"SSISYS_CVIP_GET"},
2253 { SSISYS_GET_NODE_COUNTS,"SSISYS_GET_NODE_COUNTS"},
2254 { SSISYS_GET_TRANSPORT,"SSISYS_GET_TRANSPORT"},
2255 { 0, NULL },
2256};
2257
2258int sys_ssisys (tcp)
2259struct tcb *tcp;
2260{
2261 struct ssisys_iovec iov;
John Hughes2d8b2c52001-10-18 14:52:24 +00002262 cls_nodeinfo_args_t cni;
2263 clusternode_info_t info;
2264
John Hughes4e36a812001-04-18 15:11:51 +00002265 if (entering (tcp)) {
John Hughes0aadba42001-10-16 18:19:52 +00002266 ts_reclaim_child_inargs_t trc;
John Hughes4e36a812001-04-18 15:11:51 +00002267 if (tcp->u_arg[1] != sizeof iov ||
2268 umove (tcp, tcp->u_arg[0], &iov) < 0)
2269 {
2270 tprintf ("%#lx, %ld", tcp->u_arg[0], tcp->u_arg[1]);
2271 return 0;
2272 }
2273 tprintf ("{id=");
2274 printxval(ssi_cmd, iov.tio_id.id_cmd, "SSISYS_???");
2275 tprintf (":%d", iov.tio_id.id_ver);
2276 switch (iov.tio_id.id_cmd) {
John Hughes0aadba42001-10-16 18:19:52 +00002277 case SSISYS_RECLAIM_CHILD:
2278 if (iov.tio_udatainlen != sizeof trc ||
2279 umove (tcp, (long) iov.tio_udatain, &trc) < 0)
2280 goto bad;
2281 tprintf (", in={pid=%ld, start=%ld}",
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002282 trc.trc_pid, trc.trc_start);
John Hughes0aadba42001-10-16 18:19:52 +00002283 break;
2284 case SSISYS_CLUSTERNODE_INFO:
2285 if (iov.tio_udatainlen != sizeof cni ||
2286 umove (tcp, (long) iov.tio_udatain, &cni) < 0)
2287 goto bad;
2288 tprintf (", in={node=%ld, len=%d}",
2289 cni.nodenum, cni.info_len);
2290 break;
John Hughes4e36a812001-04-18 15:11:51 +00002291 default:
John Hughes0aadba42001-10-16 18:19:52 +00002292 bad:
John Hughes4e36a812001-04-18 15:11:51 +00002293 if (iov.tio_udatainlen) {
2294 tprintf (", in=[/* %d bytes */]",
2295 iov.tio_udatainlen);
2296 }
2297 }
2298 }
2299 else {
John Hughes2d8b2c52001-10-18 14:52:24 +00002300 if (tcp->u_arg[1] != sizeof iov ||
2301 umove (tcp, tcp->u_arg[0], &iov) < 0)
2302 goto done;
John Hughes4e36a812001-04-18 15:11:51 +00002303 switch (iov.tio_id.id_cmd) {
John Hughes2d8b2c52001-10-18 14:52:24 +00002304 case SSISYS_CLUSTERNODE_INFO:
2305 if (iov.tio_udatainlen != sizeof cni ||
2306 umove (tcp, (long) iov.tio_udatain, &cni) < 0)
2307 goto bad_out;
Roland McGrathced50da2004-08-31 06:48:46 +00002308 if (cni.info_len != sizeof info ||
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002309 iov.tio_udataoutlen != sizeof &info ||
John Hughes2d8b2c52001-10-18 14:52:24 +00002310 umove (tcp, (long) iov.tio_udataout, &info) < 0)
2311 goto bad_out;
2312 tprintf (", out={node=%ld, cpus=%d, online=%d}",
2313 info.node_num, info.node_totalcpus,
2314 info.node_onlinecpus);
2315 break;
Roland McGrathced50da2004-08-31 06:48:46 +00002316
John Hughes4e36a812001-04-18 15:11:51 +00002317 default:
John Hughes2d8b2c52001-10-18 14:52:24 +00002318 bad_out:
John Hughes4e36a812001-04-18 15:11:51 +00002319 if (iov.tio_udataoutlen) {
2320 tprintf (", out=[/* %d bytes */]",
2321 iov.tio_udataoutlen);
2322 }
2323 }
John Hughes2d8b2c52001-10-18 14:52:24 +00002324 done:
John Hughes4e36a812001-04-18 15:11:51 +00002325 tprintf ("}, %ld", tcp->u_arg[1]);
2326 }
2327 return 0;
2328}
2329
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002330#endif
John Hughes4e36a812001-04-18 15:11:51 +00002331
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002332#endif /* UNIXWARE > 2 */
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002333
2334#ifdef MIPS
2335
Wichert Akkermand6b92492001-04-07 21:37:12 +00002336#ifndef __NEW_UTS_LEN
2337#define __NEW_UTS_LEN 64
2338#endif
2339
Roland McGrathd9f816f2004-09-04 03:39:20 +00002340static const struct xlat sysmips_operations[] = {
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002341 { SETNAME, "SETNAME" },
2342 { FLUSH_CACHE, "FLUSH_CACHE" },
2343 { MIPS_FIXADE, "MIPS_FIXADE" },
2344 { MIPS_RDNVRAM, "MIPS_RDNVRAM" },
2345 { MIPS_ATOMIC_SET, "MIPS_ATOMIC_SET" },
2346 { 0, NULL }
2347};
2348
2349int sys_sysmips(tcp)
2350struct tcb *tcp;
2351{
2352 if (entering(tcp)) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002353 printxval(sysmips_operations, tcp->u_arg[0], "???");
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002354 if (!verbose(tcp)) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002355 tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002356 } else if (tcp->u_arg[0]==SETNAME) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002357 char nodename[__NEW_UTS_LEN + 1];
2358 if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), nodename) < 0)
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002359 tprintf(", %#lx", tcp->u_arg[1]);
2360 else
2361 tprintf(", \"%s\"", nodename);
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002362 } else if (tcp->u_arg[0] == MIPS_ATOMIC_SET) {
2363 tprintf(", %#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]);
2364 } else if (tcp->u_arg[0] == MIPS_FIXADE) {
2365 tprintf(", 0x%lx", tcp->u_arg[1]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002366 } else {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002367 tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002368 }
2369 }
2370
2371 return 0;
2372}
2373
2374#endif /* MIPS */