blob: 2da801cbedeea9091d70d1bce0cabad6383f856f [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
39#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
46#include <sys/socket.h>
47#include <netinet/in.h>
48#include <arpa/inet.h>
49
Nate Sammons8d5860c1999-07-03 18:53:05 +000050#include <sys/syscall.h>
51
Nate Sammons8d5860c1999-07-03 18:53:05 +000052#ifdef SYS_capget
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000053#include <linux/capability.h>
54#endif
55
Nate Sammons8d5860c1999-07-03 18:53:05 +000056#ifdef SYS_cacheflush
Wichert Akkerman2e2553a1999-05-09 00:29:58 +000057#include <asm/cachectl.h>
58#endif
59
Wichert Akkermand6b92492001-04-07 21:37:12 +000060#ifdef HAVE_LINUX_USTNAME_H
61#include <linux/utsname.h>
62#endif
63
Michal Ludvig39c0e942002-11-06 14:00:12 +000064#ifdef MIPS
Wichert Akkermand6b92492001-04-07 21:37:12 +000065#include <asm/sysmips.h>
66#endif
67
Wichert Akkerman22fe9d21999-05-27 12:00:57 +000068#include <linux/sysctl.h>
Wichert Akkerman22fe9d21999-05-27 12:00:57 +000069
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000070static struct xlat mount_flags[] = {
71 { MS_RDONLY, "MS_RDONLY" },
72 { MS_NOSUID, "MS_NOSUID" },
73 { MS_NODEV, "MS_NODEV" },
74 { MS_NOEXEC, "MS_NOEXEC" },
75#ifdef MS_SYNCHRONOUS
76 { MS_SYNCHRONOUS,"MS_SYNCHRONOUS"},
77#else
78 { MS_SYNC, "MS_SYNC" },
79#endif
80 { MS_REMOUNT, "MS_REMOUNT" },
81 { 0, NULL },
82};
83
84int
85sys_mount(tcp)
86struct tcb *tcp;
87{
88 if (entering(tcp)) {
89 printpath(tcp, tcp->u_arg[0]);
90 tprintf(", ");
91 printpath(tcp, tcp->u_arg[1]);
92 tprintf(", ");
93 printpath(tcp, tcp->u_arg[2]);
94 tprintf(", ");
95 printflags(mount_flags, tcp->u_arg[3]);
96 tprintf(", %#lx", tcp->u_arg[4]);
97 }
98 return 0;
99}
100
Wichert Akkermandacfb6e1999-06-03 14:21:07 +0000101int
102sys_umount2(tcp)
103struct tcb *tcp;
104{
105 if (entering(tcp)) {
106 printstr(tcp, tcp->u_arg[0], -1);
107 tprintf(", ");
108 if (tcp->u_arg[1] & 1)
109 tprintf("MNT_FORCE");
110 else
111 tprintf("0");
112 }
113 return 0;
114}
115
Roland McGrathced50da2004-08-31 06:48:46 +0000116/* These are not macros, but enums. We just copy the values by hand
117 from Linux 2.6.9 here. */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000118static struct xlat personality_options[] = {
Roland McGrathced50da2004-08-31 06:48:46 +0000119 { 0, "PER_LINUX" },
120 { 0x00800000, "PER_LINUX_32BIT"},
121 { 0x04100001, "PER_SVR4" },
122 { 0x05000002, "PER_SVR3" },
123 { 0x07000003, "PER_SCOSVR3" },
124 { 0x06000003, "PER_OSR5" },
125 { 0x05000004, "PER_WYSEV386" },
126 { 0x04000005, "PER_ISCR4" },
127 { 0x00000006, "PER_BSD" },
128 { 0x04000006, "PER_SUNOS" },
129 { 0x05000007, "PER_XENIX" },
130 { 0x00000008, "PER_LINUX32" },
131 { 0x08000008, "PER_LINUX32_3GB"},
132 { 0x04000009, "PER_IRIX32" },
133 { 0x0400000a, "PER_IRIXN32" },
134 { 0x0400000b, "PER_IRIX64" },
135 { 0x0000000c, "PER_RISCOS" },
136 { 0x0400000d, "PER_SOLARIS" },
137 { 0x0410000e, "PER_UW7" },
138 { 0x0000000f, "PER_OSF4" },
139 { 0x00000010, "PER_HPUX" },
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000140 { 0, NULL },
141};
142
143int
144sys_personality(tcp)
145struct tcb *tcp;
146{
147 if (entering(tcp))
148 printxval(personality_options, tcp->u_arg[0], "PER_???");
149 return 0;
150}
151
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +0000152#include <linux/reboot.h>
153static struct xlat bootflags1[] = {
154 { LINUX_REBOOT_MAGIC1, "LINUX_REBOOT_MAGIC1" },
155 { 0, NULL },
156};
157
158static struct xlat bootflags2[] = {
159 { LINUX_REBOOT_MAGIC2, "LINUX_REBOOT_MAGIC2" },
160 { LINUX_REBOOT_MAGIC2A, "LINUX_REBOOT_MAGIC2A" },
161 { LINUX_REBOOT_MAGIC2B, "LINUX_REBOOT_MAGIC2B" },
162 { 0, NULL },
163};
164
165static struct xlat bootflags3[] = {
166 { LINUX_REBOOT_CMD_CAD_OFF, "LINUX_REBOOT_CMD_CAD_OFF" },
167 { LINUX_REBOOT_CMD_RESTART, "LINUX_REBOOT_CMD_RESTART" },
168 { LINUX_REBOOT_CMD_HALT, "LINUX_REBOOT_CMD_HALT" },
169 { LINUX_REBOOT_CMD_CAD_ON, "LINUX_REBOOT_CMD_CAD_ON" },
170 { LINUX_REBOOT_CMD_POWER_OFF, "LINUX_REBOOT_CMD_POWER_OFF" },
171 { LINUX_REBOOT_CMD_RESTART2, "LINUX_REBOOT_CMD_RESTART2" },
172 { 0, NULL },
173};
174
175int
176sys_reboot(tcp)
177struct tcb *tcp;
178{
179 if (entering(tcp)) {
180 if (!printflags(bootflags1, tcp->u_arg[0]))
181 tprintf("LINUX_REBOOT_MAGIC???");
182 tprintf(", ");
183 if (!printflags(bootflags2, tcp->u_arg[1]))
184 tprintf("LINUX_REBOOT_MAGIC???");
185 tprintf(", ");
186 if (!printflags(bootflags3, tcp->u_arg[2]))
187 tprintf("LINUX_REBOOT_CMD_???");
188 if (tcp->u_arg[2] == LINUX_REBOOT_CMD_RESTART2) {
189 tprintf(", ");
190 printstr(tcp, tcp->u_arg[3], -1);
191 }
192 }
193 return 0;
194}
195
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000196#ifdef M68K
197static struct xlat cacheflush_scope[] = {
198#ifdef FLUSH_SCOPE_LINE
199 { FLUSH_SCOPE_LINE, "FLUSH_SCOPE_LINE" },
200#endif
201#ifdef FLUSH_SCOPE_PAGE
202 { FLUSH_SCOPE_PAGE, "FLUSH_SCOPE_PAGE" },
203#endif
204#ifdef FLUSH_SCOPE_ALL
205 { FLUSH_SCOPE_ALL, "FLUSH_SCOPE_ALL" },
206#endif
207 { 0, NULL },
208};
209
210static struct xlat cacheflush_flags[] = {
211#ifdef FLUSH_CACHE_BOTH
212 { FLUSH_CACHE_BOTH, "FLUSH_CACHE_BOTH" },
213#endif
214#ifdef FLUSH_CACHE_DATA
215 { FLUSH_CACHE_DATA, "FLUSH_CACHE_DATA" },
216#endif
217#ifdef FLUSH_CACHE_INSN
218 { FLUSH_CACHE_INSN, "FLUSH_CACHE_INSN" },
219#endif
220 { 0, NULL },
221};
222
223int
224sys_cacheflush(tcp)
225struct tcb *tcp;
226{
227 if (entering(tcp)) {
228 /* addr */
229 tprintf("%#lx, ", tcp->u_arg[0]);
230 /* scope */
231 printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???");
232 tprintf(", ");
233 /* flags */
234 printflags(cacheflush_flags, tcp->u_arg[2]);
235 /* len */
236 tprintf(", %lu", tcp->u_arg[3]);
237 }
238 return 0;
239}
240#endif /* M68K */
241
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000242#endif /* LINUX */
243
244#ifdef SUNOS4
245
246#include <sys/reboot.h>
247#define NFSCLIENT
248#define LOFS
249#define RFS
250#define PCFS
251#include <sys/mount.h>
252#include <sys/socket.h>
253#include <nfs/export.h>
254#include <rpc/types.h>
255#include <rpc/auth.h>
256
257/*ARGSUSED*/
258int
259sys_sync(tcp)
260struct tcb *tcp;
261{
262 return 0;
263}
264
265static struct xlat bootflags[] = {
266 { RB_AUTOBOOT, "RB_AUTOBOOT" }, /* for system auto-booting itself */
267 { RB_ASKNAME, "RB_ASKNAME" }, /* ask for file name to reboot from */
268 { RB_SINGLE, "RB_SINGLE" }, /* reboot to single user only */
269 { RB_NOSYNC, "RB_NOSYNC" }, /* dont sync before reboot */
270 { RB_HALT, "RB_HALT" }, /* don't reboot, just halt */
271 { RB_INITNAME, "RB_INITNAME" }, /* name given for /etc/init */
272 { RB_NOBOOTRC, "RB_NOBOOTRC" }, /* don't run /etc/rc.boot */
273 { RB_DEBUG, "RB_DEBUG" }, /* being run under debugger */
274 { RB_DUMP, "RB_DUMP" }, /* dump system core */
275 { RB_WRITABLE, "RB_WRITABLE" }, /* mount root read/write */
276 { RB_STRING, "RB_STRING" }, /* pass boot args to prom monitor */
277 { 0, NULL },
278};
279
280int
281sys_reboot(tcp)
282struct tcb *tcp;
283{
284 if (entering(tcp)) {
285 if (!printflags(bootflags, tcp->u_arg[0]))
286 tprintf("RB_???");
287 if (tcp->u_arg[0] & RB_STRING) {
288 printstr(tcp, tcp->u_arg[1], -1);
289 }
290 }
291 return 0;
292}
293
294int
295sys_sysacct(tcp)
296struct tcb *tcp;
297{
298 if (entering(tcp)) {
299 printstr(tcp, tcp->u_arg[0], -1);
300 }
301 return 0;
302}
303
304int
305sys_swapon(tcp)
306struct tcb *tcp;
307{
308 if (entering(tcp)) {
309 printstr(tcp, tcp->u_arg[0], -1);
310 }
311 return 0;
312}
313
314int
315sys_nfs_svc(tcp)
316struct tcb *tcp;
317{
318 if (entering(tcp)) {
319 printsock(tcp, tcp->u_arg[0]);
320 }
321 return 0;
322}
323
324static struct xlat mountflags[] = {
325 { M_RDONLY, "M_RDONLY" },
326 { M_NOSUID, "M_NOSUID" },
327 { M_NEWTYPE, "M_NEWTYPE" },
328 { M_GRPID, "M_GRPID" },
329#ifdef M_REMOUNT
330 { M_REMOUNT, "M_REMOUNT" },
331#endif
332#ifdef M_NOSUB
333 { M_NOSUB, "M_NOSUB" },
334#endif
335#ifdef M_MULTI
336 { M_MULTI, "M_MULTI" },
337#endif
338#ifdef M_SYS5
339 { M_SYS5, "M_SYS5" },
340#endif
341 { 0, NULL },
342};
343
344static struct xlat nfsflags[] = {
345 { NFSMNT_SOFT, "NFSMNT_SOFT" },
346 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
347 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
348 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
349 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
350 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
351 { NFSMNT_INT, "NFSMNT_INT" },
352 { NFSMNT_NOAC, "NFSMNT_NOAC" },
353 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
354 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
355 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
356 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
357#ifdef NFSMNT_SECURE
358 { NFSMNT_SECURE, "NFSMNT_SECURE" },
359#endif
360#ifdef NFSMNT_NOCTO
361 { NFSMNT_NOCTO, "NFSMNT_NOCTO" },
362#endif
363#ifdef NFSMNT_POSIX
364 { NFSMNT_POSIX, "NFSMNT_POSIX" },
365#endif
366 { 0, NULL },
367};
368
369int
370sys_mount(tcp)
371struct tcb *tcp;
372{
373 char type[4];
374
375 if (entering(tcp)) {
376 if (!(tcp->u_arg[2] & M_NEWTYPE) || umovestr(tcp,
377 tcp->u_arg[0], sizeof type, type) < 0) {
378 tprintf("OLDTYPE:#%lx", tcp->u_arg[0]);
379 } else {
380 tprintf("\"%s\", ", type);
381 }
382 printstr(tcp, tcp->u_arg[1], -1);
383 tprintf(", ");
384 if (!printflags(mountflags, tcp->u_arg[2] & ~M_NEWTYPE))
385 tprintf("0");
386 tprintf(", ");
387
388 if (strcmp(type, "4.2") == 0) {
389 struct ufs_args a;
390 if (umove(tcp, tcp->u_arg[3], &a) < 0)
391 return 0;
392 printstr(tcp, (int)a.fspec, -1);
393 } else if (strcmp(type, "lo") == 0) {
394 struct lo_args a;
395 if (umove(tcp, tcp->u_arg[3], &a) < 0)
396 return 0;
397 printstr(tcp, (int)a.fsdir, -1);
398 } else if (strcmp(type, "nfs") == 0) {
399 struct nfs_args a;
400 if (umove(tcp, tcp->u_arg[3], &a) < 0)
401 return 0;
402 tprintf("[");
403 printsock(tcp, (int) a.addr);
404 tprintf(", ");
405 if (!printflags(nfsflags, a.flags))
406 tprintf("NFSMNT_???");
407 tprintf(", ws:%u,rs:%u,to:%u,re:%u,",
408 a.wsize, a.rsize, a.timeo, a.retrans);
409 if (a.flags & NFSMNT_HOSTNAME && a.hostname)
410 printstr(tcp, (int)a.hostname, -1);
411 else
412 tprintf("%#lx", (unsigned long) a.hostname);
413 tprintf(",reg-min:%u,max:%u,dir-min:%u,max:%u,",
414 a.acregmin, a.acregmax, a.acdirmin, a.acdirmax);
415 if ((a.flags & NFSMNT_SECURE) && a.netname)
416 printstr(tcp, (int) a.netname, -1);
417 else
418 tprintf("%#lx", (unsigned long) a.netname);
419 tprintf("]");
420 } else if (strcmp(type, "rfs") == 0) {
421 struct rfs_args a;
422 struct token t;
423 if (umove(tcp, tcp->u_arg[3], &a) < 0)
424 return 0;
425 tprintf("[");
426 printstr(tcp, (int)a.rmtfs, -1);
427 if (umove(tcp, (int)a.token, &t) < 0)
428 return 0;
429 tprintf(", %u, %s]", t.t_id, t.t_uname);
430 } else if (strcmp(type, "pcfs") == 0) {
431 struct pc_args a;
432 if (umove(tcp, tcp->u_arg[3], &a) < 0)
433 return 0;
434 printstr(tcp, (int)a.fspec, -1);
435 }
436 }
437 return 0;
438}
439
440int
441sys_unmount(tcp)
442struct tcb *tcp;
443{
444 if (entering(tcp)) {
445 printstr(tcp, tcp->u_arg[0], -1);
446 }
447 return 0;
448}
449
450int
451sys_umount(tcp)
452struct tcb *tcp;
453{
454 return sys_unmount(tcp);
455}
456
457int
458sys_auditsys(tcp)
459struct tcb *tcp;
460{
461 /* XXX - no information available */
462 return printargs(tcp);
463}
464
465static struct xlat ex_auth_flags[] = {
466 { AUTH_UNIX, "AUTH_UNIX" },
467 { AUTH_DES, "AUTH_DES" },
468 { 0, NULL },
469};
470
471int
472sys_exportfs(tcp)
473struct tcb *tcp;
474{
475 struct export e;
476 int i;
477
478 if (entering(tcp)) {
479 printstr(tcp, tcp->u_arg[0], -1);
480 if (umove(tcp, tcp->u_arg[1], &e) < 0) {
481 tprintf("%#lx", tcp->u_arg[1]);
482 return 0;
483 }
484 tprintf("{fl:%u, anon:%u, ", e.ex_flags, e.ex_anon);
485 printxval(ex_auth_flags, e.ex_auth, "AUTH_???");
486 tprintf(", roots:[");
487 if (e.ex_auth == AUTH_UNIX) {
488 for (i=0; i<e.ex_u.exunix.rootaddrs.naddrs; i++) {
489 printsock(tcp,
490 (int)&e.ex_u.exunix.rootaddrs.addrvec[i]);
491 }
492 tprintf("], writers:[");
493 for (i=0; i<e.ex_writeaddrs.naddrs; i++) {
494 printsock(tcp,
495 (int)&e.ex_writeaddrs.addrvec[i]);
496 }
497 tprintf("]");
498 } else {
499 for (i=0; i<e.ex_u.exdes.nnames; i++) {
500 printsock(tcp,
501 (int)&e.ex_u.exdes.rootnames[i]);
502 tprintf(", ");
503 }
504 tprintf("], window:%u", e.ex_u.exdes.window);
505 }
506 tprintf("}");
507 }
508 return 0;
509}
510
511static struct xlat sysconflimits[] = {
512#ifdef _SC_ARG_MAX
513 { _SC_ARG_MAX, "_SC_ARG_MAX" }, /* space for argv & envp */
514#endif
515#ifdef _SC_CHILD_MAX
516 { _SC_CHILD_MAX, "_SC_CHILD_MAX" }, /* maximum children per process??? */
517#endif
518#ifdef _SC_CLK_TCK
519 { _SC_CLK_TCK, "_SC_CLK_TCK" }, /* clock ticks/sec */
520#endif
521#ifdef _SC_NGROUPS_MAX
522 { _SC_NGROUPS_MAX, "_SC_NGROUPS_MAX" }, /* number of groups if multple supp. */
523#endif
524#ifdef _SC_OPEN_MAX
525 { _SC_OPEN_MAX, "_SC_OPEN_MAX" }, /* max open files per process */
526#endif
527#ifdef _SC_JOB_CONTROL
528 { _SC_JOB_CONTROL, "_SC_JOB_CONTROL" }, /* do we have job control */
529#endif
530#ifdef _SC_SAVED_IDS
531 { _SC_SAVED_IDS, "_SC_SAVED_IDS" }, /* do we have saved uid/gids */
532#endif
533#ifdef _SC_VERSION
534 { _SC_VERSION, "_SC_VERSION" }, /* POSIX version supported */
535#endif
536 { 0, NULL },
537};
538
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000539int
540sys_sysconf(tcp)
541struct tcb *tcp;
542{
543 if (entering(tcp)) {
544 printxval(sysconflimits, tcp->u_arg[0], "_SC_???");
545 }
546 return 0;
547}
548
549#endif /* SUNOS4 */
550
551#if defined(SUNOS4) || defined(FREEBSD)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000552static struct xlat pathconflimits[] = {
553#ifdef _PC_LINK_MAX
554 { _PC_LINK_MAX, "_PC_LINK_MAX" }, /* max links to file/dir */
555#endif
556#ifdef _PC_MAX_CANON
557 { _PC_MAX_CANON, "_PC_MAX_CANON" }, /* max line length */
558#endif
559#ifdef _PC_MAX_INPUT
560 { _PC_MAX_INPUT, "_PC_MAX_INPUT" }, /* max "packet" to a tty device */
561#endif
562#ifdef _PC_NAME_MAX
563 { _PC_NAME_MAX, "_PC_NAME_MAX" }, /* max pathname component length */
564#endif
565#ifdef _PC_PATH_MAX
566 { _PC_PATH_MAX, "_PC_PATH_MAX" }, /* max pathname length */
567#endif
568#ifdef _PC_PIPE_BUF
569 { _PC_PIPE_BUF, "_PC_PIPE_BUF" }, /* size of a pipe */
570#endif
571#ifdef _PC_CHOWN_RESTRICTED
572 { _PC_CHOWN_RESTRICTED, "_PC_CHOWN_RESTRICTED" }, /* can we give away files */
573#endif
574#ifdef _PC_NO_TRUNC
575 { _PC_NO_TRUNC, "_PC_NO_TRUNC" }, /* trunc or error on >NAME_MAX */
576#endif
577#ifdef _PC_VDISABLE
578 { _PC_VDISABLE, "_PC_VDISABLE" }, /* best char to shut off tty c_cc */
579#endif
580 { 0, NULL },
581};
582
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000583
584int
585sys_pathconf(tcp)
586struct tcb *tcp;
587{
588 if (entering(tcp)) {
589 printstr(tcp, tcp->u_arg[0], -1);
590 tprintf(", ");
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000591 printxval(pathconflimits, tcp->u_arg[1], "_PC_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000592 }
593 return 0;
594}
595
596int
597sys_fpathconf(tcp)
598struct tcb *tcp;
599{
600 if (entering(tcp)) {
601 tprintf("%lu, ", tcp->u_arg[0]);
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000602 printxval(pathconflimits, tcp->u_arg[1], "_PC_???");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000603 }
604 return 0;
605}
606
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000607#endif /* SUNOS4 || FREEBSD */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000608
609#ifdef SVR4
610
611#ifdef HAVE_SYS_SYSCONFIG_H
612#include <sys/sysconfig.h>
613#endif /* HAVE_SYS_SYSCONFIG_H */
614
615#include <sys/mount.h>
616#include <sys/systeminfo.h>
617#include <sys/utsname.h>
618
619static struct xlat sysconfig_options[] = {
620#ifdef _CONFIG_NGROUPS
621 { _CONFIG_NGROUPS, "_CONFIG_NGROUPS" },
622#endif
623#ifdef _CONFIG_CHILD_MAX
624 { _CONFIG_CHILD_MAX, "_CONFIG_CHILD_MAX" },
625#endif
626#ifdef _CONFIG_OPEN_FILES
627 { _CONFIG_OPEN_FILES, "_CONFIG_OPEN_FILES" },
628#endif
629#ifdef _CONFIG_POSIX_VER
630 { _CONFIG_POSIX_VER, "_CONFIG_POSIX_VER" },
631#endif
632#ifdef _CONFIG_PAGESIZE
633 { _CONFIG_PAGESIZE, "_CONFIG_PAGESIZE" },
634#endif
635#ifdef _CONFIG_CLK_TCK
636 { _CONFIG_CLK_TCK, "_CONFIG_CLK_TCK" },
637#endif
638#ifdef _CONFIG_XOPEN_VER
639 { _CONFIG_XOPEN_VER, "_CONFIG_XOPEN_VER" },
640#endif
641#ifdef _CONFIG_PROF_TCK
642 { _CONFIG_PROF_TCK, "_CONFIG_PROF_TCK" },
643#endif
644#ifdef _CONFIG_NPROC_CONF
645 { _CONFIG_NPROC_CONF, "_CONFIG_NPROC_CONF" },
646#endif
647#ifdef _CONFIG_NPROC_ONLN
648 { _CONFIG_NPROC_ONLN, "_CONFIG_NPROC_ONLN" },
649#endif
650#ifdef _CONFIG_AIO_LISTIO_MAX
651 { _CONFIG_AIO_LISTIO_MAX, "_CONFIG_AIO_LISTIO_MAX" },
652#endif
653#ifdef _CONFIG_AIO_MAX
654 { _CONFIG_AIO_MAX, "_CONFIG_AIO_MAX" },
655#endif
656#ifdef _CONFIG_AIO_PRIO_DELTA_MAX
657 { _CONFIG_AIO_PRIO_DELTA_MAX, "_CONFIG_AIO_PRIO_DELTA_MAX" },
658#endif
659#ifdef _CONFIG_CONFIG_DELAYTIMER_MAX
660 { _CONFIG_DELAYTIMER_MAX, "_CONFIG_DELAYTIMER_MAX" },
661#endif
662#ifdef _CONFIG_MQ_OPEN_MAX
663 { _CONFIG_MQ_OPEN_MAX, "_CONFIG_MQ_OPEN_MAX" },
664#endif
665#ifdef _CONFIG_MQ_PRIO_MAX
666 { _CONFIG_MQ_PRIO_MAX, "_CONFIG_MQ_PRIO_MAX" },
667#endif
668#ifdef _CONFIG_RTSIG_MAX
669 { _CONFIG_RTSIG_MAX, "_CONFIG_RTSIG_MAX" },
670#endif
671#ifdef _CONFIG_SEM_NSEMS_MAX
672 { _CONFIG_SEM_NSEMS_MAX, "_CONFIG_SEM_NSEMS_MAX" },
673#endif
674#ifdef _CONFIG_SEM_VALUE_MAX
675 { _CONFIG_SEM_VALUE_MAX, "_CONFIG_SEM_VALUE_MAX" },
676#endif
677#ifdef _CONFIG_SIGQUEUE_MAX
678 { _CONFIG_SIGQUEUE_MAX, "_CONFIG_SIGQUEUE_MAX" },
679#endif
680#ifdef _CONFIG_SIGRT_MIN
681 { _CONFIG_SIGRT_MIN, "_CONFIG_SIGRT_MIN" },
682#endif
683#ifdef _CONFIG_SIGRT_MAX
684 { _CONFIG_SIGRT_MAX, "_CONFIG_SIGRT_MAX" },
685#endif
686#ifdef _CONFIG_TIMER_MAX
687 { _CONFIG_TIMER_MAX, "_CONFIG_TIMER_MAX" },
688#endif
689#ifdef _CONFIG_CONFIG_PHYS_PAGES
690 { _CONFIG_PHYS_PAGES, "_CONFIG_PHYS_PAGES" },
691#endif
692#ifdef _CONFIG_AVPHYS_PAGES
693 { _CONFIG_AVPHYS_PAGES, "_CONFIG_AVPHYS_PAGES" },
694#endif
695 { 0, NULL },
696};
697
698int
699sys_sysconfig(tcp)
700struct tcb *tcp;
701{
702 if (entering(tcp))
703 printxval(sysconfig_options, tcp->u_arg[0], "_CONFIG_???");
704 return 0;
705}
706
707static struct xlat sysinfo_options[] = {
708 { SI_SYSNAME, "SI_SYSNAME" },
709 { SI_HOSTNAME, "SI_HOSTNAME" },
710 { SI_RELEASE, "SI_RELEASE" },
711 { SI_VERSION, "SI_VERSION" },
712 { SI_MACHINE, "SI_MACHINE" },
713 { SI_ARCHITECTURE, "SI_ARCHITECTURE" },
714 { SI_HW_SERIAL, "SI_HW_SERIAL" },
715 { SI_HW_PROVIDER, "SI_HW_PROVIDER" },
716 { SI_SRPC_DOMAIN, "SI_SRPC_DOMAIN" },
717#ifdef SI_SET_HOSTNAME
718 { SI_SET_HOSTNAME, "SI_SET_HOSTNAME" },
719#endif
720#ifdef SI_SET_SRPC_DOMAIN
721 { SI_SET_SRPC_DOMAIN, "SI_SET_SRPC_DOMAIN" },
722#endif
723#ifdef SI_SET_KERB_REALM
724 { SI_SET_KERB_REALM, "SI_SET_KERB_REALM" },
725#endif
726#ifdef SI_KERB_REALM
727 { SI_KERB_REALM, "SI_KERB_REALM" },
728#endif
729 { 0, NULL },
730};
731
732int
733sys_sysinfo(tcp)
734struct tcb *tcp;
735{
736 if (entering(tcp)) {
737 printxval(sysinfo_options, tcp->u_arg[0], "SI_???");
738 tprintf(", ");
739 }
740 else {
741 /* Technically some calls write values. So what. */
742 if (syserror(tcp))
743 tprintf("%#lx", tcp->u_arg[1]);
744 else
745 printpath(tcp, tcp->u_arg[1]);
746 tprintf(", %lu", tcp->u_arg[2]);
747 }
748 return 0;
749}
750
751#ifdef MIPS
752
753#include <sys/syssgi.h>
754
755static struct xlat syssgi_options[] = {
756 { SGI_SYSID, "SGI_SYSID" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000757#ifdef SGI_RDUBLK
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000758 { SGI_RDUBLK, "SGI_RDUBLK" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000759#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000760 { SGI_TUNE, "SGI_TUNE" },
761 { SGI_IDBG, "SGI_IDBG" },
762 { SGI_INVENT, "SGI_INVENT" },
763 { SGI_RDNAME, "SGI_RDNAME" },
764 { SGI_SETLED, "SGI_SETLED" },
765 { SGI_SETNVRAM, "SGI_SETNVRAM" },
766 { SGI_GETNVRAM, "SGI_GETNVRAM" },
767 { SGI_QUERY_FTIMER, "SGI_QUERY_FTIMER" },
768 { SGI_QUERY_CYCLECNTR, "SGI_QUERY_CYCLECNTR" },
769 { SGI_PROCSZ, "SGI_PROCSZ" },
770 { SGI_SIGACTION, "SGI_SIGACTION" },
771 { SGI_SIGPENDING, "SGI_SIGPENDING" },
772 { SGI_SIGPROCMASK, "SGI_SIGPROCMASK" },
773 { SGI_SIGSUSPEND, "SGI_SIGSUSPEND" },
774 { SGI_SETSID, "SGI_SETSID" },
775 { SGI_SETPGID, "SGI_SETPGID" },
776 { SGI_SYSCONF, "SGI_SYSCONF" },
777 { SGI_WAIT4, "SGI_WAIT4" },
778 { SGI_PATHCONF, "SGI_PATHCONF" },
779 { SGI_READB, "SGI_READB" },
780 { SGI_WRITEB, "SGI_WRITEB" },
781 { SGI_SETGROUPS, "SGI_SETGROUPS" },
782 { SGI_GETGROUPS, "SGI_GETGROUPS" },
783 { SGI_SETTIMEOFDAY, "SGI_SETTIMEOFDAY" },
784 { SGI_SETTIMETRIM, "SGI_SETTIMETRIM" },
785 { SGI_GETTIMETRIM, "SGI_GETTIMETRIM" },
786 { SGI_SPROFIL, "SGI_SPROFIL" },
787 { SGI_RUSAGE, "SGI_RUSAGE" },
788 { SGI_SIGSTACK, "SGI_SIGSTACK" },
789 { SGI_SIGSTATUS, "SGI_SIGSTATUS" },
790 { SGI_NETPROC, "SGI_NETPROC" },
791 { SGI_SIGALTSTACK, "SGI_SIGALTSTACK" },
792 { SGI_BDFLUSHCNT, "SGI_BDFLUSHCNT" },
793 { SGI_SSYNC, "SGI_SSYNC" },
794 { SGI_NFSCNVT, "SGI_NFSCNVT" },
795 { SGI_GETPGID, "SGI_GETPGID" },
796 { SGI_GETSID, "SGI_GETSID" },
797 { SGI_IOPROBE, "SGI_IOPROBE" },
798 { SGI_CONFIG, "SGI_CONFIG" },
799 { SGI_ELFMAP, "SGI_ELFMAP" },
800 { SGI_MCONFIG, "SGI_MCONFIG" },
801 { SGI_GETPLABEL, "SGI_GETPLABEL" },
802 { SGI_SETPLABEL, "SGI_SETPLABEL" },
803 { SGI_GETLABEL, "SGI_GETLABEL" },
804 { SGI_SETLABEL, "SGI_SETLABEL" },
805 { SGI_SATREAD, "SGI_SATREAD" },
806 { SGI_SATWRITE, "SGI_SATWRITE" },
807 { SGI_SATCTL, "SGI_SATCTL" },
808 { SGI_LOADATTR, "SGI_LOADATTR" },
809 { SGI_UNLOADATTR, "SGI_UNLOADATTR" },
810#ifdef SGI_RECVLMSG
811 { SGI_RECVLMSG, "SGI_RECVLMSG" },
812#endif
813 { SGI_PLANGMOUNT, "SGI_PLANGMOUNT" },
814 { SGI_GETPSOACL, "SGI_GETPSOACL" },
815 { SGI_SETPSOACL, "SGI_SETPSOACL" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000816#ifdef SGI_EAG_GET_ATTR
817 { SGI_EAG_GET_ATTR, "SGI_EAG_GET_ATTR" },
818#endif
819#ifdef SGI_EAG_SET_ATTR
820 { SGI_EAG_SET_ATTR, "SGI_EAG_SET_ATTR" },
821#endif
822#ifdef SGI_EAG_GET_PROCATTR
823 { SGI_EAG_GET_PROCATTR, "SGI_EAG_GET_PROCATTR" },
824#endif
825#ifdef SGI_EAG_SET_PROCATTR
826 { SGI_EAG_SET_PROCATTR, "SGI_EAG_SET_PROCATTR" },
827#endif
828#ifdef SGI_FREVOKE
829 { SGI_FREVOKE, "SGI_FREVOKE" },
830#endif
831#ifdef SGI_SBE_GET_INFO
832 { SGI_SBE_GET_INFO, "SGI_SBE_GET_INFO" },
833#endif
834#ifdef SGI_SBE_CLR_INFO
835 { SGI_SBE_CLR_INFO, "SGI_SBE_CLR_INFO" },
836#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000837 { SGI_RMI_FIXECC, "SGI_RMI_FIXECC" },
838 { SGI_R4K_CERRS, "SGI_R4K_CERRS" },
839 { SGI_GET_EVCONF, "SGI_GET_EVCONF" },
840 { SGI_MPCWAROFF, "SGI_MPCWAROFF" },
841 { SGI_SET_AUTOPWRON, "SGI_SET_AUTOPWRON" },
842 { SGI_SPIPE, "SGI_SPIPE" },
843 { SGI_SYMTAB, "SGI_SYMTAB" },
844#ifdef SGI_SET_FPDEBUG
845 { SGI_SET_FPDEBUG, "SGI_SET_FPDEBUG" },
846#endif
Wichert Akkerman8829a551999-06-11 13:18:40 +0000847#ifdef SGI_SET_FP_PRECISE
848 { SGI_SET_FP_PRECISE, "SGI_SET_FP_PRECISE" },
849#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000850 { SGI_TOSSTSAVE, "SGI_TOSSTSAVE" },
851 { SGI_FDHI, "SGI_FDHI" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000852#ifdef SGI_SET_CONFIG_SMM
853 { SGI_SET_CONFIG_SMM, "SGI_SET_CONFIG_SMM" },
854#endif
855#ifdef SGI_SET_FP_PRESERVE
856 { SGI_SET_FP_PRESERVE, "SGI_SET_FP_PRESERVE" },
857#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000858 { SGI_MINRSS, "SGI_MINRSS" },
Wichert Akkerman8829a551999-06-11 13:18:40 +0000859#ifdef SGI_GRIO
860 { SGI_GRIO, "SGI_GRIO" },
861#endif
862#ifdef SGI_XLV_SET_TAB
863 { SGI_XLV_SET_TAB, "SGI_XLV_SET_TAB" },
864#endif
865#ifdef SGI_XLV_GET_TAB
866 { SGI_XLV_GET_TAB, "SGI_XLV_GET_TAB" },
867#endif
868#ifdef SGI_GET_FP_PRECISE
869 { SGI_GET_FP_PRECISE, "SGI_GET_FP_PRECISE" },
870#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000871#ifdef SGI_GET_CONFIG_SMM
Wichert Akkerman8829a551999-06-11 13:18:40 +0000872 { SGI_GET_CONFIG_SMM, "SGI_GET_CONFIG_SMM" },
873#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000874#ifdef SGI_FP_IMPRECISE_SUPP
Wichert Akkerman8829a551999-06-11 13:18:40 +0000875 { SGI_FP_IMPRECISE_SUPP,"SGI_FP_IMPRECISE_SUPP" },
876#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000877#ifdef SGI_CONFIG_NSMM_SUPP
Wichert Akkerman8829a551999-06-11 13:18:40 +0000878 { SGI_CONFIG_NSMM_SUPP, "SGI_CONFIG_NSMM_SUPP" },
879#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000880#ifdef SGI_RT_TSTAMP_CREATE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000881 { SGI_RT_TSTAMP_CREATE, "SGI_RT_TSTAMP_CREATE" },
882#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000883#ifdef SGI_RT_TSTAMP_DELETE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000884 { SGI_RT_TSTAMP_DELETE, "SGI_RT_TSTAMP_DELETE" },
885#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000886#ifdef SGI_RT_TSTAMP_START
Wichert Akkerman8829a551999-06-11 13:18:40 +0000887 { SGI_RT_TSTAMP_START, "SGI_RT_TSTAMP_START" },
888#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000889#ifdef SGI_RT_TSTAMP_STOP
Wichert Akkerman8829a551999-06-11 13:18:40 +0000890 { SGI_RT_TSTAMP_STOP, "SGI_RT_TSTAMP_STOP" },
891#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000892#ifdef SGI_RT_TSTAMP_ADDR
Wichert Akkerman8829a551999-06-11 13:18:40 +0000893 { SGI_RT_TSTAMP_ADDR, "SGI_RT_TSTAMP_ADDR" },
894#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000895#ifdef SGI_RT_TSTAMP_MASK
Wichert Akkerman8829a551999-06-11 13:18:40 +0000896 { SGI_RT_TSTAMP_MASK, "SGI_RT_TSTAMP_MASK" },
897#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000898#ifdef SGI_RT_TSTAMP_EOB_MODE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000899 { SGI_RT_TSTAMP_EOB_MODE,"SGI_RT_TSTAMP_EOB_MODE"},
900#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000901#ifdef SGI_USE_FP_BCOPY
Wichert Akkerman8829a551999-06-11 13:18:40 +0000902 { SGI_USE_FP_BCOPY, "SGI_USE_FP_BCOPY" },
903#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000904#ifdef SGI_GET_UST
Wichert Akkerman8829a551999-06-11 13:18:40 +0000905 { SGI_GET_UST, "SGI_GET_UST" },
906#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000907#ifdef SGI_SPECULATIVE_EXEC
Wichert Akkerman8829a551999-06-11 13:18:40 +0000908 { SGI_SPECULATIVE_EXEC, "SGI_SPECULATIVE_EXEC" },
909#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000910#ifdef SGI_XLV_NEXT_RQST
Wichert Akkerman8829a551999-06-11 13:18:40 +0000911 { SGI_XLV_NEXT_RQST, "SGI_XLV_NEXT_RQST" },
912#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000913#ifdef SGI_XLV_ATTR_CURSOR
Wichert Akkerman8829a551999-06-11 13:18:40 +0000914 { SGI_XLV_ATTR_CURSOR, "SGI_XLV_ATTR_CURSOR" },
915#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000916#ifdef SGI_XLV_ATTR_GET
Wichert Akkerman8829a551999-06-11 13:18:40 +0000917 { SGI_XLV_ATTR_GET, "SGI_XLV_ATTR_GET" },
918#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000919#ifdef SGI_XLV_ATTR_SET
Wichert Akkerman8829a551999-06-11 13:18:40 +0000920 { SGI_XLV_ATTR_SET, "SGI_XLV_ATTR_SET" },
921#endif
922#ifdef SGI_BTOOLSIZE
923 { SGI_BTOOLSIZE, "SGI_BTOOLSIZE" },
924#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000925#ifdef SGI_BTOOLGET
Wichert Akkerman8829a551999-06-11 13:18:40 +0000926 { SGI_BTOOLGET, "SGI_BTOOLGET" },
927#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000928#ifdef SGI_BTOOLREINIT
Wichert Akkerman8829a551999-06-11 13:18:40 +0000929 { SGI_BTOOLREINIT, "SGI_BTOOLREINIT" },
930#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000931#ifdef SGI_CREATE_UUID
Wichert Akkerman8829a551999-06-11 13:18:40 +0000932 { SGI_CREATE_UUID, "SGI_CREATE_UUID" },
933#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000934#ifdef SGI_NOFPE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000935 { SGI_NOFPE, "SGI_NOFPE" },
936#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000937#ifdef SGI_OLD_SOFTFP
Wichert Akkerman8829a551999-06-11 13:18:40 +0000938 { SGI_OLD_SOFTFP, "SGI_OLD_SOFTFP" },
939#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000940#ifdef SGI_FS_INUMBERS
Wichert Akkerman8829a551999-06-11 13:18:40 +0000941 { SGI_FS_INUMBERS, "SGI_FS_INUMBERS" },
942#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000943#ifdef SGI_FS_BULKSTAT
Wichert Akkerman8829a551999-06-11 13:18:40 +0000944 { SGI_FS_BULKSTAT, "SGI_FS_BULKSTAT" },
945#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000946#ifdef SGI_RT_TSTAMP_WAIT
Wichert Akkerman8829a551999-06-11 13:18:40 +0000947 { SGI_RT_TSTAMP_WAIT, "SGI_RT_TSTAMP_WAIT" },
948#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000949#ifdef SGI_RT_TSTAMP_UPDATE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000950 { SGI_RT_TSTAMP_UPDATE, "SGI_RT_TSTAMP_UPDATE" },
951#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000952#ifdef SGI_PATH_TO_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000953 { SGI_PATH_TO_HANDLE, "SGI_PATH_TO_HANDLE" },
954#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000955#ifdef SGI_PATH_TO_FSHANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000956 { SGI_PATH_TO_FSHANDLE, "SGI_PATH_TO_FSHANDLE" },
957#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000958#ifdef SGI_FD_TO_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000959 { SGI_FD_TO_HANDLE, "SGI_FD_TO_HANDLE" },
960#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000961#ifdef SGI_OPEN_BY_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000962 { SGI_OPEN_BY_HANDLE, "SGI_OPEN_BY_HANDLE" },
963#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000964#ifdef SGI_READLINK_BY_HANDLE
Wichert Akkerman8829a551999-06-11 13:18:40 +0000965 { SGI_READLINK_BY_HANDLE,"SGI_READLINK_BY_HANDLE"},
966#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000967#ifdef SGI_READ_DANGID
Wichert Akkerman8829a551999-06-11 13:18:40 +0000968 { SGI_READ_DANGID, "SGI_READ_DANGID" },
969#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000970#ifdef SGI_CONST
Wichert Akkerman8829a551999-06-11 13:18:40 +0000971 { SGI_CONST, "SGI_CONST" },
972#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000973#ifdef SGI_XFS_FSOPERATIONS
Wichert Akkerman8829a551999-06-11 13:18:40 +0000974 { SGI_XFS_FSOPERATIONS, "SGI_XFS_FSOPERATIONS" },
975#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000976#ifdef SGI_SETASH
Wichert Akkerman8829a551999-06-11 13:18:40 +0000977 { SGI_SETASH, "SGI_SETASH" },
978#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000979#ifdef SGI_GETASH
Wichert Akkerman8829a551999-06-11 13:18:40 +0000980 { SGI_GETASH, "SGI_GETASH" },
981#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000982#ifdef SGI_SETPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +0000983 { SGI_SETPRID, "SGI_SETPRID" },
984#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000985#ifdef SGI_GETPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +0000986 { SGI_GETPRID, "SGI_GETPRID" },
987#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000988#ifdef SGI_SETSPINFO
Wichert Akkerman8829a551999-06-11 13:18:40 +0000989 { SGI_SETSPINFO, "SGI_SETSPINFO" },
990#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000991#ifdef SGI_GETSPINFO
Wichert Akkerman8829a551999-06-11 13:18:40 +0000992 { SGI_GETSPINFO, "SGI_GETSPINFO" },
993#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000994#ifdef SGI_SHAREII
Wichert Akkerman8829a551999-06-11 13:18:40 +0000995 { SGI_SHAREII, "SGI_SHAREII" },
996#endif
Roland McGrathced50da2004-08-31 06:48:46 +0000997#ifdef SGI_NEWARRAYSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +0000998 { SGI_NEWARRAYSESS, "SGI_NEWARRAYSESS" },
999#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001000#ifdef SGI_GETDFLTPRID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001001 { SGI_GETDFLTPRID, "SGI_GETDFLTPRID" },
1002#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001003#ifdef SGI_SET_DISMISSED_EXC_CNT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001004 { SGI_SET_DISMISSED_EXC_CNT,"SGI_SET_DISMISSED_EXC_CNT" },
1005#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001006#ifdef SGI_GET_DISMISSED_EXC_CNT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001007 { SGI_GET_DISMISSED_EXC_CNT,"SGI_GET_DISMISSED_EXC_CNT" },
1008#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001009#ifdef SGI_CYCLECNTR_SIZE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001010 { SGI_CYCLECNTR_SIZE, "SGI_CYCLECNTR_SIZE" },
1011#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001012#ifdef SGI_QUERY_FASTTIMER
Wichert Akkerman8829a551999-06-11 13:18:40 +00001013 { SGI_QUERY_FASTTIMER, "SGI_QUERY_FASTTIMER" },
1014#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001015#ifdef SGI_PIDSINASH
Wichert Akkerman8829a551999-06-11 13:18:40 +00001016 { SGI_PIDSINASH, "SGI_PIDSINASH" },
1017#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001018#ifdef SGI_ULI
Wichert Akkerman8829a551999-06-11 13:18:40 +00001019 { SGI_ULI, "SGI_ULI" },
1020#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001021#ifdef SGI_LPG_SHMGET
Wichert Akkerman8829a551999-06-11 13:18:40 +00001022 { SGI_LPG_SHMGET, "SGI_LPG_SHMGET" },
1023#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001024#ifdef SGI_LPG_MAP
Wichert Akkerman8829a551999-06-11 13:18:40 +00001025 { SGI_LPG_MAP, "SGI_LPG_MAP" },
1026#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001027#ifdef SGI_CACHEFS_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001028 { SGI_CACHEFS_SYS, "SGI_CACHEFS_SYS" },
1029#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001030#ifdef SGI_NFSNOTIFY
Wichert Akkerman8829a551999-06-11 13:18:40 +00001031 { SGI_NFSNOTIFY, "SGI_NFSNOTIFY" },
1032#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001033#ifdef SGI_LOCKDSYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001034 { SGI_LOCKDSYS, "SGI_LOCKDSYS" },
1035#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001036#ifdef SGI_EVENTCTR
Wichert Akkerman8829a551999-06-11 13:18:40 +00001037 { SGI_EVENTCTR, "SGI_EVENTCTR" },
1038#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001039#ifdef SGI_GETPRUSAGE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001040 { SGI_GETPRUSAGE, "SGI_GETPRUSAGE" },
1041#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001042#ifdef SGI_PROCMASK_LOCATION
Wichert Akkerman8829a551999-06-11 13:18:40 +00001043 { SGI_PROCMASK_LOCATION,"SGI_PROCMASK_LOCATION" },
1044#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001045#ifdef SGI_UNUSED
Wichert Akkerman8829a551999-06-11 13:18:40 +00001046 { SGI_UNUSED, "SGI_UNUSED" },
1047#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001048#ifdef SGI_CKPT_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001049 { SGI_CKPT_SYS, "SGI_CKPT_SYS" },
1050#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001051#ifdef SGI_CKPT_SYS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001052 { SGI_CKPT_SYS, "SGI_CKPT_SYS" },
1053#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001054#ifdef SGI_GETGRPPID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001055 { SGI_GETGRPPID, "SGI_GETGRPPID" },
1056#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001057#ifdef SGI_GETSESPID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001058 { SGI_GETSESPID, "SGI_GETSESPID" },
1059#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001060#ifdef SGI_ENUMASHS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001061 { SGI_ENUMASHS, "SGI_ENUMASHS" },
1062#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001063#ifdef SGI_SETASMACHID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001064 { SGI_SETASMACHID, "SGI_SETASMACHID" },
1065#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001066#ifdef SGI_GETASMACHID
Wichert Akkerman8829a551999-06-11 13:18:40 +00001067 { SGI_GETASMACHID, "SGI_GETASMACHID" },
1068#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001069#ifdef SGI_GETARSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001070 { SGI_GETARSESS, "SGI_GETARSESS" },
1071#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001072#ifdef SGI_JOINARRAYSESS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001073 { SGI_JOINARRAYSESS, "SGI_JOINARRAYSESS" },
1074#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001075#ifdef SGI_SPROC_KILL
Wichert Akkerman8829a551999-06-11 13:18:40 +00001076 { SGI_SPROC_KILL, "SGI_SPROC_KILL" },
1077#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001078#ifdef SGI_DBA_CONFIG
Wichert Akkerman8829a551999-06-11 13:18:40 +00001079 { SGI_DBA_CONFIG, "SGI_DBA_CONFIG" },
1080#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001081#ifdef SGI_RELEASE_NAME
Wichert Akkerman8829a551999-06-11 13:18:40 +00001082 { SGI_RELEASE_NAME, "SGI_RELEASE_NAME" },
1083#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001084#ifdef SGI_SYNCH_CACHE_HANDLER
Wichert Akkerman8829a551999-06-11 13:18:40 +00001085 { SGI_SYNCH_CACHE_HANDLER,"SGI_SYNCH_CACHE_HANDLER"},
1086#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001087#ifdef SGI_SWASH_INIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001088 { SGI_SWASH_INIT, "SGI_SWASH_INIT" },
1089#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001090#ifdef SGI_NUMA_MIGR_PAGE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001091 { SGI_NUMA_MIGR_PAGE, "SGI_NUMA_MIGR_PAGE" },
1092#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001093#ifdef SGI_NUMA_MIGR_PAGE_ALT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001094 { SGI_NUMA_MIGR_PAGE_ALT,"SGI_NUMA_MIGR_PAGE_ALT"},
1095#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001096#ifdef SGI_KAIO_USERINIT
Wichert Akkerman8829a551999-06-11 13:18:40 +00001097 { SGI_KAIO_USERINIT, "SGI_KAIO_USERINIT" },
1098#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001099#ifdef SGI_KAIO_READ
Wichert Akkerman8829a551999-06-11 13:18:40 +00001100 { SGI_KAIO_READ, "SGI_KAIO_READ" },
1101#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001102#ifdef SGI_KAIO_WRITE
Wichert Akkerman8829a551999-06-11 13:18:40 +00001103 { SGI_KAIO_WRITE, "SGI_KAIO_WRITE" },
1104#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001105#ifdef SGI_KAIO_SUSPEND
Wichert Akkerman8829a551999-06-11 13:18:40 +00001106 { SGI_KAIO_SUSPEND, "SGI_KAIO_SUSPEND" },
1107#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001108#ifdef SGI_KAIO_STATS
Wichert Akkerman8829a551999-06-11 13:18:40 +00001109 { SGI_KAIO_STATS, "SGI_KAIO_STATS" },
1110#endif
Roland McGrathced50da2004-08-31 06:48:46 +00001111#ifdef SGI_INITIAL_PT_SPROC
Wichert Akkerman8829a551999-06-11 13:18:40 +00001112 { SGI_INITIAL_PT_SPROC, "SGI_INITIAL_PT_SPROC" },
1113#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001114 { 0, NULL },
1115};
1116
1117int
1118sys_syssgi(tcp)
1119struct tcb *tcp;
1120{
1121 int i;
1122
1123 if (entering(tcp)) {
1124 printxval(syssgi_options, tcp->u_arg[0], "SGI_???");
1125 switch (tcp->u_arg[0]) {
1126 default:
1127 for (i = 1; i < tcp->u_nargs; i++)
1128 tprintf(", %#lx", tcp->u_arg[i]);
1129 break;
1130 }
1131 }
1132 return 0;
1133}
1134
1135#include <sys/types.h>
1136#include <rpc/rpc.h>
1137struct cred;
1138struct uio;
1139#include <sys/fsid.h>
1140#include <sys/vnode.h>
1141#include <sys/fs/nfs.h>
1142#include <sys/fs/nfs_clnt.h>
1143
1144static struct xlat mount_flags[] = {
1145 { MS_RDONLY, "MS_RDONLY" },
1146 { MS_FSS, "MS_FSS" },
1147 { MS_DATA, "MS_DATA" },
1148 { MS_NOSUID, "MS_NOSUID" },
1149 { MS_REMOUNT, "MS_REMOUNT" },
1150 { MS_NOTRUNC, "MS_NOTRUNC" },
1151 { MS_GRPID, "MS_GRPID" },
1152 { MS_NODEV, "MS_NODEV" },
1153 { MS_BEFORE, "MS_BEFORE" },
1154 { MS_AFTER, "MS_AFTER" },
1155 { 0, NULL },
1156};
1157
1158static struct xlat nfs_flags[] = {
1159 { NFSMNT_SOFT, "NFSMNT_SOFT" },
1160 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
1161 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
1162 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
1163 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
1164 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001165#ifdef NFSMNT_NOINT /* IRIX 6 */
1166 { NFSMNT_NOINT, "NFSMNT_NOINT" },
1167#endif
1168#ifdef NFSMNT_INT /* IRIX 5 */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001169 { NFSMNT_INT, "NFSMNT_INT" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001170#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001171 { NFSMNT_NOAC, "NFSMNT_NOAC" },
1172 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
1173 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
1174 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
1175 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
1176 { NFSMNT_PRIVATE, "NFSMNT_PRIVATE" },
1177 { NFSMNT_SYMTTL, "NFSMNT_SYMTTL" },
1178 { NFSMNT_LOOPBACK, "NFSMNT_LOOPBACK" },
1179 { NFSMNT_BASETYPE, "NFSMNT_BASETYPE" },
1180 { NFSMNT_NAMEMAX, "NFSMNT_NAMEMAX" },
Wichert Akkerman8829a551999-06-11 13:18:40 +00001181#ifdef NFSMNT_SHORTUID /* IRIX 6 */
1182 { NFSMNT_SHORTUID, "NFSMNT_SHORTUID" },
1183#endif
1184#ifdef NFSMNT_ASYNCNLM /* IRIX 6 */
1185 { NFSMNT_ASYNCNLM, "NFSMNT_ASYNCNLM" },
1186#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001187 { 0, NULL },
1188};
1189
1190int
1191sys_mount(tcp)
1192struct tcb *tcp;
1193{
1194 if (entering(tcp)) {
1195 printpath(tcp, tcp->u_arg[0]);
1196 tprintf(", ");
1197 printpath(tcp, tcp->u_arg[1]);
1198 tprintf(", ");
1199 printflags(mount_flags, tcp->u_arg[2]);
1200 if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
1201 tprintf(", ");
1202 tprintf("%ld", tcp->u_arg[3]);
1203 }
1204 if (tcp->u_arg[2] & MS_DATA) {
1205 int nfs_type = sysfs(GETFSIND, FSID_NFS);
1206
1207 tprintf(", ");
1208 if (tcp->u_arg[3] == nfs_type) {
1209 struct nfs_args args;
1210 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1211 tprintf("%#lx", tcp->u_arg[4]);
1212 else {
1213 tprintf("addr=");
1214 printsock(tcp, (int) args.addr);
1215 tprintf(", flags=");
1216 if (!printflags(nfs_flags, args.flags))
1217 tprintf("NFSMNT_???");
1218 tprintf(", hostname=");
1219 printstr(tcp, (int) args.hostname, -1);
1220 tprintf(", ...}");
1221 }
1222 }
1223 else
1224 tprintf("%#lx", tcp->u_arg[4]);
1225 tprintf(", %ld", tcp->u_arg[5]);
1226 }
1227 }
1228 return 0;
1229}
1230
1231#else /* !MIPS */
1232
Wichert Akkerman3377df71999-11-26 13:14:41 +00001233#if UNIXWARE
1234
1235#include <sys/types.h>
1236#include <sys/fstyp.h>
1237#include <sys/mount.h>
1238#include <sys/xti.h>
1239
1240#define NFSCLIENT 1
1241#include <nfs/mount.h>
1242
1243#include <sys/fs/vx_ioctl.h>
1244
1245static struct xlat mount_flags[] = {
1246 { MS_RDONLY, "MS_RDONLY" },
1247 { MS_FSS, "MS_FSS" },
1248 { MS_DATA, "MS_DATA" },
1249 { MS_HADBAD, "MS_HADBAD" },
1250 { MS_NOSUID, "MS_NOSUID" },
1251 { MS_REMOUNT, "MS_REMOUNT" },
1252 { MS_NOTRUNC, "MS_NOTRUNC" },
1253 { MS_SOFTMNT, "MS_SOFTMNT" },
1254 { MS_SYSSPACE, "MS_SYSSPACE" },
1255 { 0, NULL },
1256};
1257
1258#ifdef VX_MS_MASK
1259static struct xlat vxfs_flags[] = {
1260 { VX_MS_NOLOG, "VX_MS_NOLOG" },
1261 { VX_MS_BLKCLEAR, "VX_MS_BLKCLEAR" },
1262 { VX_MS_SNAPSHOT, "VX_MS_SNAPSHOT" },
1263 { VX_MS_NODATAINLOG, "VX_MS_NODATAINLOG" },
1264 { VX_MS_DELAYLOG, "VX_MS_DELAYLOG" },
1265 { VX_MS_TMPLOG, "VX_MS_TMPLOG" },
1266 { VX_MS_FILESET, "VX_MS_FILESET" },
1267
1268 { VX_MS_CACHE_DIRECT, "VX_MS_CACHE_DIRECT" },
1269 { VX_MS_CACHE_DSYNC, "VX_MS_CACHE_DSYNC" },
1270 { VX_MS_CACHE_CLOSESYNC,"VX_MS_CACHE_CLOSESYNC" },
1271 { VX_MS_CACHE_TMPCACHE, "VX_MS_CACHE_TMPCACHE" },
1272
1273 { VX_MS_OSYNC_DIRECT, "VX_MS_OSYNC_DIRECT" },
1274 { VX_MS_OSYNC_DSYNC, "VX_MS_OSYNC_DSYNC" },
1275 { VX_MS_OSYNC_CLOSESYNC,"VX_MS_OSYNC_CLOSESYNC" },
1276 { VX_MS_OSYNC_DELAY, "VX_MS_OSYNC_DELAY" },
1277 { 0, NULL, },
1278};
1279#endif
1280
1281static struct xlat nfs_flags[] = {
1282 { NFSMNT_SOFT, "NFSMNT_SOFT" },
1283 { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
1284 { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
1285 { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
1286 { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
1287 { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
1288 { NFSMNT_INT, "NFSMNT_INT" },
1289 { NFSMNT_NOAC, "NFSMNT_NOAC" },
1290 { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
1291 { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
1292 { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
1293 { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
1294 { NFSMNT_SECURE, "NFSMNT_SECURE" },
1295 { NFSMNT_NOCTO, "NFSMNT_NOCTO" },
1296 { NFSMNT_GRPID, "NFSMNT_GRPID" },
1297 { NFSMNT_RPCTIMESYNC, "NFSMNT_RPCTIMESYNC" },
1298 { NFSMNT_LWPSMAX, "NFSMNT_LWPSMAX" },
1299 { 0, NULL },
1300};
1301
1302int
1303sys_mount(tcp)
1304struct tcb *tcp;
1305{
1306 if (entering(tcp)) {
1307 char fstyp [FSTYPSZ];
1308 printpath(tcp, tcp->u_arg[0]);
1309 tprintf(", ");
1310 printpath(tcp, tcp->u_arg[1]);
1311 tprintf(", ");
1312 printflags(mount_flags, tcp->u_arg[2]);
1313 /* The doc sez that the file system type is given as a
1314 fsindex, and we should use sysfs to work out the name.
1315 This appears to be untrue for UW. Maybe it's untrue
1316 for all SVR4's? */
1317 if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
1318 if (umovestr(tcp, tcp->u_arg[3], FSTYPSZ, fstyp) < 0) {
1319 *fstyp = 0;
1320 tprintf(", %ld", tcp->u_arg[3]);
1321 }
1322 else
1323 tprintf(", \"%s\"", fstyp);
1324 }
1325 if (tcp->u_arg[2] & MS_DATA) {
1326 tprintf(", ");
1327#ifdef VX_MS_MASK
1328 /* On UW7 they don't give us the defines and structs
1329 we need to see what is going on. Bummer. */
1330 if (strcmp (fstyp, "vxfs") == 0) {
1331 struct vx_mountargs5 args;
1332 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1333 tprintf("%#lx", tcp->u_arg[4]);
1334 else {
1335 tprintf("{ flags=");
1336 if (!printflags(vxfs_flags, args.mflags))
1337 tprintf("0x%08x", args.mflags);
1338 if (args.mflags & VX_MS_SNAPSHOT) {
1339 tprintf (", snapof=");
1340 printstr (tcp,
Roland McGrathced50da2004-08-31 06:48:46 +00001341 (long) args.primaryspec,
Wichert Akkerman3377df71999-11-26 13:14:41 +00001342 -1);
1343 if (args.snapsize > 0)
1344 tprintf (", snapsize=%ld", args.snapsize);
1345 }
1346 tprintf(" }");
1347 }
1348 }
1349 else
1350#endif
1351 if (strcmp (fstyp, "specfs") == 0) {
1352 tprintf ("dev=");
1353 printstr (tcp, tcp->u_arg[4], -1);
1354 }
1355 else
1356 if (strcmp (fstyp, "nfs") == 0) {
1357 struct nfs_args args;
1358 if (umove(tcp, tcp->u_arg[4], &args) < 0)
1359 tprintf("%#lx", tcp->u_arg[4]);
1360 else {
1361 struct netbuf addr;
1362 tprintf("{ addr=");
1363 if (umove (tcp, (int) args.addr, &addr) < 0) {
1364 tprintf ("%#lx", (long) args.addr);
1365 }
1366 else {
1367 printsock(tcp, (int) addr.buf, addr.len);
1368 }
1369 tprintf(", flags=");
1370 if (!printflags(nfs_flags, args.flags))
1371 tprintf("NFSMNT_???");
1372 tprintf(", hostname=");
1373 printstr(tcp, (int) args.hostname, -1);
1374 tprintf(", ...}");
1375 }
1376 }
1377 else
1378 tprintf("%#lx", tcp->u_arg[4]);
1379 tprintf(", %ld", tcp->u_arg[5]);
1380 }
1381 }
1382 return 0;
1383}
1384
1385#else /* !UNIXWARE */
1386
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001387int
1388sys_mount(tcp)
1389struct tcb *tcp;
1390{
1391 if (entering(tcp)) {
1392 printpath(tcp, tcp->u_arg[0]);
1393 tprintf(", ");
1394 printpath(tcp, tcp->u_arg[1]);
1395 tprintf(", ...");
1396 }
1397 return 0;
1398}
Wichert Akkermanea78f0f1999-11-29 15:34:02 +00001399#endif /* !UNIXWARE */
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001400
1401#endif /* !MIPS */
1402
1403#endif /* SVR4 */
1404
Nate Sammons8d5860c1999-07-03 18:53:05 +00001405#ifdef SYS_capget
Wichert Akkermanc7926982000-04-10 22:22:31 +00001406
1407static struct xlat capabilities[] = {
1408 { 1<<CAP_CHOWN, "CAP_CHOWN" },
1409 { 1<<CAP_DAC_OVERRIDE, "CAP_DAC_OVERRIDE"},
1410 { 1<<CAP_DAC_READ_SEARCH,"CAP_DAC_READ_SEARCH"},
1411 { 1<<CAP_FOWNER, "CAP_FOWNER" },
1412 { 1<<CAP_FSETID, "CAP_FSETID" },
1413 { 1<<CAP_KILL, "CAP_KILL" },
1414 { 1<<CAP_SETGID, "CAP_SETGID" },
1415 { 1<<CAP_SETUID, "CAP_SETUID" },
1416 { 1<<CAP_SETPCAP, "CAP_SETPCAP" },
1417 { 1<<CAP_LINUX_IMMUTABLE,"CAP_LINUX_IMMUTABLE"},
1418 { 1<<CAP_NET_BIND_SERVICE,"CAP_NET_BIND_SERVICE"},
1419 { 1<<CAP_NET_BROADCAST, "CAP_NET_BROADCAST"},
1420 { 1<<CAP_NET_ADMIN, "CAP_NET_ADMIN" },
1421 { 1<<CAP_NET_RAW, "CAP_NET_RAW" },
1422 { 1<<CAP_IPC_LOCK, "CAP_IPC_LOCK" },
1423 { 1<<CAP_IPC_OWNER, "CAP_IPC_OWNER" },
1424 { 1<<CAP_SYS_MODULE, "CAP_SYS_MODULE"},
1425 { 1<<CAP_SYS_RAWIO, "CAP_SYS_RAWIO" },
1426 { 1<<CAP_SYS_CHROOT, "CAP_SYS_CHROOT"},
1427 { 1<<CAP_SYS_PTRACE, "CAP_SYS_PTRACE"},
1428 { 1<<CAP_SYS_PACCT, "CAP_SYS_PACCT" },
1429 { 1<<CAP_SYS_ADMIN, "CAP_SYS_ADMIN" },
1430 { 1<<CAP_SYS_BOOT, "CAP_SYS_BOOT" },
1431 { 1<<CAP_SYS_NICE, "CAP_SYS_NICE" },
1432 { 1<<CAP_SYS_RESOURCE, "CAP_SYS_RESOURCE"},
1433 { 1<<CAP_SYS_TIME, "CAP_SYS_TIME" },
1434 { 1<<CAP_SYS_TTY_CONFIG,"CAP_SYS_TTY_CONFIG"},
1435 { 0, NULL },
1436};
1437
1438
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001439int
1440sys_capget(tcp)
1441struct tcb *tcp;
1442{
Wichert Akkermanc7926982000-04-10 22:22:31 +00001443 static cap_user_header_t arg0 = NULL;
1444 static cap_user_data_t arg1 = NULL;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001445
1446 if(!entering(tcp)) {
Wichert Akkermanc7926982000-04-10 22:22:31 +00001447 if (!arg0) {
1448 if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
1449 fprintf(stderr, "sys_capget: no memory\n");
1450 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001451 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001452 }
1453 }
1454 if (!arg1) {
1455 if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
1456 fprintf(stderr, "sys_capget: no memory\n");
1457 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001458 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001459 }
1460 }
1461
1462 if (!tcp->u_arg[0])
1463 tprintf("NULL");
1464 else if (!verbose(tcp))
1465 tprintf("%#lx", tcp->u_arg[0]);
1466 else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
1467 tprintf("???");
1468 else {
1469 tprintf("%#x, %d", arg0->version, arg0->pid);
1470 }
1471 tprintf(", ");
1472 if (!tcp->u_arg[1])
1473 tprintf("NULL");
1474 else if (!verbose(tcp))
1475 tprintf("%#lx", tcp->u_arg[1]);
1476 else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
1477 tprintf("???");
1478 else {
1479 tprintf("{");
1480 printflags(capabilities, arg1->effective);
1481 tprintf(", ");
1482 printflags(capabilities, arg1->permitted);
1483 tprintf(", ");
1484 printflags(capabilities, arg1->inheritable);
1485 tprintf("}");
Roland McGrathced50da2004-08-31 06:48:46 +00001486 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001487 }
1488 return 0;
1489}
1490
1491int
1492sys_capset(tcp)
1493struct tcb *tcp;
1494{
Wichert Akkermanc7926982000-04-10 22:22:31 +00001495 static cap_user_header_t arg0 = NULL;
1496 static cap_user_data_t arg1 = NULL;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001497
Wichert Akkermanc7926982000-04-10 22:22:31 +00001498 if(entering(tcp)) {
1499 if (!arg0) {
1500 if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
1501 fprintf(stderr, "sys_capset: no memory\n");
1502 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001503 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001504 }
1505 }
1506 if (!arg1) {
1507 if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
1508 fprintf(stderr, "sys_capset: no memory\n");
1509 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
Wichert Akkerman5ae21ea2000-05-01 01:53:59 +00001510 return -1;
Wichert Akkermanc7926982000-04-10 22:22:31 +00001511 }
1512 }
1513
1514 if (!tcp->u_arg[0])
1515 tprintf("NULL");
1516 else if (!verbose(tcp))
1517 tprintf("%#lx", tcp->u_arg[0]);
1518 else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
1519 tprintf("???");
1520 else {
1521 tprintf("%#x, %d", arg0->version, arg0->pid);
1522 }
1523 tprintf(", ");
1524 if (!tcp->u_arg[1])
1525 tprintf("NULL");
1526 else if (!verbose(tcp))
1527 tprintf("%#lx", tcp->u_arg[1]);
1528 else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
1529 tprintf("???");
1530 else {
1531 tprintf("{");
1532 printflags(capabilities, arg1->effective);
1533 tprintf(", ");
1534 printflags(capabilities, arg1->permitted);
1535 tprintf(", ");
1536 printflags(capabilities, arg1->inheritable);
1537 tprintf("}");
Roland McGrathced50da2004-08-31 06:48:46 +00001538 }
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001539 }
1540 return 0;
1541}
1542
1543#else
1544
1545int sys_capget(tcp)
1546struct tcb *tcp;
1547{
1548 return printargs(tcp);
1549}
1550
1551int sys_capset(tcp)
1552struct tcb *tcp;
1553{
1554 return printargs(tcp);
1555}
1556
1557#endif
1558
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001559#ifdef LINUX
1560static struct xlat sysctl_root[] = {
1561 { CTL_KERN, "CTL_KERN" },
1562 { CTL_VM, "CTL_VM" },
1563 { CTL_NET, "CTL_NET" },
1564 { CTL_PROC, "CTL_PROC" },
1565 { CTL_FS, "CTL_FS" },
1566 { CTL_DEBUG, "CTL_DEBUG" },
1567 { CTL_DEV, "CTL_DEV" },
1568 { 0, NULL }
1569};
1570
1571static struct xlat sysctl_kern[] = {
1572 { KERN_OSTYPE, "KERN_OSTYPE" },
1573 { KERN_OSRELEASE, "KERN_OSRELEASE" },
1574 { KERN_OSREV, "KERN_OSREV" },
1575 { KERN_VERSION, "KERN_VERSION" },
1576 { KERN_SECUREMASK, "KERN_SECUREMASK" },
1577 { KERN_PROF, "KERN_PROF" },
1578 { KERN_NODENAME, "KERN_NODENAME" },
1579 { KERN_DOMAINNAME, "KERN_DOMAINNAME" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001580#ifdef KERN_SECURELVL
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001581 { KERN_SECURELVL, "KERN_SECURELVL" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001582#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001583 { KERN_PANIC, "KERN_PANIC" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001584#ifdef KERN_REALROOTDEV
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001585 { KERN_REALROOTDEV, "KERN_REALROOTDEV" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001586#endif
1587#ifdef KERN_JAVA_INTERPRETER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001588 { KERN_JAVA_INTERPRETER, "KERN_JAVA_INTERPRETER" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001589#endif
1590#ifdef KERN_JAVA_APPLETVIEWER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001591 { KERN_JAVA_APPLETVIEWER, "KERN_JAVA_APPLETVIEWER" },
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001592#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001593 { KERN_SPARC_REBOOT, "KERN_SPARC_REBOOT" },
1594 { KERN_CTLALTDEL, "KERN_CTLALTDEL" },
1595 { KERN_PRINTK, "KERN_PRINTK" },
1596 { KERN_NAMETRANS, "KERN_NAMETRANS" },
1597 { KERN_PPC_HTABRECLAIM, "KERN_PPC_HTABRECLAIM" },
1598 { KERN_PPC_ZEROPAGED, "KERN_PPC_ZEROPAGED" },
1599 { KERN_PPC_POWERSAVE_NAP, "KERN_PPC_POWERSAVE_NAP" },
1600 { KERN_MODPROBE, "KERN_MODPROBE" },
1601 { KERN_SG_BIG_BUFF, "KERN_SG_BIG_BUFF" },
1602 { KERN_ACCT, "KERN_ACCT" },
1603 { KERN_PPC_L2CR, "KERN_PPC_L2CR" },
1604 { KERN_RTSIGNR, "KERN_RTSIGNR" },
1605 { KERN_RTSIGMAX, "KERN_RTSIGMAX" },
1606 { KERN_SHMMAX, "KERN_SHMMAX" },
1607 { KERN_MSGMAX, "KERN_MSGMAX" },
1608 { KERN_MSGMNB, "KERN_MSGMNB" },
1609 { KERN_MSGPOOL, "KERN_MSGPOOL" },
1610 { 0, NULL }
1611};
1612
1613static struct xlat sysctl_vm[] = {
Roland McGratha796fd02004-03-01 22:10:54 +00001614#ifdef VM_SWAPCTL
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001615 { VM_SWAPCTL, "VM_SWAPCTL" },
Roland McGratha796fd02004-03-01 22:10:54 +00001616#endif
1617#ifdef VM_UNUSED1
1618 { VM_UNUSED1, "VM_UNUSED1" },
1619#endif
1620#ifdef VM_SWAPOUT
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001621 { VM_SWAPOUT, "VM_SWAPOUT" },
Roland McGratha796fd02004-03-01 22:10:54 +00001622#endif
1623#ifdef VM_UNUSED2
1624 { VM_UNUSED2, "VM_UNUSED2" },
1625#endif
1626#ifdef VM_FREEPG
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001627 { VM_FREEPG, "VM_FREEPG" },
Roland McGratha796fd02004-03-01 22:10:54 +00001628#endif
1629#ifdef VM_UNUSED3
1630 { VM_UNUSED3, "VM_UNUSED3" },
1631#endif
1632#ifdef VM_BDFLUSH
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001633 { VM_BDFLUSH, "VM_BDFLUSH" },
Roland McGratha796fd02004-03-01 22:10:54 +00001634#endif
1635#ifdef VM_UNUSED4
1636 { VM_UNUSED4, "VM_UNUSED4" },
1637#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001638 { VM_OVERCOMMIT_MEMORY, "VM_OVERCOMMIT_MEMORY" },
Roland McGratha796fd02004-03-01 22:10:54 +00001639#ifdef VM_BUFFERMEM
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001640 { VM_BUFFERMEM, "VM_BUFFERMEM" },
Roland McGratha796fd02004-03-01 22:10:54 +00001641#endif
1642#ifdef VM_UNUSED5
1643 { VM_UNUSED5, "VM_UNUSED5" },
1644#endif
1645#ifdef VM_PAGECACHE
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001646 { VM_PAGECACHE, "VM_PAGECACHE" },
Roland McGratha796fd02004-03-01 22:10:54 +00001647#endif
1648#ifdef VM_UNUSED7
1649 { VM_UNUSED7, "VM_UNUSED7" },
1650#endif
1651#ifdef VM_PAGERDAEMON
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001652 { VM_PAGERDAEMON, "VM_PAGERDAEMON" },
Roland McGratha796fd02004-03-01 22:10:54 +00001653#endif
1654#ifdef VM_UNUSED8
1655 { VM_UNUSED8, "VM_UNUSED8" },
1656#endif
1657#ifdef VM_PGT_CACHE
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001658 { VM_PGT_CACHE, "VM_PGT_CACHE" },
Roland McGratha796fd02004-03-01 22:10:54 +00001659#endif
1660#ifdef VM_UNUSED9
1661 { VM_UNUSED9, "VM_UNUSED9" },
1662#endif
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001663 { VM_PAGE_CLUSTER, "VM_PAGE_CLUSTER" },
1664 { 0, NULL },
1665};
1666
1667static struct xlat sysctl_net[] = {
1668 { NET_CORE, "NET_CORE" },
1669 { NET_ETHER, "NET_ETHER" },
1670 { NET_802, "NET_802" },
1671 { NET_UNIX, "NET_UNIX" },
1672 { NET_IPV4, "NET_IPV4" },
1673 { NET_IPX, "NET_IPX" },
1674 { NET_ATALK, "NET_ATALK" },
1675 { NET_NETROM, "NET_NETROM" },
1676 { NET_AX25, "NET_AX25" },
1677 { NET_BRIDGE, "NET_BRIDGE" },
1678 { NET_ROSE, "NET_ROSE" },
1679 { NET_IPV6, "NET_IPV6" },
1680 { NET_X25, "NET_X25" },
1681 { NET_TR, "NET_TR" },
1682 { NET_DECNET, "NET_DECNET" },
1683 { 0, NULL }
1684};
1685
1686static struct xlat sysctl_net_core[] = {
1687 { NET_CORE_WMEM_MAX, "NET_CORE_WMEM_MAX" },
1688 { NET_CORE_RMEM_MAX, "NET_CORE_RMEM_MAX" },
1689 { NET_CORE_WMEM_DEFAULT, "NET_CORE_WMEM_DEFAULT" },
1690 { NET_CORE_RMEM_DEFAULT, "NET_CORE_RMEM_DEFAULT" },
1691 { NET_CORE_MAX_BACKLOG, "NET_CORE_MAX_BACKLOG" },
1692 { NET_CORE_FASTROUTE, "NET_CORE_FASTROUTE" },
1693 { NET_CORE_MSG_COST, "NET_CORE_MSG_COST" },
1694 { NET_CORE_MSG_BURST, "NET_CORE_MSG_BURST" },
1695 { NET_CORE_OPTMEM_MAX, "NET_CORE_OPTMEM_MAX" },
1696 { 0, NULL }
1697};
1698
1699static struct xlat sysctl_net_unix[] = {
1700 { NET_UNIX_DESTROY_DELAY, "NET_UNIX_DESTROY_DELAY" },
1701 { NET_UNIX_DELETE_DELAY, "NET_UNIX_DELETE_DELAY" },
1702 { 0, NULL }
1703};
1704
1705static struct xlat sysctl_net_ipv4[] = {
1706 { NET_IPV4_FORWARD, "NET_IPV4_FORWARD" },
1707 { NET_IPV4_DYNADDR, "NET_IPV4_DYNADDR" },
1708 { NET_IPV4_CONF, "NET_IPV4_CONF" },
1709 { NET_IPV4_NEIGH, "NET_IPV4_NEIGH" },
1710 { NET_IPV4_ROUTE, "NET_IPV4_ROUTE" },
1711 { NET_IPV4_FIB_HASH, "NET_IPV4_FIB_HASH" },
1712 { NET_IPV4_TCP_TIMESTAMPS, "NET_IPV4_TCP_TIMESTAMPS" },
1713 { NET_IPV4_TCP_WINDOW_SCALING, "NET_IPV4_TCP_WINDOW_SCALING" },
1714 { NET_IPV4_TCP_SACK, "NET_IPV4_TCP_SACK" },
1715 { NET_IPV4_TCP_RETRANS_COLLAPSE, "NET_IPV4_TCP_RETRANS_COLLAPSE" },
1716 { NET_IPV4_DEFAULT_TTL, "NET_IPV4_DEFAULT_TTL" },
1717 { NET_IPV4_AUTOCONFIG, "NET_IPV4_AUTOCONFIG" },
1718 { NET_IPV4_NO_PMTU_DISC, "NET_IPV4_NO_PMTU_DISC" },
1719 { NET_IPV4_TCP_SYN_RETRIES, "NET_IPV4_TCP_SYN_RETRIES" },
1720 { NET_IPV4_IPFRAG_HIGH_THRESH, "NET_IPV4_IPFRAG_HIGH_THRESH" },
1721 { NET_IPV4_IPFRAG_LOW_THRESH, "NET_IPV4_IPFRAG_LOW_THRESH" },
1722 { NET_IPV4_IPFRAG_TIME, "NET_IPV4_IPFRAG_TIME" },
1723 { NET_IPV4_TCP_MAX_KA_PROBES, "NET_IPV4_TCP_MAX_KA_PROBES" },
1724 { NET_IPV4_TCP_KEEPALIVE_TIME, "NET_IPV4_TCP_KEEPALIVE_TIME" },
1725 { NET_IPV4_TCP_KEEPALIVE_PROBES, "NET_IPV4_TCP_KEEPALIVE_PROBES" },
1726 { NET_IPV4_TCP_RETRIES1, "NET_IPV4_TCP_RETRIES1" },
1727 { NET_IPV4_TCP_RETRIES2, "NET_IPV4_TCP_RETRIES2" },
1728 { NET_IPV4_TCP_FIN_TIMEOUT, "NET_IPV4_TCP_FIN_TIMEOUT" },
1729 { NET_IPV4_IP_MASQ_DEBUG, "NET_IPV4_IP_MASQ_DEBUG" },
1730 { NET_TCP_SYNCOOKIES, "NET_TCP_SYNCOOKIES" },
1731 { NET_TCP_STDURG, "NET_TCP_STDURG" },
1732 { NET_TCP_RFC1337, "NET_TCP_RFC1337" },
1733 { NET_TCP_SYN_TAILDROP, "NET_TCP_SYN_TAILDROP" },
1734 { NET_TCP_MAX_SYN_BACKLOG, "NET_TCP_MAX_SYN_BACKLOG" },
1735 { NET_IPV4_LOCAL_PORT_RANGE, "NET_IPV4_LOCAL_PORT_RANGE" },
1736 { NET_IPV4_ICMP_ECHO_IGNORE_ALL, "NET_IPV4_ICMP_ECHO_IGNORE_ALL" },
1737 { NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS" },
1738 { NET_IPV4_ICMP_SOURCEQUENCH_RATE, "NET_IPV4_ICMP_SOURCEQUENCH_RATE" },
1739 { NET_IPV4_ICMP_DESTUNREACH_RATE, "NET_IPV4_ICMP_DESTUNREACH_RATE" },
1740 { NET_IPV4_ICMP_TIMEEXCEED_RATE, "NET_IPV4_ICMP_TIMEEXCEED_RATE" },
1741 { NET_IPV4_ICMP_PARAMPROB_RATE, "NET_IPV4_ICMP_PARAMPROB_RATE" },
1742 { NET_IPV4_ICMP_ECHOREPLY_RATE, "NET_IPV4_ICMP_ECHOREPLY_RATE" },
1743 { NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES" },
1744 { NET_IPV4_IGMP_MAX_MEMBERSHIPS, "NET_IPV4_IGMP_MAX_MEMBERSHIPS" },
1745 { 0, NULL }
1746};
1747
1748static struct xlat sysctl_net_ipv4_route[] = {
1749 { NET_IPV4_ROUTE_FLUSH, "NET_IPV4_ROUTE_FLUSH" },
1750 { NET_IPV4_ROUTE_MIN_DELAY, "NET_IPV4_ROUTE_MIN_DELAY" },
1751 { NET_IPV4_ROUTE_MAX_DELAY, "NET_IPV4_ROUTE_MAX_DELAY" },
1752 { NET_IPV4_ROUTE_GC_THRESH, "NET_IPV4_ROUTE_GC_THRESH" },
1753 { NET_IPV4_ROUTE_MAX_SIZE, "NET_IPV4_ROUTE_MAX_SIZE" },
1754 { NET_IPV4_ROUTE_GC_MIN_INTERVAL, "NET_IPV4_ROUTE_GC_MIN_INTERVAL" },
1755 { NET_IPV4_ROUTE_GC_TIMEOUT, "NET_IPV4_ROUTE_GC_TIMEOUT" },
1756 { NET_IPV4_ROUTE_GC_INTERVAL, "NET_IPV4_ROUTE_GC_INTERVAL" },
1757 { NET_IPV4_ROUTE_REDIRECT_LOAD, "NET_IPV4_ROUTE_REDIRECT_LOAD" },
1758 { NET_IPV4_ROUTE_REDIRECT_NUMBER, "NET_IPV4_ROUTE_REDIRECT_NUMBER" },
1759 { NET_IPV4_ROUTE_REDIRECT_SILENCE, "NET_IPV4_ROUTE_REDIRECT_SILENCE" },
1760 { NET_IPV4_ROUTE_ERROR_COST, "NET_IPV4_ROUTE_ERROR_COST" },
1761 { NET_IPV4_ROUTE_ERROR_BURST, "NET_IPV4_ROUTE_ERROR_BURST" },
1762 { NET_IPV4_ROUTE_GC_ELASTICITY, "NET_IPV4_ROUTE_GC_ELASTICITY" },
1763 { 0, NULL }
1764};
1765
1766static struct xlat sysctl_net_ipv4_conf[] = {
1767 { NET_IPV4_CONF_FORWARDING, "NET_IPV4_CONF_FORWARDING" },
1768 { NET_IPV4_CONF_MC_FORWARDING, "NET_IPV4_CONF_MC_FORWARDING" },
1769 { NET_IPV4_CONF_PROXY_ARP, "NET_IPV4_CONF_PROXY_ARP" },
1770 { NET_IPV4_CONF_ACCEPT_REDIRECTS, "NET_IPV4_CONF_ACCEPT_REDIRECTS" },
1771 { NET_IPV4_CONF_SECURE_REDIRECTS, "NET_IPV4_CONF_SECURE_REDIRECTS" },
1772 { NET_IPV4_CONF_SEND_REDIRECTS, "NET_IPV4_CONF_SEND_REDIRECTS" },
1773 { NET_IPV4_CONF_SHARED_MEDIA, "NET_IPV4_CONF_SHARED_MEDIA" },
1774 { NET_IPV4_CONF_RP_FILTER, "NET_IPV4_CONF_RP_FILTER" },
1775 { NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, "NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE" },
1776 { NET_IPV4_CONF_BOOTP_RELAY, "NET_IPV4_CONF_BOOTP_RELAY" },
1777 { NET_IPV4_CONF_LOG_MARTIANS, "NET_IPV4_CONF_LOG_MARTIANS" },
1778 { 0, NULL }
1779};
1780
1781static struct xlat sysctl_net_ipv6[] = {
1782 { NET_IPV6_CONF, "NET_IPV6_CONF" },
1783 { NET_IPV6_NEIGH, "NET_IPV6_NEIGH" },
1784 { NET_IPV6_ROUTE, "NET_IPV6_ROUTE" },
1785 { 0, NULL }
1786};
1787
1788static struct xlat sysctl_net_ipv6_route[] = {
1789 { NET_IPV6_ROUTE_FLUSH, "NET_IPV6_ROUTE_FLUSH" },
1790 { NET_IPV6_ROUTE_GC_THRESH, "NET_IPV6_ROUTE_GC_THRESH" },
1791 { NET_IPV6_ROUTE_MAX_SIZE, "NET_IPV6_ROUTE_MAX_SIZE" },
1792 { NET_IPV6_ROUTE_GC_MIN_INTERVAL, "NET_IPV6_ROUTE_GC_MIN_INTERVAL" },
1793 { NET_IPV6_ROUTE_GC_TIMEOUT, "NET_IPV6_ROUTE_GC_TIMEOUT" },
1794 { NET_IPV6_ROUTE_GC_INTERVAL, "NET_IPV6_ROUTE_GC_INTERVAL" },
1795 { NET_IPV6_ROUTE_GC_ELASTICITY, "NET_IPV6_ROUTE_GC_ELASTICITY" },
1796 { 0, NULL }
1797};
1798
1799int
1800sys_sysctl(tcp)
1801struct tcb *tcp;
1802{
1803 struct __sysctl_args info;
1804 int *name;
1805 umove (tcp, tcp->u_arg[0], &info);
1806
1807 name = alloca (sizeof (int) * info.nlen);
1808 umoven(tcp, (size_t) info.name, sizeof (int) * info.nlen, (char *) name);
1809
1810 if (entering(tcp)) {
1811 int cnt = 0;
1812
1813 tprintf("{{");
1814
1815 if (info.nlen == 0)
1816 goto out;
1817 printxval(sysctl_root, name[0], "CTL_???");
1818 ++cnt;
1819
1820 if (info.nlen == 1)
1821 goto out;
1822 switch (name[0]) {
1823 case CTL_KERN:
1824 tprintf(", ");
1825 printxval(sysctl_kern, name[1], "KERN_???");
1826 ++cnt;
1827 break;
1828 case CTL_VM:
1829 tprintf(", ");
1830 printxval(sysctl_vm, name[1], "VM_???");
1831 ++cnt;
1832 break;
1833 case CTL_NET:
1834 tprintf(", ");
1835 printxval(sysctl_net, name[1], "NET_???");
1836 ++cnt;
1837
1838 if (info.nlen == 2)
1839 goto out;
1840 switch (name[1]) {
1841 case NET_CORE:
1842 tprintf(", ");
1843 printxval(sysctl_net_core, name[2],
1844 "NET_CORE_???");
1845 break;
1846 case NET_UNIX:
1847 tprintf(", ");
1848 printxval(sysctl_net_unix, name[2],
1849 "NET_UNIX_???");
1850 break;
1851 case NET_IPV4:
1852 tprintf(", ");
1853 printxval(sysctl_net_ipv4, name[2],
1854 "NET_IPV4_???");
1855
1856 if (info.nlen == 3)
1857 goto out;
1858 switch (name[2]) {
1859 case NET_IPV4_ROUTE:
1860 tprintf(", ");
1861 printxval(sysctl_net_ipv4_route,
1862 name[3],
1863 "NET_IPV4_ROUTE_???");
1864 break;
1865 case NET_IPV4_CONF:
1866 tprintf(", ");
1867 printxval(sysctl_net_ipv4_conf,
1868 name[3],
1869 "NET_IPV4_CONF_???");
1870 break;
1871 default:
1872 goto out;
1873 }
1874 break;
1875 case NET_IPV6:
1876 tprintf(", ");
1877 printxval(sysctl_net_ipv6, name[2],
1878 "NET_IPV6_???");
1879
1880 if (info.nlen == 3)
1881 goto out;
1882 switch (name[2]) {
1883 case NET_IPV6_ROUTE:
1884 tprintf(", ");
1885 printxval(sysctl_net_ipv6_route,
1886 name[3],
1887 "NET_IPV6_ROUTE_???");
1888 break;
1889 default:
1890 goto out;
1891 }
1892 break;
1893 default:
1894 goto out;
1895 }
1896 break;
1897 default:
1898 goto out;
1899 }
1900 out:
1901 while (cnt < info.nlen)
1902 tprintf(", %x", name[cnt++]);
1903 tprintf("}, %d, ", info.nlen);
1904 } else {
1905 size_t oldlen;
1906 umove(tcp, (size_t)info.oldlenp, &oldlen);
1907 if (info.nlen >= 2
1908 && ((name[0] == CTL_KERN
1909 && (name[1] == KERN_OSRELEASE
1910 || name[1] == KERN_OSTYPE
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001911#ifdef KERN_JAVA_INTERPRETER
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001912 || name[1] == KERN_JAVA_INTERPRETER
Wichert Akkerman9ce1a631999-08-29 23:15:07 +00001913#endif
1914#ifdef KERN_JAVA_APPLETVIEWER
1915 || name[1] == KERN_JAVA_APPLETVIEWER
1916#endif
1917 )))) {
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001918 printpath(tcp, (size_t)info.oldval);
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +00001919 tprintf(", %Zu, ", oldlen);
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001920 if (info.newval == 0)
1921 tprintf("NULL");
1922 else if (syserror(tcp))
1923 tprintf("%p", info.newval);
1924 else
1925 printpath(tcp, (size_t)info.newval);
1926 tprintf(", %Zd", info.newlen);
1927 } else {
Wichert Akkerman8b1b40c2000-02-03 21:58:30 +00001928 tprintf("%p, %Zd, %p, %Zd", info.oldval, oldlen,
Wichert Akkerman22fe9d21999-05-27 12:00:57 +00001929 info.newval, info.newlen);
1930 }
1931 tprintf("}");
1932 }
1933 return 0;
1934}
1935#else
1936int sys_sysctl(tcp)
1937struct tcb *tcp;
1938{
1939 return printargs(tcp);
1940}
1941#endif
1942
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00001943#ifdef FREEBSD
1944#include <sys/sysctl.h>
1945
1946int sys___sysctl(tcp)
1947struct tcb *tcp;
1948{
1949 int qoid[CTL_MAXNAME+2];
1950 char ctl[1024];
1951 size_t len;
1952 int i, numeric;
Roland McGrathced50da2004-08-31 06:48:46 +00001953
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00001954 if (entering(tcp)) {
1955 if (tcp->u_arg[1] < 0 || tcp->u_arg[1] > CTL_MAXNAME ||
1956 (umoven(tcp, tcp->u_arg[0], tcp->u_arg[1] * sizeof(int),
1957 (char *) (qoid + 2)) < 0))
1958 tprintf("[...], ");
1959 else {
1960 /* Use sysctl to ask the name of the current MIB
1961 This uses the undocumented "Staff-functions" used
1962 by the sysctl program. See kern_sysctl.c for
1963 details. */
1964 qoid[0] = 0; /* sysctl */
1965 qoid[1] = 1; /* name */
1966 i = sizeof(ctl);
1967 tprintf("[");
1968 if (sysctl(qoid, tcp->u_arg[1] + 2, ctl, &i, 0, 0) >= 0) {
1969 numeric = !abbrev(tcp);
1970 tprintf("%s%s", ctl, numeric ? ", " : "");
1971 } else
1972 numeric = 1;
1973 if (numeric) {
1974 for (i = 0; i < tcp->u_arg[1]; i++)
1975 tprintf("%s%d", i ? "." : "", qoid[i + 2]);
1976 }
1977 tprintf("], ");
1978 tprintf("%lu, ", tcp->u_arg[1]);
1979 }
1980 } else {
1981 if (!syserror(tcp) && (umove(tcp, tcp->u_arg[3], &len) >= 0)) {
1982 printstr(tcp, tcp->u_arg[2], len);
1983 tprintf(", [%u], ", len);
Roland McGrathced50da2004-08-31 06:48:46 +00001984 } else
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +00001985 tprintf("%#lx, %#lx, ", tcp->u_arg[2], tcp->u_arg[3]);
1986 printstr(tcp, tcp->u_arg[4], tcp->u_arg[5]);
1987 tprintf(", %lu", tcp->u_arg[5]);
1988 }
1989 return 0;
1990}
1991#endif
Wichert Akkerman16a03d22000-08-10 02:14:04 +00001992
1993#if UNIXWARE >= 2
1994
1995#include <sys/ksym.h>
1996#include <sys/elf.h>
1997
1998static struct xlat ksym_flags[] = {
Roland McGrathced50da2004-08-31 06:48:46 +00001999 { STT_NOTYPE, "STT_NOTYPE" },
2000 { STT_FUNC, "STT_FUNC" },
2001 { STT_OBJECT, "STT_OBJECT" },
Wichert Akkerman16a03d22000-08-10 02:14:04 +00002002 { 0, NULL },
2003};
2004
2005int
2006sys_getksym(tcp)
2007struct tcb *tcp;
2008{
2009 if (entering (tcp)) {
2010 printstr(tcp, tcp->u_arg[0], -1);
2011 tprintf(", ");
2012 }
2013 else {
2014 if (syserror(tcp)) {
2015 tprintf("%#lx, %#lx",
2016 tcp->u_arg[1], tcp->u_arg[2]);
2017 }
2018 else {
2019 int val;
2020 printnum (tcp, tcp->u_arg[1], "%#lx");
2021 tprintf(", ");
2022 if (umove(tcp, tcp->u_arg[2], &val) < 0) {
2023 tprintf("%#lx", tcp->u_arg[2]);
2024 }
2025 else {
2026 tprintf("[");
2027 printxval (ksym_flags, val, "STT_???");
2028 tprintf("]");
2029 }
2030 }
2031 }
2032
2033 return 0;
2034}
2035
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002036#ifdef HAVE_SYS_NSCSYS_H
John Hughes4e36a812001-04-18 15:11:51 +00002037
John Hughes0aadba42001-10-16 18:19:52 +00002038struct cred;
John Hughes4e36a812001-04-18 15:11:51 +00002039#include <sys/nscsys.h>
2040
2041static struct xlat ssi_cmd [] = {
2042 { SSISYS_BADOP, "SSISYS_BADOP" },
2043 { SSISYS_LDLVL_INIT,"SSISYS_LDLVL_INIT"},
2044 { SSISYS_LDLVL_GETVEC,"SSISYS_LDLVL_GETVEC"},
2045 { SSISYS_LDLVL_PUTVEC,"SSISYS_LDLVL_PUTVEC"},
2046 { SSISYS_LDLVL_PUTRCMDS,"SSISYS_LDLVL_PUTRCMDS"},
2047 { SSISYS_LDLVL_SETREXEC,"SSISYS_LDLVL_SETREXEC"},
2048 { SSISYS_CMS_CLUSTERID,"SSISYS_CMS_CLUSTERID"},
2049 { SSISYS_CFS_STATVFS,"SSISYS_CFS_STATVFS"},
2050 { SSISYS_NODE_GETNUM,"SSISYS_NODE_GETNUM"},
2051 { SSISYS_NODE_TABLE,"SSISYS_NODE_TABLE"},
2052 { SSISYS_NODE_DOWN,"SSISYS_NODE_DOWN"},
2053 { SSISYS_RECLAIM_CHILD,"SSISYS_RECLAIM_CHILD"},
2054 { SSISYS_IPC_GETINFO,"SSISYS_IPC_GETINFO"},
2055 { SSISYS_ICS_TEST,"SSISYS_ICS_TEST"},
2056 { SSISYS_NODE_PID,"SSISYS_NODE_PID"},
2057 { SSISYS_ISLOCAL,"SSISYS_ISLOCAL"},
2058 { SSISYS_CFS_ISSTACKED,"SSISYS_CFS_ISSTACKED"},
2059 { SSISYS_DNET_SYNC,"SSISYS_DNET_SYNC"},
2060 { SSISYS_CFS_WAIT_MODE,"SSISYS_CFS_WAIT_MODE"},
2061 { SSISYS_CFS_UMOUNT,"SSISYS_CFS_UMOUNT"},
2062 { SSISYS_LLSTAT,"SSISYS_LLSTAT" },
2063 { SSISYS_LTS_PERFTEST,"SSISYS_LTS_PERFTEST"},
2064 { SSISYS_LTS_CONFIG,"SSISYS_LTS_CONFIG"},
2065 { SSISYS_SNET_PERFTEST,"SSISYS_SNET_PERFTEST"},
2066 { SSISYS_IGNORE_HALFUP,"SSISYS_IGNORE_HALFUP"},
2067 { SSISYS_NODE_ROOTDEV,"SSISYS_NODE_ROOTDEV"},
2068 { SSISYS_GET_PRIMARY,"SSISYS_GET_PRIMARY"},
2069 { SSISYS_GET_SECONDARY,"SSISYS_GET_SECONDARY"},
2070 { SSISYS_GET_ROOTDISK,"SSISYS_GET_ROOTDISK"},
2071 { SSISYS_CLUSTERNODE_NUM,"SSISYS_CLUSTERNODE_NUM"},
2072 { SSISYS_CLUSTER_MEMBERSHIP,"SSISYS_CLUSTER_MEMBERSHIP"},
2073 { SSISYS_CLUSTER_DETAILEDTRANS,"SSISYS_CLUSTER_DETAILEDTRANS"},
2074 { SSISYS_CLUSTERNODE_INFO,"SSISYS_CLUSTERNODE_INFO"},
2075 { SSISYS_CLUSTERNODE_SETINFO,"SSISYS_CLUSTERNODE_SETINFO"},
2076 { SSISYS_CLUSTERNODE_AVAIL,"SSISYS_CLUSTERNODE_AVAIL"},
2077 { SSISYS_CLUSTER_MAXNODES,"SSISYS_CLUSTER_MAXNODES"},
2078 { SSISYS_SET_MEMPRIO,"SSISYS_SET_MEMPRIO"},
2079 { SSISYS_GET_USERS,"SSISYS_GET_USERS"},
2080 { SSISYS_FORCE_ROOT_NODE,"SSISYS_FORCE_ROOT_NODE"},
2081 { SSISYS_CVIP_SET,"SSISYS_CVIP_SET"},
2082 { SSISYS_CVIP_GET,"SSISYS_CVIP_GET"},
2083 { SSISYS_GET_NODE_COUNTS,"SSISYS_GET_NODE_COUNTS"},
2084 { SSISYS_GET_TRANSPORT,"SSISYS_GET_TRANSPORT"},
2085 { 0, NULL },
2086};
2087
2088int sys_ssisys (tcp)
2089struct tcb *tcp;
2090{
2091 struct ssisys_iovec iov;
John Hughes2d8b2c52001-10-18 14:52:24 +00002092 cls_nodeinfo_args_t cni;
2093 clusternode_info_t info;
2094
John Hughes4e36a812001-04-18 15:11:51 +00002095 if (entering (tcp)) {
John Hughes0aadba42001-10-16 18:19:52 +00002096 ts_reclaim_child_inargs_t trc;
John Hughes4e36a812001-04-18 15:11:51 +00002097 if (tcp->u_arg[1] != sizeof iov ||
2098 umove (tcp, tcp->u_arg[0], &iov) < 0)
2099 {
2100 tprintf ("%#lx, %ld", tcp->u_arg[0], tcp->u_arg[1]);
2101 return 0;
2102 }
2103 tprintf ("{id=");
2104 printxval(ssi_cmd, iov.tio_id.id_cmd, "SSISYS_???");
2105 tprintf (":%d", iov.tio_id.id_ver);
2106 switch (iov.tio_id.id_cmd) {
John Hughes0aadba42001-10-16 18:19:52 +00002107 case SSISYS_RECLAIM_CHILD:
2108 if (iov.tio_udatainlen != sizeof trc ||
2109 umove (tcp, (long) iov.tio_udatain, &trc) < 0)
2110 goto bad;
2111 tprintf (", in={pid=%ld, start=%ld}",
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002112 trc.trc_pid, trc.trc_start);
John Hughes0aadba42001-10-16 18:19:52 +00002113 break;
2114 case SSISYS_CLUSTERNODE_INFO:
2115 if (iov.tio_udatainlen != sizeof cni ||
2116 umove (tcp, (long) iov.tio_udatain, &cni) < 0)
2117 goto bad;
2118 tprintf (", in={node=%ld, len=%d}",
2119 cni.nodenum, cni.info_len);
2120 break;
John Hughes4e36a812001-04-18 15:11:51 +00002121 default:
John Hughes0aadba42001-10-16 18:19:52 +00002122 bad:
John Hughes4e36a812001-04-18 15:11:51 +00002123 if (iov.tio_udatainlen) {
2124 tprintf (", in=[/* %d bytes */]",
2125 iov.tio_udatainlen);
2126 }
2127 }
2128 }
2129 else {
John Hughes2d8b2c52001-10-18 14:52:24 +00002130 if (tcp->u_arg[1] != sizeof iov ||
2131 umove (tcp, tcp->u_arg[0], &iov) < 0)
2132 goto done;
John Hughes4e36a812001-04-18 15:11:51 +00002133 switch (iov.tio_id.id_cmd) {
John Hughes2d8b2c52001-10-18 14:52:24 +00002134 case SSISYS_CLUSTERNODE_INFO:
2135 if (iov.tio_udatainlen != sizeof cni ||
2136 umove (tcp, (long) iov.tio_udatain, &cni) < 0)
2137 goto bad_out;
Roland McGrathced50da2004-08-31 06:48:46 +00002138 if (cni.info_len != sizeof info ||
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002139 iov.tio_udataoutlen != sizeof &info ||
John Hughes2d8b2c52001-10-18 14:52:24 +00002140 umove (tcp, (long) iov.tio_udataout, &info) < 0)
2141 goto bad_out;
2142 tprintf (", out={node=%ld, cpus=%d, online=%d}",
2143 info.node_num, info.node_totalcpus,
2144 info.node_onlinecpus);
2145 break;
Roland McGrathced50da2004-08-31 06:48:46 +00002146
John Hughes4e36a812001-04-18 15:11:51 +00002147 default:
John Hughes2d8b2c52001-10-18 14:52:24 +00002148 bad_out:
John Hughes4e36a812001-04-18 15:11:51 +00002149 if (iov.tio_udataoutlen) {
2150 tprintf (", out=[/* %d bytes */]",
2151 iov.tio_udataoutlen);
2152 }
2153 }
John Hughes2d8b2c52001-10-18 14:52:24 +00002154 done:
John Hughes4e36a812001-04-18 15:11:51 +00002155 tprintf ("}, %ld", tcp->u_arg[1]);
2156 }
2157 return 0;
2158}
2159
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002160#endif
John Hughes4e36a812001-04-18 15:11:51 +00002161
Roland McGrath5ef24ab2004-02-20 02:22:35 +00002162#endif /* UNIXWARE > 2 */
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002163
2164#ifdef MIPS
2165
Wichert Akkermand6b92492001-04-07 21:37:12 +00002166#ifndef __NEW_UTS_LEN
2167#define __NEW_UTS_LEN 64
2168#endif
2169
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002170static struct xlat sysmips_operations[] = {
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002171 { SETNAME, "SETNAME" },
2172 { FLUSH_CACHE, "FLUSH_CACHE" },
2173 { MIPS_FIXADE, "MIPS_FIXADE" },
2174 { MIPS_RDNVRAM, "MIPS_RDNVRAM" },
2175 { MIPS_ATOMIC_SET, "MIPS_ATOMIC_SET" },
2176 { 0, NULL }
2177};
2178
2179int sys_sysmips(tcp)
2180struct tcb *tcp;
2181{
2182 if (entering(tcp)) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002183 printxval(sysmips_operations, tcp->u_arg[0], "???");
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002184 if (!verbose(tcp)) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002185 tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002186 } else if (tcp->u_arg[0]==SETNAME) {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002187 char nodename[__NEW_UTS_LEN + 1];
2188 if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), nodename) < 0)
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002189 tprintf(", %#lx", tcp->u_arg[1]);
2190 else
2191 tprintf(", \"%s\"", nodename);
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002192 } else if (tcp->u_arg[0] == MIPS_ATOMIC_SET) {
2193 tprintf(", %#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]);
2194 } else if (tcp->u_arg[0] == MIPS_FIXADE) {
2195 tprintf(", 0x%lx", tcp->u_arg[1]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002196 } else {
Wichert Akkerman3472dd52001-04-10 10:27:52 +00002197 tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
Wichert Akkerman0cbfb322001-02-19 13:35:53 +00002198 }
2199 }
2200
2201 return 0;
2202}
2203
2204#endif /* MIPS */