* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <asm/cachectl.h>
#endif
-#ifdef LINUX
-#include <linux/sysctl.h>
+#ifdef HAVE_LINUX_USTNAME_H
+#include <linux/utsname.h>
+#endif
+
+#ifdef MIPS
+#include <asm/sysmips.h>
#endif
+#include <linux/sysctl.h>
+
static struct xlat mount_flags[] = {
{ MS_RDONLY, "MS_RDONLY" },
{ MS_NOSUID, "MS_NOSUID" },
return 0;
}
+#include <linux/reboot.h>
+static struct xlat bootflags1[] = {
+ { LINUX_REBOOT_MAGIC1, "LINUX_REBOOT_MAGIC1" },
+ { 0, NULL },
+};
+
+static struct xlat bootflags2[] = {
+ { LINUX_REBOOT_MAGIC2, "LINUX_REBOOT_MAGIC2" },
+ { LINUX_REBOOT_MAGIC2A, "LINUX_REBOOT_MAGIC2A" },
+ { LINUX_REBOOT_MAGIC2B, "LINUX_REBOOT_MAGIC2B" },
+ { 0, NULL },
+};
+
+static struct xlat bootflags3[] = {
+ { LINUX_REBOOT_CMD_CAD_OFF, "LINUX_REBOOT_CMD_CAD_OFF" },
+ { LINUX_REBOOT_CMD_RESTART, "LINUX_REBOOT_CMD_RESTART" },
+ { LINUX_REBOOT_CMD_HALT, "LINUX_REBOOT_CMD_HALT" },
+ { LINUX_REBOOT_CMD_CAD_ON, "LINUX_REBOOT_CMD_CAD_ON" },
+ { LINUX_REBOOT_CMD_POWER_OFF, "LINUX_REBOOT_CMD_POWER_OFF" },
+ { LINUX_REBOOT_CMD_RESTART2, "LINUX_REBOOT_CMD_RESTART2" },
+ { 0, NULL },
+};
+
+int
+sys_reboot(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ if (!printflags(bootflags1, tcp->u_arg[0]))
+ tprintf("LINUX_REBOOT_MAGIC???");
+ tprintf(", ");
+ if (!printflags(bootflags2, tcp->u_arg[1]))
+ tprintf("LINUX_REBOOT_MAGIC???");
+ tprintf(", ");
+ if (!printflags(bootflags3, tcp->u_arg[2]))
+ tprintf("LINUX_REBOOT_CMD_???");
+ if (tcp->u_arg[2] == LINUX_REBOOT_CMD_RESTART2) {
+ tprintf(", ");
+ printstr(tcp, tcp->u_arg[3], -1);
+ }
+ }
+ return 0;
+}
+
#ifdef M68K
static struct xlat cacheflush_scope[] = {
#ifdef FLUSH_SCOPE_LINE
{ 0, NULL },
};
+int
+sys_sysconf(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printxval(sysconflimits, tcp->u_arg[0], "_SC_???");
+ }
+ return 0;
+}
+
+#endif /* SUNOS4 */
+
+#if defined(SUNOS4) || defined(FREEBSD)
static struct xlat pathconflimits[] = {
#ifdef _PC_LINK_MAX
{ _PC_LINK_MAX, "_PC_LINK_MAX" }, /* max links to file/dir */
{ 0, NULL },
};
-int
-sys_sysconf(tcp)
-struct tcb *tcp;
-{
- if (entering(tcp)) {
- printxval(sysconflimits, tcp->u_arg[0], "_SC_???");
- }
- return 0;
-}
int
sys_pathconf(tcp)
if (entering(tcp)) {
printstr(tcp, tcp->u_arg[0], -1);
tprintf(", ");
- printxval(pathconflimits, tcp->u_arg[1], "_SC_???");
+ printxval(pathconflimits, tcp->u_arg[1], "_PC_???");
}
return 0;
}
{
if (entering(tcp)) {
tprintf("%lu, ", tcp->u_arg[0]);
- printxval(pathconflimits, tcp->u_arg[1], "_SC_???");
+ printxval(pathconflimits, tcp->u_arg[1], "_PC_???");
}
return 0;
}
-#endif /* SUNOS4 */
+#endif /* SUNOS4 || FREEBSD */
#ifdef SVR4
#else /* !MIPS */
+#if UNIXWARE
+
+#include <sys/types.h>
+#include <sys/fstyp.h>
+#include <sys/mount.h>
+#include <sys/xti.h>
+
+#define NFSCLIENT 1
+#include <nfs/mount.h>
+
+#include <sys/fs/vx_ioctl.h>
+
+static struct xlat mount_flags[] = {
+ { MS_RDONLY, "MS_RDONLY" },
+ { MS_FSS, "MS_FSS" },
+ { MS_DATA, "MS_DATA" },
+ { MS_HADBAD, "MS_HADBAD" },
+ { MS_NOSUID, "MS_NOSUID" },
+ { MS_REMOUNT, "MS_REMOUNT" },
+ { MS_NOTRUNC, "MS_NOTRUNC" },
+ { MS_SOFTMNT, "MS_SOFTMNT" },
+ { MS_SYSSPACE, "MS_SYSSPACE" },
+ { 0, NULL },
+};
+
+#ifdef VX_MS_MASK
+static struct xlat vxfs_flags[] = {
+ { VX_MS_NOLOG, "VX_MS_NOLOG" },
+ { VX_MS_BLKCLEAR, "VX_MS_BLKCLEAR" },
+ { VX_MS_SNAPSHOT, "VX_MS_SNAPSHOT" },
+ { VX_MS_NODATAINLOG, "VX_MS_NODATAINLOG" },
+ { VX_MS_DELAYLOG, "VX_MS_DELAYLOG" },
+ { VX_MS_TMPLOG, "VX_MS_TMPLOG" },
+ { VX_MS_FILESET, "VX_MS_FILESET" },
+
+ { VX_MS_CACHE_DIRECT, "VX_MS_CACHE_DIRECT" },
+ { VX_MS_CACHE_DSYNC, "VX_MS_CACHE_DSYNC" },
+ { VX_MS_CACHE_CLOSESYNC,"VX_MS_CACHE_CLOSESYNC" },
+ { VX_MS_CACHE_TMPCACHE, "VX_MS_CACHE_TMPCACHE" },
+
+ { VX_MS_OSYNC_DIRECT, "VX_MS_OSYNC_DIRECT" },
+ { VX_MS_OSYNC_DSYNC, "VX_MS_OSYNC_DSYNC" },
+ { VX_MS_OSYNC_CLOSESYNC,"VX_MS_OSYNC_CLOSESYNC" },
+ { VX_MS_OSYNC_DELAY, "VX_MS_OSYNC_DELAY" },
+ { 0, NULL, },
+};
+#endif
+
+static struct xlat nfs_flags[] = {
+ { NFSMNT_SOFT, "NFSMNT_SOFT" },
+ { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
+ { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
+ { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
+ { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
+ { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
+ { NFSMNT_INT, "NFSMNT_INT" },
+ { NFSMNT_NOAC, "NFSMNT_NOAC" },
+ { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
+ { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
+ { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
+ { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
+ { NFSMNT_SECURE, "NFSMNT_SECURE" },
+ { NFSMNT_NOCTO, "NFSMNT_NOCTO" },
+ { NFSMNT_GRPID, "NFSMNT_GRPID" },
+ { NFSMNT_RPCTIMESYNC, "NFSMNT_RPCTIMESYNC" },
+ { NFSMNT_LWPSMAX, "NFSMNT_LWPSMAX" },
+ { 0, NULL },
+};
+
+int
+sys_mount(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ char fstyp [FSTYPSZ];
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprintf(", ");
+ printflags(mount_flags, tcp->u_arg[2]);
+ /* The doc sez that the file system type is given as a
+ fsindex, and we should use sysfs to work out the name.
+ This appears to be untrue for UW. Maybe it's untrue
+ for all SVR4's? */
+ if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
+ if (umovestr(tcp, tcp->u_arg[3], FSTYPSZ, fstyp) < 0) {
+ *fstyp = 0;
+ tprintf(", %ld", tcp->u_arg[3]);
+ }
+ else
+ tprintf(", \"%s\"", fstyp);
+ }
+ if (tcp->u_arg[2] & MS_DATA) {
+ tprintf(", ");
+#ifdef VX_MS_MASK
+ /* On UW7 they don't give us the defines and structs
+ we need to see what is going on. Bummer. */
+ if (strcmp (fstyp, "vxfs") == 0) {
+ struct vx_mountargs5 args;
+ if (umove(tcp, tcp->u_arg[4], &args) < 0)
+ tprintf("%#lx", tcp->u_arg[4]);
+ else {
+ tprintf("{ flags=");
+ if (!printflags(vxfs_flags, args.mflags))
+ tprintf("0x%08x", args.mflags);
+ if (args.mflags & VX_MS_SNAPSHOT) {
+ tprintf (", snapof=");
+ printstr (tcp,
+ (long) args.primaryspec,
+ -1);
+ if (args.snapsize > 0)
+ tprintf (", snapsize=%ld", args.snapsize);
+ }
+ tprintf(" }");
+ }
+ }
+ else
+#endif
+ if (strcmp (fstyp, "specfs") == 0) {
+ tprintf ("dev=");
+ printstr (tcp, tcp->u_arg[4], -1);
+ }
+ else
+ if (strcmp (fstyp, "nfs") == 0) {
+ struct nfs_args args;
+ if (umove(tcp, tcp->u_arg[4], &args) < 0)
+ tprintf("%#lx", tcp->u_arg[4]);
+ else {
+ struct netbuf addr;
+ tprintf("{ addr=");
+ if (umove (tcp, (int) args.addr, &addr) < 0) {
+ tprintf ("%#lx", (long) args.addr);
+ }
+ else {
+ printsock(tcp, (int) addr.buf, addr.len);
+ }
+ tprintf(", flags=");
+ if (!printflags(nfs_flags, args.flags))
+ tprintf("NFSMNT_???");
+ tprintf(", hostname=");
+ printstr(tcp, (int) args.hostname, -1);
+ tprintf(", ...}");
+ }
+ }
+ else
+ tprintf("%#lx", tcp->u_arg[4]);
+ tprintf(", %ld", tcp->u_arg[5]);
+ }
+ }
+ return 0;
+}
+
+#else /* !UNIXWARE */
+
int
sys_mount(tcp)
struct tcb *tcp;
}
return 0;
}
+#endif /* !UNIXWARE */
#endif /* !MIPS */
#endif /* SVR4 */
#ifdef SYS_capget
+
+static struct xlat capabilities[] = {
+ { 1<<CAP_CHOWN, "CAP_CHOWN" },
+ { 1<<CAP_DAC_OVERRIDE, "CAP_DAC_OVERRIDE"},
+ { 1<<CAP_DAC_READ_SEARCH,"CAP_DAC_READ_SEARCH"},
+ { 1<<CAP_FOWNER, "CAP_FOWNER" },
+ { 1<<CAP_FSETID, "CAP_FSETID" },
+ { 1<<CAP_KILL, "CAP_KILL" },
+ { 1<<CAP_SETGID, "CAP_SETGID" },
+ { 1<<CAP_SETUID, "CAP_SETUID" },
+ { 1<<CAP_SETPCAP, "CAP_SETPCAP" },
+ { 1<<CAP_LINUX_IMMUTABLE,"CAP_LINUX_IMMUTABLE"},
+ { 1<<CAP_NET_BIND_SERVICE,"CAP_NET_BIND_SERVICE"},
+ { 1<<CAP_NET_BROADCAST, "CAP_NET_BROADCAST"},
+ { 1<<CAP_NET_ADMIN, "CAP_NET_ADMIN" },
+ { 1<<CAP_NET_RAW, "CAP_NET_RAW" },
+ { 1<<CAP_IPC_LOCK, "CAP_IPC_LOCK" },
+ { 1<<CAP_IPC_OWNER, "CAP_IPC_OWNER" },
+ { 1<<CAP_SYS_MODULE, "CAP_SYS_MODULE"},
+ { 1<<CAP_SYS_RAWIO, "CAP_SYS_RAWIO" },
+ { 1<<CAP_SYS_CHROOT, "CAP_SYS_CHROOT"},
+ { 1<<CAP_SYS_PTRACE, "CAP_SYS_PTRACE"},
+ { 1<<CAP_SYS_PACCT, "CAP_SYS_PACCT" },
+ { 1<<CAP_SYS_ADMIN, "CAP_SYS_ADMIN" },
+ { 1<<CAP_SYS_BOOT, "CAP_SYS_BOOT" },
+ { 1<<CAP_SYS_NICE, "CAP_SYS_NICE" },
+ { 1<<CAP_SYS_RESOURCE, "CAP_SYS_RESOURCE"},
+ { 1<<CAP_SYS_TIME, "CAP_SYS_TIME" },
+ { 1<<CAP_SYS_TTY_CONFIG,"CAP_SYS_TTY_CONFIG"},
+ { 0, NULL },
+};
+
+
int
sys_capget(tcp)
struct tcb *tcp;
{
- cap_user_header_t arg0;
- cap_user_data_t arg1;
+ static cap_user_header_t arg0 = NULL;
+ static cap_user_data_t arg1 = NULL;
if(!entering(tcp)) {
- arg0 = (cap_user_header_t)tcp->u_arg[0];
- arg1 = (cap_user_data_t)tcp->u_arg[1];
- tprintf("{%lx, %d}, ", (unsigned long)arg0->version, arg0->pid);
- tprintf("{%lx, %lx, %lx}", (unsigned long)arg1->effective,
- (unsigned long)arg1->permitted, (unsigned long)arg1->inheritable);
+ if (!arg0) {
+ if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
+ fprintf(stderr, "sys_capget: no memory\n");
+ tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
+ return -1;
+ }
+ }
+ if (!arg1) {
+ if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
+ fprintf(stderr, "sys_capget: no memory\n");
+ tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
+ return -1;
+ }
+ }
+
+ if (!tcp->u_arg[0])
+ tprintf("NULL");
+ else if (!verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+ else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
+ tprintf("???");
+ else {
+ tprintf("%#x, %d", arg0->version, arg0->pid);
+ }
+ tprintf(", ");
+ if (!tcp->u_arg[1])
+ tprintf("NULL");
+ else if (!verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
+ tprintf("???");
+ else {
+ tprintf("{");
+ printflags(capabilities, arg1->effective);
+ tprintf(", ");
+ printflags(capabilities, arg1->permitted);
+ tprintf(", ");
+ printflags(capabilities, arg1->inheritable);
+ tprintf("}");
+ }
}
return 0;
}
sys_capset(tcp)
struct tcb *tcp;
{
- cap_user_header_t arg0;
- cap_user_data_t arg1;
-
- if(entering(tcp)) {
- arg0 = (cap_user_header_t)tcp->u_arg[0];
- arg1 = (cap_user_data_t)tcp->u_arg[1];
- tprintf("{%lx, %d}, ", (unsigned long)arg0->version, arg0->pid);
- tprintf("{%lx, %lx, %lx}", (unsigned long)arg1->effective,
- (unsigned long)arg1->permitted, (unsigned long)arg1->inheritable);
+ static cap_user_header_t arg0 = NULL;
+ static cap_user_data_t arg1 = NULL;
+
+ if(entering(tcp)) {
+ if (!arg0) {
+ if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
+ fprintf(stderr, "sys_capset: no memory\n");
+ tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
+ return -1;
+ }
+ }
+ if (!arg1) {
+ if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
+ fprintf(stderr, "sys_capset: no memory\n");
+ tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
+ return -1;
+ }
+ }
+
+ if (!tcp->u_arg[0])
+ tprintf("NULL");
+ else if (!verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+ else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0)
+ tprintf("???");
+ else {
+ tprintf("%#x, %d", arg0->version, arg0->pid);
+ }
+ tprintf(", ");
+ if (!tcp->u_arg[1])
+ tprintf("NULL");
+ else if (!verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0)
+ tprintf("???");
+ else {
+ tprintf("{");
+ printflags(capabilities, arg1->effective);
+ tprintf(", ");
+ printflags(capabilities, arg1->permitted);
+ tprintf(", ");
+ printflags(capabilities, arg1->inheritable);
+ tprintf("}");
+ }
}
return 0;
}
{ KERN_PROF, "KERN_PROF" },
{ KERN_NODENAME, "KERN_NODENAME" },
{ KERN_DOMAINNAME, "KERN_DOMAINNAME" },
+#ifdef KERN_SECURELVL
{ KERN_SECURELVL, "KERN_SECURELVL" },
+#endif
{ KERN_PANIC, "KERN_PANIC" },
+#ifdef KERN_REALROOTDEV
{ KERN_REALROOTDEV, "KERN_REALROOTDEV" },
+#endif
+#ifdef KERN_JAVA_INTERPRETER
{ KERN_JAVA_INTERPRETER, "KERN_JAVA_INTERPRETER" },
+#endif
+#ifdef KERN_JAVA_APPLETVIEWER
{ KERN_JAVA_APPLETVIEWER, "KERN_JAVA_APPLETVIEWER" },
+#endif
{ KERN_SPARC_REBOOT, "KERN_SPARC_REBOOT" },
{ KERN_CTLALTDEL, "KERN_CTLALTDEL" },
{ KERN_PRINTK, "KERN_PRINTK" },
&& ((name[0] == CTL_KERN
&& (name[1] == KERN_OSRELEASE
|| name[1] == KERN_OSTYPE
+#ifdef KERN_JAVA_INTERPRETER
|| name[1] == KERN_JAVA_INTERPRETER
- || name[1] == KERN_JAVA_APPLETVIEWER)))) {
+#endif
+#ifdef KERN_JAVA_APPLETVIEWER
+ || name[1] == KERN_JAVA_APPLETVIEWER
+#endif
+ )))) {
printpath(tcp, (size_t)info.oldval);
- tprintf(", %d, ", oldlen);
+ tprintf(", %Zu, ", oldlen);
if (info.newval == 0)
tprintf("NULL");
else if (syserror(tcp))
printpath(tcp, (size_t)info.newval);
tprintf(", %Zd", info.newlen);
} else {
- tprintf("%p, %d, %p, %Zd", info.oldval, oldlen,
+ tprintf("%p, %Zd, %p, %Zd", info.oldval, oldlen,
info.newval, info.newlen);
}
tprintf("}");
}
#endif
+#ifdef FREEBSD
+#include <sys/sysctl.h>
+
+int sys___sysctl(tcp)
+struct tcb *tcp;
+{
+ int qoid[CTL_MAXNAME+2];
+ char ctl[1024];
+ size_t len;
+ int i, numeric;
+
+ if (entering(tcp)) {
+ if (tcp->u_arg[1] < 0 || tcp->u_arg[1] > CTL_MAXNAME ||
+ (umoven(tcp, tcp->u_arg[0], tcp->u_arg[1] * sizeof(int),
+ (char *) (qoid + 2)) < 0))
+ tprintf("[...], ");
+ else {
+ /* Use sysctl to ask the name of the current MIB
+ This uses the undocumented "Staff-functions" used
+ by the sysctl program. See kern_sysctl.c for
+ details. */
+ qoid[0] = 0; /* sysctl */
+ qoid[1] = 1; /* name */
+ i = sizeof(ctl);
+ tprintf("[");
+ if (sysctl(qoid, tcp->u_arg[1] + 2, ctl, &i, 0, 0) >= 0) {
+ numeric = !abbrev(tcp);
+ tprintf("%s%s", ctl, numeric ? ", " : "");
+ } else
+ numeric = 1;
+ if (numeric) {
+ for (i = 0; i < tcp->u_arg[1]; i++)
+ tprintf("%s%d", i ? "." : "", qoid[i + 2]);
+ }
+ tprintf("], ");
+ tprintf("%lu, ", tcp->u_arg[1]);
+ }
+ } else {
+ if (!syserror(tcp) && (umove(tcp, tcp->u_arg[3], &len) >= 0)) {
+ printstr(tcp, tcp->u_arg[2], len);
+ tprintf(", [%u], ", len);
+ } else
+ tprintf("%#lx, %#lx, ", tcp->u_arg[2], tcp->u_arg[3]);
+ printstr(tcp, tcp->u_arg[4], tcp->u_arg[5]);
+ tprintf(", %lu", tcp->u_arg[5]);
+ }
+ return 0;
+}
+#endif
+
+#if UNIXWARE >= 2
+
+#include <sys/ksym.h>
+#include <sys/elf.h>
+
+static struct xlat ksym_flags[] = {
+ { STT_NOTYPE, "STT_NOTYPE" },
+ { STT_FUNC, "STT_FUNC" },
+ { STT_OBJECT, "STT_OBJECT" },
+ { 0, NULL },
+};
+
+int
+sys_getksym(tcp)
+struct tcb *tcp;
+{
+ if (entering (tcp)) {
+ printstr(tcp, tcp->u_arg[0], -1);
+ tprintf(", ");
+ }
+ else {
+ if (syserror(tcp)) {
+ tprintf("%#lx, %#lx",
+ tcp->u_arg[1], tcp->u_arg[2]);
+ }
+ else {
+ int val;
+ printnum (tcp, tcp->u_arg[1], "%#lx");
+ tprintf(", ");
+ if (umove(tcp, tcp->u_arg[2], &val) < 0) {
+ tprintf("%#lx", tcp->u_arg[2]);
+ }
+ else {
+ tprintf("[");
+ printxval (ksym_flags, val, "STT_???");
+ tprintf("]");
+ }
+ }
+ }
+
+ return 0;
+}
+
+#ifdef HAVE_SYS_NSCSYS_H
+
+struct cred;
+#include <sys/nscsys.h>
+
+static struct xlat ssi_cmd [] = {
+ { SSISYS_BADOP, "SSISYS_BADOP" },
+ { SSISYS_LDLVL_INIT,"SSISYS_LDLVL_INIT"},
+ { SSISYS_LDLVL_GETVEC,"SSISYS_LDLVL_GETVEC"},
+ { SSISYS_LDLVL_PUTVEC,"SSISYS_LDLVL_PUTVEC"},
+ { SSISYS_LDLVL_PUTRCMDS,"SSISYS_LDLVL_PUTRCMDS"},
+ { SSISYS_LDLVL_SETREXEC,"SSISYS_LDLVL_SETREXEC"},
+ { SSISYS_CMS_CLUSTERID,"SSISYS_CMS_CLUSTERID"},
+ { SSISYS_CFS_STATVFS,"SSISYS_CFS_STATVFS"},
+ { SSISYS_NODE_GETNUM,"SSISYS_NODE_GETNUM"},
+ { SSISYS_NODE_TABLE,"SSISYS_NODE_TABLE"},
+ { SSISYS_NODE_DOWN,"SSISYS_NODE_DOWN"},
+ { SSISYS_RECLAIM_CHILD,"SSISYS_RECLAIM_CHILD"},
+ { SSISYS_IPC_GETINFO,"SSISYS_IPC_GETINFO"},
+ { SSISYS_ICS_TEST,"SSISYS_ICS_TEST"},
+ { SSISYS_NODE_PID,"SSISYS_NODE_PID"},
+ { SSISYS_ISLOCAL,"SSISYS_ISLOCAL"},
+ { SSISYS_CFS_ISSTACKED,"SSISYS_CFS_ISSTACKED"},
+ { SSISYS_DNET_SYNC,"SSISYS_DNET_SYNC"},
+ { SSISYS_CFS_WAIT_MODE,"SSISYS_CFS_WAIT_MODE"},
+ { SSISYS_CFS_UMOUNT,"SSISYS_CFS_UMOUNT"},
+ { SSISYS_LLSTAT,"SSISYS_LLSTAT" },
+ { SSISYS_LTS_PERFTEST,"SSISYS_LTS_PERFTEST"},
+ { SSISYS_LTS_CONFIG,"SSISYS_LTS_CONFIG"},
+ { SSISYS_SNET_PERFTEST,"SSISYS_SNET_PERFTEST"},
+ { SSISYS_IGNORE_HALFUP,"SSISYS_IGNORE_HALFUP"},
+ { SSISYS_NODE_ROOTDEV,"SSISYS_NODE_ROOTDEV"},
+ { SSISYS_GET_PRIMARY,"SSISYS_GET_PRIMARY"},
+ { SSISYS_GET_SECONDARY,"SSISYS_GET_SECONDARY"},
+ { SSISYS_GET_ROOTDISK,"SSISYS_GET_ROOTDISK"},
+ { SSISYS_CLUSTERNODE_NUM,"SSISYS_CLUSTERNODE_NUM"},
+ { SSISYS_CLUSTER_MEMBERSHIP,"SSISYS_CLUSTER_MEMBERSHIP"},
+ { SSISYS_CLUSTER_DETAILEDTRANS,"SSISYS_CLUSTER_DETAILEDTRANS"},
+ { SSISYS_CLUSTERNODE_INFO,"SSISYS_CLUSTERNODE_INFO"},
+ { SSISYS_CLUSTERNODE_SETINFO,"SSISYS_CLUSTERNODE_SETINFO"},
+ { SSISYS_CLUSTERNODE_AVAIL,"SSISYS_CLUSTERNODE_AVAIL"},
+ { SSISYS_CLUSTER_MAXNODES,"SSISYS_CLUSTER_MAXNODES"},
+ { SSISYS_SET_MEMPRIO,"SSISYS_SET_MEMPRIO"},
+ { SSISYS_GET_USERS,"SSISYS_GET_USERS"},
+ { SSISYS_FORCE_ROOT_NODE,"SSISYS_FORCE_ROOT_NODE"},
+ { SSISYS_CVIP_SET,"SSISYS_CVIP_SET"},
+ { SSISYS_CVIP_GET,"SSISYS_CVIP_GET"},
+ { SSISYS_GET_NODE_COUNTS,"SSISYS_GET_NODE_COUNTS"},
+ { SSISYS_GET_TRANSPORT,"SSISYS_GET_TRANSPORT"},
+ { 0, NULL },
+};
+
+int sys_ssisys (tcp)
+struct tcb *tcp;
+{
+ struct ssisys_iovec iov;
+ cls_nodeinfo_args_t cni;
+ clusternode_info_t info;
+
+ if (entering (tcp)) {
+ ts_reclaim_child_inargs_t trc;
+ if (tcp->u_arg[1] != sizeof iov ||
+ umove (tcp, tcp->u_arg[0], &iov) < 0)
+ {
+ tprintf ("%#lx, %ld", tcp->u_arg[0], tcp->u_arg[1]);
+ return 0;
+ }
+ tprintf ("{id=");
+ printxval(ssi_cmd, iov.tio_id.id_cmd, "SSISYS_???");
+ tprintf (":%d", iov.tio_id.id_ver);
+ switch (iov.tio_id.id_cmd) {
+ case SSISYS_RECLAIM_CHILD:
+ if (iov.tio_udatainlen != sizeof trc ||
+ umove (tcp, (long) iov.tio_udatain, &trc) < 0)
+ goto bad;
+ tprintf (", in={pid=%ld, start=%ld}",
+ trc.trc_pid, trc.trc_start);
+ break;
+ case SSISYS_CLUSTERNODE_INFO:
+ if (iov.tio_udatainlen != sizeof cni ||
+ umove (tcp, (long) iov.tio_udatain, &cni) < 0)
+ goto bad;
+ tprintf (", in={node=%ld, len=%d}",
+ cni.nodenum, cni.info_len);
+ break;
+ default:
+ bad:
+ if (iov.tio_udatainlen) {
+ tprintf (", in=[/* %d bytes */]",
+ iov.tio_udatainlen);
+ }
+ }
+ }
+ else {
+ if (tcp->u_arg[1] != sizeof iov ||
+ umove (tcp, tcp->u_arg[0], &iov) < 0)
+ goto done;
+ switch (iov.tio_id.id_cmd) {
+ case SSISYS_CLUSTERNODE_INFO:
+ if (iov.tio_udatainlen != sizeof cni ||
+ umove (tcp, (long) iov.tio_udatain, &cni) < 0)
+ goto bad_out;
+ if (cni.info_len != sizeof info ||
+ iov.tio_udataoutlen != sizeof &info ||
+ umove (tcp, (long) iov.tio_udataout, &info) < 0)
+ goto bad_out;
+ tprintf (", out={node=%ld, cpus=%d, online=%d}",
+ info.node_num, info.node_totalcpus,
+ info.node_onlinecpus);
+ break;
+
+ default:
+ bad_out:
+ if (iov.tio_udataoutlen) {
+ tprintf (", out=[/* %d bytes */]",
+ iov.tio_udataoutlen);
+ }
+ }
+ done:
+ tprintf ("}, %ld", tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+#endif
+
+#endif /* UNIXWARE > 2 */
+
+#ifdef MIPS
+
+#ifndef __NEW_UTS_LEN
+#define __NEW_UTS_LEN 64
+#endif
+
+static struct xlat sysmips_operations[] = {
+ { SETNAME, "SETNAME" },
+ { FLUSH_CACHE, "FLUSH_CACHE" },
+ { MIPS_FIXADE, "MIPS_FIXADE" },
+ { MIPS_RDNVRAM, "MIPS_RDNVRAM" },
+ { MIPS_ATOMIC_SET, "MIPS_ATOMIC_SET" },
+ { 0, NULL }
+};
+
+int sys_sysmips(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printxval(sysmips_operations, tcp->u_arg[0], "???");
+ if (!verbose(tcp)) {
+ tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
+ } else if (tcp->u_arg[0]==SETNAME) {
+ char nodename[__NEW_UTS_LEN + 1];
+ if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), nodename) < 0)
+ tprintf(", %#lx", tcp->u_arg[1]);
+ else
+ tprintf(", \"%s\"", nodename);
+ } else if (tcp->u_arg[0] == MIPS_ATOMIC_SET) {
+ tprintf(", %#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]);
+ } else if (tcp->u_arg[0] == MIPS_FIXADE) {
+ tprintf(", 0x%lx", tcp->u_arg[1]);
+ } else {
+ tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
+ }
+ }
+
+ return 0;
+}
+
+#endif /* MIPS */