Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1 | /* |
| 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 Akkerman | 4dc8a2a | 1999-12-23 14:20:14 +0000 | [diff] [blame] | 5 | * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl> |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 6 | * 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 Akkerman | 14cd9f0 | 1999-07-09 18:56:34 +0000 | [diff] [blame] | 37 | #define _LINUX_FS_H |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 38 | |
Roland McGrath | cbd3358 | 2005-02-02 04:36:11 +0000 | [diff] [blame] | 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 | #define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */ |
| 46 | #define MS_DIRSYNC 128 /* Directory modifications are synchronous */ |
| 47 | #define MS_NOATIME 1024 /* Do not update access times. */ |
| 48 | #define MS_NODIRATIME 2048 /* Do not update directory access times */ |
| 49 | #define MS_BIND 4096 |
| 50 | #define MS_MOVE 8192 |
| 51 | #define MS_REC 16384 |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 52 | #define MS_SILENT 32768 |
Roland McGrath | cbd3358 | 2005-02-02 04:36:11 +0000 | [diff] [blame] | 53 | #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 54 | #define MS_UNBINDABLE (1<<17) /* change to unbindable */ |
| 55 | #define MS_PRIVATE (1<<18) /* change to private */ |
| 56 | #define MS_SLAVE (1<<19) /* change to slave */ |
| 57 | #define MS_SHARED (1<<20) /* change to shared */ |
Mike Frysinger | 22485b7 | 2011-02-21 23:04:30 -0500 | [diff] [blame] | 58 | #define MS_RELATIME (1<<21) |
| 59 | #define MS_KERNMOUNT (1<<22) |
| 60 | #define MS_I_VERSION (1<<23) |
| 61 | #define MS_STRICTATIME (1<<24) |
| 62 | #define MS_BORN (1<<29) |
Roland McGrath | cbd3358 | 2005-02-02 04:36:11 +0000 | [diff] [blame] | 63 | #define MS_ACTIVE (1<<30) |
| 64 | #define MS_NOUSER (1<<31) |
Roland McGrath | 6af3748 | 2006-01-12 21:21:06 +0000 | [diff] [blame] | 65 | #define MS_MGC_VAL 0xc0ed0000 /* Magic flag number */ |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 66 | #define MS_MGC_MSK 0xffff0000 /* Magic flag mask */ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 67 | |
| 68 | #include <sys/socket.h> |
| 69 | #include <netinet/in.h> |
| 70 | #include <arpa/inet.h> |
| 71 | |
Nate Sammons | 8d5860c | 1999-07-03 18:53:05 +0000 | [diff] [blame] | 72 | #include <sys/syscall.h> |
| 73 | |
Dmitry V. Levin | f48df6c | 2009-06-01 09:59:11 +0000 | [diff] [blame] | 74 | #ifdef HAVE_LINUX_CAPABILITY_H |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 75 | #include <linux/capability.h> |
| 76 | #endif |
| 77 | |
Dmitry V. Levin | f48df6c | 2009-06-01 09:59:11 +0000 | [diff] [blame] | 78 | #ifdef HAVE_ASM_CACHECTL_H |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 79 | #include <asm/cachectl.h> |
| 80 | #endif |
| 81 | |
Wichert Akkerman | d6b9249 | 2001-04-07 21:37:12 +0000 | [diff] [blame] | 82 | #ifdef HAVE_LINUX_USTNAME_H |
| 83 | #include <linux/utsname.h> |
| 84 | #endif |
| 85 | |
Dmitry V. Levin | f48df6c | 2009-06-01 09:59:11 +0000 | [diff] [blame] | 86 | #ifdef HAVE_ASM_SYSMIPS_H |
Wichert Akkerman | d6b9249 | 2001-04-07 21:37:12 +0000 | [diff] [blame] | 87 | #include <asm/sysmips.h> |
| 88 | #endif |
| 89 | |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 90 | #include <linux/sysctl.h> |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 91 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 92 | static const struct xlat mount_flags[] = { |
Roland McGrath | 6af3748 | 2006-01-12 21:21:06 +0000 | [diff] [blame] | 93 | { MS_MGC_VAL, "MS_MGC_VAL" }, |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 94 | { MS_RDONLY, "MS_RDONLY" }, |
| 95 | { MS_NOSUID, "MS_NOSUID" }, |
| 96 | { MS_NODEV, "MS_NODEV" }, |
| 97 | { MS_NOEXEC, "MS_NOEXEC" }, |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 98 | { MS_SYNCHRONOUS,"MS_SYNCHRONOUS"}, |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 99 | { MS_REMOUNT, "MS_REMOUNT" }, |
Mike Frysinger | 22485b7 | 2011-02-21 23:04:30 -0500 | [diff] [blame] | 100 | { MS_RELATIME, "MS_RELATIME" }, |
| 101 | { MS_KERNMOUNT, "MS_KERNMOUNT" }, |
| 102 | { MS_I_VERSION, "MS_I_VERSION" }, |
| 103 | { MS_STRICTATIME,"MS_STRICTATIME"}, |
| 104 | { MS_BORN, "MS_BORN" }, |
Roland McGrath | cbd3358 | 2005-02-02 04:36:11 +0000 | [diff] [blame] | 105 | { MS_MANDLOCK, "MS_MANDLOCK" }, |
| 106 | { MS_NOATIME, "MS_NOATIME" }, |
| 107 | { MS_NODIRATIME,"MS_NODIRATIME" }, |
| 108 | { MS_BIND, "MS_BIND" }, |
| 109 | { MS_MOVE, "MS_MOVE" }, |
| 110 | { MS_REC, "MS_REC" }, |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 111 | { MS_SILENT, "MS_SILENT" }, |
Roland McGrath | cbd3358 | 2005-02-02 04:36:11 +0000 | [diff] [blame] | 112 | { MS_POSIXACL, "MS_POSIXACL" }, |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 113 | { MS_UNBINDABLE,"MS_UNBINDABLE" }, |
| 114 | { MS_PRIVATE, "MS_PRIVATE" }, |
| 115 | { MS_SLAVE, "MS_SLAVE" }, |
| 116 | { MS_SHARED, "MS_SHARED" }, |
Roland McGrath | cbd3358 | 2005-02-02 04:36:11 +0000 | [diff] [blame] | 117 | { MS_ACTIVE, "MS_ACTIVE" }, |
| 118 | { MS_NOUSER, "MS_NOUSER" }, |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 119 | { 0, NULL }, |
| 120 | }; |
| 121 | |
| 122 | int |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 123 | sys_mount(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 124 | { |
| 125 | if (entering(tcp)) { |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 126 | int ignore_type = 0, ignore_data = 0; |
| 127 | unsigned long flags = tcp->u_arg[3]; |
| 128 | |
| 129 | /* Discard magic */ |
| 130 | if ((flags & MS_MGC_MSK) == MS_MGC_VAL) |
| 131 | flags &= ~MS_MGC_MSK; |
| 132 | |
| 133 | if (flags & MS_REMOUNT) |
| 134 | ignore_type = 1; |
| 135 | else if (flags & (MS_BIND | MS_MOVE)) |
| 136 | ignore_type = ignore_data = 1; |
| 137 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 138 | printpath(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 139 | tprints(", "); |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 140 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 141 | printpath(tcp, tcp->u_arg[1]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 142 | tprints(", "); |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 143 | |
| 144 | if (ignore_type && tcp->u_arg[2]) |
Roland McGrath | cbd3358 | 2005-02-02 04:36:11 +0000 | [diff] [blame] | 145 | tprintf("%#lx", tcp->u_arg[2]); |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 146 | else |
| 147 | printstr(tcp, tcp->u_arg[2], -1); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 148 | tprints(", "); |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 149 | |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 150 | printflags(mount_flags, tcp->u_arg[3], "MS_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 151 | tprints(", "); |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 152 | |
| 153 | if (ignore_data && tcp->u_arg[4]) |
Roland McGrath | 6af3748 | 2006-01-12 21:21:06 +0000 | [diff] [blame] | 154 | tprintf("%#lx", tcp->u_arg[4]); |
Dmitry V. Levin | 817b708 | 2007-01-16 15:10:07 +0000 | [diff] [blame] | 155 | else |
| 156 | printstr(tcp, tcp->u_arg[4], -1); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 157 | } |
| 158 | return 0; |
| 159 | } |
| 160 | |
Dmitry V. Levin | 5c7ad8c | 2007-01-13 11:15:48 +0000 | [diff] [blame] | 161 | #define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */ |
| 162 | #define MNT_DETACH 0x00000002 /* Just detach from the tree */ |
| 163 | #define MNT_EXPIRE 0x00000004 /* Mark for expiry */ |
| 164 | |
| 165 | static const struct xlat umount_flags[] = { |
| 166 | { MNT_FORCE, "MNT_FORCE" }, |
| 167 | { MNT_DETACH, "MNT_DETACH" }, |
| 168 | { MNT_EXPIRE, "MNT_EXPIRE" }, |
| 169 | { 0, NULL }, |
| 170 | }; |
| 171 | |
Wichert Akkerman | dacfb6e | 1999-06-03 14:21:07 +0000 | [diff] [blame] | 172 | int |
Dmitry V. Levin | 5c7ad8c | 2007-01-13 11:15:48 +0000 | [diff] [blame] | 173 | sys_umount2(struct tcb *tcp) |
Wichert Akkerman | dacfb6e | 1999-06-03 14:21:07 +0000 | [diff] [blame] | 174 | { |
| 175 | if (entering(tcp)) { |
| 176 | printstr(tcp, tcp->u_arg[0], -1); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 177 | tprints(", "); |
Dmitry V. Levin | 5c7ad8c | 2007-01-13 11:15:48 +0000 | [diff] [blame] | 178 | printflags(umount_flags, tcp->u_arg[1], "MNT_???"); |
Wichert Akkerman | dacfb6e | 1999-06-03 14:21:07 +0000 | [diff] [blame] | 179 | } |
| 180 | return 0; |
| 181 | } |
| 182 | |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 183 | /* These are not macros, but enums. We just copy the values by hand |
| 184 | from Linux 2.6.9 here. */ |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 185 | static const struct xlat personality_options[] = { |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 186 | { 0, "PER_LINUX" }, |
| 187 | { 0x00800000, "PER_LINUX_32BIT"}, |
| 188 | { 0x04100001, "PER_SVR4" }, |
| 189 | { 0x05000002, "PER_SVR3" }, |
| 190 | { 0x07000003, "PER_SCOSVR3" }, |
| 191 | { 0x06000003, "PER_OSR5" }, |
| 192 | { 0x05000004, "PER_WYSEV386" }, |
| 193 | { 0x04000005, "PER_ISCR4" }, |
| 194 | { 0x00000006, "PER_BSD" }, |
| 195 | { 0x04000006, "PER_SUNOS" }, |
| 196 | { 0x05000007, "PER_XENIX" }, |
| 197 | { 0x00000008, "PER_LINUX32" }, |
| 198 | { 0x08000008, "PER_LINUX32_3GB"}, |
| 199 | { 0x04000009, "PER_IRIX32" }, |
| 200 | { 0x0400000a, "PER_IRIXN32" }, |
| 201 | { 0x0400000b, "PER_IRIX64" }, |
| 202 | { 0x0000000c, "PER_RISCOS" }, |
| 203 | { 0x0400000d, "PER_SOLARIS" }, |
| 204 | { 0x0410000e, "PER_UW7" }, |
| 205 | { 0x0000000f, "PER_OSF4" }, |
| 206 | { 0x00000010, "PER_HPUX" }, |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 207 | { 0, NULL }, |
| 208 | }; |
| 209 | |
| 210 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 211 | sys_personality(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 212 | { |
| 213 | if (entering(tcp)) |
| 214 | printxval(personality_options, tcp->u_arg[0], "PER_???"); |
| 215 | return 0; |
| 216 | } |
| 217 | |
Wichert Akkerman | 5ae21ea | 2000-05-01 01:53:59 +0000 | [diff] [blame] | 218 | #include <linux/reboot.h> |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 219 | static const struct xlat bootflags1[] = { |
Wichert Akkerman | 5ae21ea | 2000-05-01 01:53:59 +0000 | [diff] [blame] | 220 | { LINUX_REBOOT_MAGIC1, "LINUX_REBOOT_MAGIC1" }, |
| 221 | { 0, NULL }, |
| 222 | }; |
| 223 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 224 | static const struct xlat bootflags2[] = { |
Wichert Akkerman | 5ae21ea | 2000-05-01 01:53:59 +0000 | [diff] [blame] | 225 | { LINUX_REBOOT_MAGIC2, "LINUX_REBOOT_MAGIC2" }, |
| 226 | { LINUX_REBOOT_MAGIC2A, "LINUX_REBOOT_MAGIC2A" }, |
| 227 | { LINUX_REBOOT_MAGIC2B, "LINUX_REBOOT_MAGIC2B" }, |
| 228 | { 0, NULL }, |
| 229 | }; |
| 230 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 231 | static const struct xlat bootflags3[] = { |
Wichert Akkerman | 5ae21ea | 2000-05-01 01:53:59 +0000 | [diff] [blame] | 232 | { LINUX_REBOOT_CMD_CAD_OFF, "LINUX_REBOOT_CMD_CAD_OFF" }, |
| 233 | { LINUX_REBOOT_CMD_RESTART, "LINUX_REBOOT_CMD_RESTART" }, |
| 234 | { LINUX_REBOOT_CMD_HALT, "LINUX_REBOOT_CMD_HALT" }, |
| 235 | { LINUX_REBOOT_CMD_CAD_ON, "LINUX_REBOOT_CMD_CAD_ON" }, |
| 236 | { LINUX_REBOOT_CMD_POWER_OFF, "LINUX_REBOOT_CMD_POWER_OFF" }, |
| 237 | { LINUX_REBOOT_CMD_RESTART2, "LINUX_REBOOT_CMD_RESTART2" }, |
| 238 | { 0, NULL }, |
| 239 | }; |
| 240 | |
| 241 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 242 | sys_reboot(struct tcb *tcp) |
Wichert Akkerman | 5ae21ea | 2000-05-01 01:53:59 +0000 | [diff] [blame] | 243 | { |
| 244 | if (entering(tcp)) { |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 245 | printflags(bootflags1, tcp->u_arg[0], "LINUX_REBOOT_MAGIC_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 246 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 247 | printflags(bootflags2, tcp->u_arg[1], "LINUX_REBOOT_MAGIC_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 248 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 249 | printflags(bootflags3, tcp->u_arg[2], "LINUX_REBOOT_CMD_???"); |
Wichert Akkerman | 5ae21ea | 2000-05-01 01:53:59 +0000 | [diff] [blame] | 250 | if (tcp->u_arg[2] == LINUX_REBOOT_CMD_RESTART2) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 251 | tprints(", "); |
Wichert Akkerman | 5ae21ea | 2000-05-01 01:53:59 +0000 | [diff] [blame] | 252 | printstr(tcp, tcp->u_arg[3], -1); |
| 253 | } |
| 254 | } |
| 255 | return 0; |
| 256 | } |
| 257 | |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 258 | #ifdef M68K |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 259 | static const struct xlat cacheflush_scope[] = { |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 260 | #ifdef FLUSH_SCOPE_LINE |
| 261 | { FLUSH_SCOPE_LINE, "FLUSH_SCOPE_LINE" }, |
| 262 | #endif |
| 263 | #ifdef FLUSH_SCOPE_PAGE |
| 264 | { FLUSH_SCOPE_PAGE, "FLUSH_SCOPE_PAGE" }, |
| 265 | #endif |
| 266 | #ifdef FLUSH_SCOPE_ALL |
| 267 | { FLUSH_SCOPE_ALL, "FLUSH_SCOPE_ALL" }, |
| 268 | #endif |
| 269 | { 0, NULL }, |
| 270 | }; |
| 271 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 272 | static const struct xlat cacheflush_flags[] = { |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 273 | #ifdef FLUSH_CACHE_BOTH |
| 274 | { FLUSH_CACHE_BOTH, "FLUSH_CACHE_BOTH" }, |
| 275 | #endif |
| 276 | #ifdef FLUSH_CACHE_DATA |
| 277 | { FLUSH_CACHE_DATA, "FLUSH_CACHE_DATA" }, |
| 278 | #endif |
| 279 | #ifdef FLUSH_CACHE_INSN |
| 280 | { FLUSH_CACHE_INSN, "FLUSH_CACHE_INSN" }, |
| 281 | #endif |
| 282 | { 0, NULL }, |
| 283 | }; |
| 284 | |
| 285 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 286 | sys_cacheflush(struct tcb *tcp) |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 287 | { |
| 288 | if (entering(tcp)) { |
| 289 | /* addr */ |
| 290 | tprintf("%#lx, ", tcp->u_arg[0]); |
| 291 | /* scope */ |
| 292 | printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 293 | tprints(", "); |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 294 | /* flags */ |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 295 | printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???"); |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 296 | /* len */ |
| 297 | tprintf(", %lu", tcp->u_arg[3]); |
| 298 | } |
| 299 | return 0; |
| 300 | } |
| 301 | #endif /* M68K */ |
| 302 | |
Dmitry V. Levin | 87ea1f4 | 2008-11-10 22:21:41 +0000 | [diff] [blame] | 303 | #ifdef BFIN |
| 304 | |
| 305 | #include <bfin_sram.h> |
| 306 | |
| 307 | static const struct xlat sram_alloc_flags[] = { |
| 308 | { L1_INST_SRAM, "L1_INST_SRAM" }, |
| 309 | { L1_DATA_A_SRAM, "L1_DATA_A_SRAM" }, |
| 310 | { L1_DATA_B_SRAM, "L1_DATA_B_SRAM" }, |
| 311 | { L1_DATA_SRAM, "L1_DATA_SRAM" }, |
Denys Vlasenko | 132c52a | 2009-03-23 13:12:46 +0000 | [diff] [blame] | 312 | { L2_SRAM, "L2_SRAM" }, |
Dmitry V. Levin | 87ea1f4 | 2008-11-10 22:21:41 +0000 | [diff] [blame] | 313 | { 0, NULL }, |
| 314 | }; |
| 315 | |
| 316 | int |
Denys Vlasenko | 132c52a | 2009-03-23 13:12:46 +0000 | [diff] [blame] | 317 | sys_sram_alloc(struct tcb *tcp) |
Dmitry V. Levin | 87ea1f4 | 2008-11-10 22:21:41 +0000 | [diff] [blame] | 318 | { |
| 319 | if (entering(tcp)) { |
| 320 | /* size */ |
Denys Vlasenko | 132c52a | 2009-03-23 13:12:46 +0000 | [diff] [blame] | 321 | tprintf("%lu, ", tcp->u_arg[0]); |
Dmitry V. Levin | 87ea1f4 | 2008-11-10 22:21:41 +0000 | [diff] [blame] | 322 | /* flags */ |
Denys Vlasenko | 132c52a | 2009-03-23 13:12:46 +0000 | [diff] [blame] | 323 | printxval(sram_alloc_flags, tcp->u_arg[1], "???_SRAM"); |
Dmitry V. Levin | 87ea1f4 | 2008-11-10 22:21:41 +0000 | [diff] [blame] | 324 | } |
| 325 | return 1; |
| 326 | } |
| 327 | |
Mike Frysinger | 260e571 | 2010-09-11 15:04:18 -0400 | [diff] [blame] | 328 | #include <asm/cachectl.h> |
| 329 | |
| 330 | static const struct xlat cacheflush_flags[] = { |
| 331 | { ICACHE, "ICACHE" }, |
| 332 | { DCACHE, "DCACHE" }, |
| 333 | { BCACHE, "BCACHE" }, |
| 334 | { 0, NULL }, |
| 335 | }; |
| 336 | |
| 337 | int |
| 338 | sys_cacheflush(struct tcb *tcp) |
| 339 | { |
| 340 | if (entering(tcp)) { |
| 341 | /* start addr */ |
| 342 | tprintf("%#lx, ", tcp->u_arg[0]); |
| 343 | /* length */ |
| 344 | tprintf("%ld, ", tcp->u_arg[1]); |
| 345 | /* flags */ |
| 346 | printxval(cacheflush_flags, tcp->u_arg[1], "?CACHE"); |
| 347 | } |
| 348 | return 0; |
| 349 | } |
| 350 | |
Dmitry V. Levin | 87ea1f4 | 2008-11-10 22:21:41 +0000 | [diff] [blame] | 351 | #endif |
| 352 | |
Carmelo AMOROSO | f8e5650 | 2010-12-01 14:27:07 +0100 | [diff] [blame] | 353 | #ifdef SH |
| 354 | static const struct xlat cacheflush_flags[] = { |
| 355 | #ifdef CACHEFLUSH_D_INVAL |
| 356 | { CACHEFLUSH_D_INVAL, "CACHEFLUSH_D_INVAL" }, |
| 357 | #endif |
| 358 | #ifdef CACHEFLUSH_D_WB |
| 359 | { CACHEFLUSH_D_WB, "CACHEFLUSH_D_WB" }, |
| 360 | #endif |
| 361 | #ifdef CACHEFLUSH_D_PURGE |
| 362 | { CACHEFLUSH_D_PURGE, "CACHEFLUSH_D_PURGE" }, |
| 363 | #endif |
| 364 | #ifdef CACHEFLUSH_I |
| 365 | { CACHEFLUSH_I, "CACHEFLUSH_I" }, |
| 366 | #endif |
| 367 | { 0, NULL }, |
| 368 | }; |
| 369 | |
| 370 | int |
| 371 | sys_cacheflush(struct tcb *tcp) |
| 372 | { |
| 373 | if (entering(tcp)) { |
| 374 | /* addr */ |
| 375 | tprintf("%#lx, ", tcp->u_arg[0]); |
| 376 | /* len */ |
| 377 | tprintf("%lu, ", tcp->u_arg[1]); |
| 378 | /* flags */ |
| 379 | printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???"); |
| 380 | } |
| 381 | return 0; |
| 382 | } |
| 383 | #endif /* SH */ |
| 384 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 385 | #endif /* LINUX */ |
| 386 | |
| 387 | #ifdef SUNOS4 |
| 388 | |
| 389 | #include <sys/reboot.h> |
| 390 | #define NFSCLIENT |
| 391 | #define LOFS |
| 392 | #define RFS |
| 393 | #define PCFS |
| 394 | #include <sys/mount.h> |
| 395 | #include <sys/socket.h> |
| 396 | #include <nfs/export.h> |
| 397 | #include <rpc/types.h> |
| 398 | #include <rpc/auth.h> |
| 399 | |
| 400 | /*ARGSUSED*/ |
| 401 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 402 | sys_sync(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 403 | { |
| 404 | return 0; |
| 405 | } |
| 406 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 407 | static const struct xlat bootflags[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 408 | { RB_AUTOBOOT, "RB_AUTOBOOT" }, /* for system auto-booting itself */ |
| 409 | { RB_ASKNAME, "RB_ASKNAME" }, /* ask for file name to reboot from */ |
| 410 | { RB_SINGLE, "RB_SINGLE" }, /* reboot to single user only */ |
| 411 | { RB_NOSYNC, "RB_NOSYNC" }, /* dont sync before reboot */ |
| 412 | { RB_HALT, "RB_HALT" }, /* don't reboot, just halt */ |
| 413 | { RB_INITNAME, "RB_INITNAME" }, /* name given for /etc/init */ |
| 414 | { RB_NOBOOTRC, "RB_NOBOOTRC" }, /* don't run /etc/rc.boot */ |
| 415 | { RB_DEBUG, "RB_DEBUG" }, /* being run under debugger */ |
| 416 | { RB_DUMP, "RB_DUMP" }, /* dump system core */ |
| 417 | { RB_WRITABLE, "RB_WRITABLE" }, /* mount root read/write */ |
| 418 | { RB_STRING, "RB_STRING" }, /* pass boot args to prom monitor */ |
| 419 | { 0, NULL }, |
| 420 | }; |
| 421 | |
| 422 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 423 | sys_reboot(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 424 | { |
| 425 | if (entering(tcp)) { |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 426 | printflags(bootflags, tcp->u_arg[0], "RB_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 427 | if (tcp->u_arg[0] & RB_STRING) { |
| 428 | printstr(tcp, tcp->u_arg[1], -1); |
| 429 | } |
| 430 | } |
| 431 | return 0; |
| 432 | } |
| 433 | |
| 434 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 435 | sys_sysacct(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 436 | { |
| 437 | if (entering(tcp)) { |
| 438 | printstr(tcp, tcp->u_arg[0], -1); |
| 439 | } |
| 440 | return 0; |
| 441 | } |
| 442 | |
| 443 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 444 | sys_swapon(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 445 | { |
| 446 | if (entering(tcp)) { |
| 447 | printstr(tcp, tcp->u_arg[0], -1); |
| 448 | } |
| 449 | return 0; |
| 450 | } |
| 451 | |
| 452 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 453 | sys_nfs_svc(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 454 | { |
| 455 | if (entering(tcp)) { |
| 456 | printsock(tcp, tcp->u_arg[0]); |
| 457 | } |
| 458 | return 0; |
| 459 | } |
| 460 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 461 | static const struct xlat mountflags[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 462 | { M_RDONLY, "M_RDONLY" }, |
| 463 | { M_NOSUID, "M_NOSUID" }, |
| 464 | { M_NEWTYPE, "M_NEWTYPE" }, |
| 465 | { M_GRPID, "M_GRPID" }, |
| 466 | #ifdef M_REMOUNT |
| 467 | { M_REMOUNT, "M_REMOUNT" }, |
| 468 | #endif |
| 469 | #ifdef M_NOSUB |
| 470 | { M_NOSUB, "M_NOSUB" }, |
| 471 | #endif |
| 472 | #ifdef M_MULTI |
| 473 | { M_MULTI, "M_MULTI" }, |
| 474 | #endif |
| 475 | #ifdef M_SYS5 |
| 476 | { M_SYS5, "M_SYS5" }, |
| 477 | #endif |
| 478 | { 0, NULL }, |
| 479 | }; |
| 480 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 481 | static const struct xlat nfsflags[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 482 | { NFSMNT_SOFT, "NFSMNT_SOFT" }, |
| 483 | { NFSMNT_WSIZE, "NFSMNT_WSIZE" }, |
| 484 | { NFSMNT_RSIZE, "NFSMNT_RSIZE" }, |
| 485 | { NFSMNT_TIMEO, "NFSMNT_TIMEO" }, |
| 486 | { NFSMNT_RETRANS, "NFSMNT_RETRANS" }, |
| 487 | { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" }, |
| 488 | { NFSMNT_INT, "NFSMNT_INT" }, |
| 489 | { NFSMNT_NOAC, "NFSMNT_NOAC" }, |
| 490 | { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" }, |
| 491 | { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" }, |
| 492 | { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" }, |
| 493 | { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" }, |
| 494 | #ifdef NFSMNT_SECURE |
| 495 | { NFSMNT_SECURE, "NFSMNT_SECURE" }, |
| 496 | #endif |
| 497 | #ifdef NFSMNT_NOCTO |
| 498 | { NFSMNT_NOCTO, "NFSMNT_NOCTO" }, |
| 499 | #endif |
| 500 | #ifdef NFSMNT_POSIX |
| 501 | { NFSMNT_POSIX, "NFSMNT_POSIX" }, |
| 502 | #endif |
| 503 | { 0, NULL }, |
| 504 | }; |
| 505 | |
| 506 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 507 | sys_mount(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 508 | { |
| 509 | char type[4]; |
| 510 | |
| 511 | if (entering(tcp)) { |
| 512 | if (!(tcp->u_arg[2] & M_NEWTYPE) || umovestr(tcp, |
| 513 | tcp->u_arg[0], sizeof type, type) < 0) { |
| 514 | tprintf("OLDTYPE:#%lx", tcp->u_arg[0]); |
| 515 | } else { |
| 516 | tprintf("\"%s\", ", type); |
| 517 | } |
| 518 | printstr(tcp, tcp->u_arg[1], -1); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 519 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 520 | printflags(mountflags, tcp->u_arg[2] & ~M_NEWTYPE, "M_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 521 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 522 | |
| 523 | if (strcmp(type, "4.2") == 0) { |
| 524 | struct ufs_args a; |
| 525 | if (umove(tcp, tcp->u_arg[3], &a) < 0) |
| 526 | return 0; |
| 527 | printstr(tcp, (int)a.fspec, -1); |
| 528 | } else if (strcmp(type, "lo") == 0) { |
| 529 | struct lo_args a; |
| 530 | if (umove(tcp, tcp->u_arg[3], &a) < 0) |
| 531 | return 0; |
| 532 | printstr(tcp, (int)a.fsdir, -1); |
| 533 | } else if (strcmp(type, "nfs") == 0) { |
| 534 | struct nfs_args a; |
| 535 | if (umove(tcp, tcp->u_arg[3], &a) < 0) |
| 536 | return 0; |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 537 | tprints("["); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 538 | printsock(tcp, (int) a.addr); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 539 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 540 | printflags(nfsflags, a.flags, "NFSMNT_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 541 | tprintf(", ws:%u,rs:%u,to:%u,re:%u,", |
| 542 | a.wsize, a.rsize, a.timeo, a.retrans); |
| 543 | if (a.flags & NFSMNT_HOSTNAME && a.hostname) |
| 544 | printstr(tcp, (int)a.hostname, -1); |
| 545 | else |
| 546 | tprintf("%#lx", (unsigned long) a.hostname); |
| 547 | tprintf(",reg-min:%u,max:%u,dir-min:%u,max:%u,", |
| 548 | a.acregmin, a.acregmax, a.acdirmin, a.acdirmax); |
| 549 | if ((a.flags & NFSMNT_SECURE) && a.netname) |
| 550 | printstr(tcp, (int) a.netname, -1); |
| 551 | else |
| 552 | tprintf("%#lx", (unsigned long) a.netname); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 553 | tprints("]"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 554 | } else if (strcmp(type, "rfs") == 0) { |
| 555 | struct rfs_args a; |
| 556 | struct token t; |
| 557 | if (umove(tcp, tcp->u_arg[3], &a) < 0) |
| 558 | return 0; |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 559 | tprints("["); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 560 | printstr(tcp, (int)a.rmtfs, -1); |
| 561 | if (umove(tcp, (int)a.token, &t) < 0) |
| 562 | return 0; |
| 563 | tprintf(", %u, %s]", t.t_id, t.t_uname); |
| 564 | } else if (strcmp(type, "pcfs") == 0) { |
| 565 | struct pc_args a; |
| 566 | if (umove(tcp, tcp->u_arg[3], &a) < 0) |
| 567 | return 0; |
| 568 | printstr(tcp, (int)a.fspec, -1); |
| 569 | } |
| 570 | } |
| 571 | return 0; |
| 572 | } |
| 573 | |
| 574 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 575 | sys_unmount(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 576 | { |
| 577 | if (entering(tcp)) { |
| 578 | printstr(tcp, tcp->u_arg[0], -1); |
| 579 | } |
| 580 | return 0; |
| 581 | } |
| 582 | |
| 583 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 584 | sys_umount(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 585 | { |
| 586 | return sys_unmount(tcp); |
| 587 | } |
| 588 | |
| 589 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 590 | sys_auditsys(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 591 | { |
| 592 | /* XXX - no information available */ |
| 593 | return printargs(tcp); |
| 594 | } |
| 595 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 596 | static const struct xlat ex_auth_flags[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 597 | { AUTH_UNIX, "AUTH_UNIX" }, |
| 598 | { AUTH_DES, "AUTH_DES" }, |
| 599 | { 0, NULL }, |
| 600 | }; |
| 601 | |
| 602 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 603 | sys_exportfs(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 604 | { |
| 605 | struct export e; |
| 606 | int i; |
| 607 | |
| 608 | if (entering(tcp)) { |
| 609 | printstr(tcp, tcp->u_arg[0], -1); |
| 610 | if (umove(tcp, tcp->u_arg[1], &e) < 0) { |
| 611 | tprintf("%#lx", tcp->u_arg[1]); |
| 612 | return 0; |
| 613 | } |
| 614 | tprintf("{fl:%u, anon:%u, ", e.ex_flags, e.ex_anon); |
| 615 | printxval(ex_auth_flags, e.ex_auth, "AUTH_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 616 | tprints(", roots:["); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 617 | if (e.ex_auth == AUTH_UNIX) { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 618 | for (i = 0; i < e.ex_u.exunix.rootaddrs.naddrs; i++) { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 619 | printsock(tcp, |
| 620 | (int)&e.ex_u.exunix.rootaddrs.addrvec[i]); |
| 621 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 622 | tprints("], writers:["); |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 623 | for (i = 0; i < e.ex_writeaddrs.naddrs; i++) { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 624 | printsock(tcp, |
| 625 | (int)&e.ex_writeaddrs.addrvec[i]); |
| 626 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 627 | tprints("]"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 628 | } else { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 629 | for (i = 0; i < e.ex_u.exdes.nnames; i++) { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 630 | printsock(tcp, |
| 631 | (int)&e.ex_u.exdes.rootnames[i]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 632 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 633 | } |
| 634 | tprintf("], window:%u", e.ex_u.exdes.window); |
| 635 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 636 | tprints("}"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 637 | } |
| 638 | return 0; |
| 639 | } |
| 640 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 641 | static const struct xlat sysconflimits[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 642 | #ifdef _SC_ARG_MAX |
| 643 | { _SC_ARG_MAX, "_SC_ARG_MAX" }, /* space for argv & envp */ |
| 644 | #endif |
| 645 | #ifdef _SC_CHILD_MAX |
| 646 | { _SC_CHILD_MAX, "_SC_CHILD_MAX" }, /* maximum children per process??? */ |
| 647 | #endif |
| 648 | #ifdef _SC_CLK_TCK |
| 649 | { _SC_CLK_TCK, "_SC_CLK_TCK" }, /* clock ticks/sec */ |
| 650 | #endif |
| 651 | #ifdef _SC_NGROUPS_MAX |
| 652 | { _SC_NGROUPS_MAX, "_SC_NGROUPS_MAX" }, /* number of groups if multple supp. */ |
| 653 | #endif |
| 654 | #ifdef _SC_OPEN_MAX |
| 655 | { _SC_OPEN_MAX, "_SC_OPEN_MAX" }, /* max open files per process */ |
| 656 | #endif |
| 657 | #ifdef _SC_JOB_CONTROL |
| 658 | { _SC_JOB_CONTROL, "_SC_JOB_CONTROL" }, /* do we have job control */ |
| 659 | #endif |
| 660 | #ifdef _SC_SAVED_IDS |
| 661 | { _SC_SAVED_IDS, "_SC_SAVED_IDS" }, /* do we have saved uid/gids */ |
| 662 | #endif |
| 663 | #ifdef _SC_VERSION |
| 664 | { _SC_VERSION, "_SC_VERSION" }, /* POSIX version supported */ |
| 665 | #endif |
| 666 | { 0, NULL }, |
| 667 | }; |
| 668 | |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 669 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 670 | sys_sysconf(struct tcb *tcp) |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 671 | { |
| 672 | if (entering(tcp)) { |
| 673 | printxval(sysconflimits, tcp->u_arg[0], "_SC_???"); |
| 674 | } |
| 675 | return 0; |
| 676 | } |
| 677 | |
| 678 | #endif /* SUNOS4 */ |
| 679 | |
| 680 | #if defined(SUNOS4) || defined(FREEBSD) |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 681 | static const struct xlat pathconflimits[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 682 | #ifdef _PC_LINK_MAX |
| 683 | { _PC_LINK_MAX, "_PC_LINK_MAX" }, /* max links to file/dir */ |
| 684 | #endif |
| 685 | #ifdef _PC_MAX_CANON |
| 686 | { _PC_MAX_CANON, "_PC_MAX_CANON" }, /* max line length */ |
| 687 | #endif |
| 688 | #ifdef _PC_MAX_INPUT |
| 689 | { _PC_MAX_INPUT, "_PC_MAX_INPUT" }, /* max "packet" to a tty device */ |
| 690 | #endif |
| 691 | #ifdef _PC_NAME_MAX |
| 692 | { _PC_NAME_MAX, "_PC_NAME_MAX" }, /* max pathname component length */ |
| 693 | #endif |
| 694 | #ifdef _PC_PATH_MAX |
| 695 | { _PC_PATH_MAX, "_PC_PATH_MAX" }, /* max pathname length */ |
| 696 | #endif |
| 697 | #ifdef _PC_PIPE_BUF |
| 698 | { _PC_PIPE_BUF, "_PC_PIPE_BUF" }, /* size of a pipe */ |
| 699 | #endif |
| 700 | #ifdef _PC_CHOWN_RESTRICTED |
| 701 | { _PC_CHOWN_RESTRICTED, "_PC_CHOWN_RESTRICTED" }, /* can we give away files */ |
| 702 | #endif |
| 703 | #ifdef _PC_NO_TRUNC |
| 704 | { _PC_NO_TRUNC, "_PC_NO_TRUNC" }, /* trunc or error on >NAME_MAX */ |
| 705 | #endif |
| 706 | #ifdef _PC_VDISABLE |
| 707 | { _PC_VDISABLE, "_PC_VDISABLE" }, /* best char to shut off tty c_cc */ |
| 708 | #endif |
| 709 | { 0, NULL }, |
| 710 | }; |
| 711 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 712 | |
| 713 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 714 | sys_pathconf(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 715 | { |
| 716 | if (entering(tcp)) { |
| 717 | printstr(tcp, tcp->u_arg[0], -1); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 718 | tprints(", "); |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 719 | printxval(pathconflimits, tcp->u_arg[1], "_PC_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 720 | } |
| 721 | return 0; |
| 722 | } |
| 723 | |
| 724 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 725 | sys_fpathconf(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 726 | { |
| 727 | if (entering(tcp)) { |
| 728 | tprintf("%lu, ", tcp->u_arg[0]); |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 729 | printxval(pathconflimits, tcp->u_arg[1], "_PC_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 730 | } |
| 731 | return 0; |
| 732 | } |
| 733 | |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 734 | #endif /* SUNOS4 || FREEBSD */ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 735 | |
| 736 | #ifdef SVR4 |
| 737 | |
| 738 | #ifdef HAVE_SYS_SYSCONFIG_H |
| 739 | #include <sys/sysconfig.h> |
| 740 | #endif /* HAVE_SYS_SYSCONFIG_H */ |
| 741 | |
| 742 | #include <sys/mount.h> |
| 743 | #include <sys/systeminfo.h> |
| 744 | #include <sys/utsname.h> |
| 745 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 746 | static const struct xlat sysconfig_options[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 747 | #ifdef _CONFIG_NGROUPS |
| 748 | { _CONFIG_NGROUPS, "_CONFIG_NGROUPS" }, |
| 749 | #endif |
| 750 | #ifdef _CONFIG_CHILD_MAX |
| 751 | { _CONFIG_CHILD_MAX, "_CONFIG_CHILD_MAX" }, |
| 752 | #endif |
| 753 | #ifdef _CONFIG_OPEN_FILES |
| 754 | { _CONFIG_OPEN_FILES, "_CONFIG_OPEN_FILES" }, |
| 755 | #endif |
| 756 | #ifdef _CONFIG_POSIX_VER |
| 757 | { _CONFIG_POSIX_VER, "_CONFIG_POSIX_VER" }, |
| 758 | #endif |
| 759 | #ifdef _CONFIG_PAGESIZE |
| 760 | { _CONFIG_PAGESIZE, "_CONFIG_PAGESIZE" }, |
| 761 | #endif |
| 762 | #ifdef _CONFIG_CLK_TCK |
| 763 | { _CONFIG_CLK_TCK, "_CONFIG_CLK_TCK" }, |
| 764 | #endif |
| 765 | #ifdef _CONFIG_XOPEN_VER |
| 766 | { _CONFIG_XOPEN_VER, "_CONFIG_XOPEN_VER" }, |
| 767 | #endif |
| 768 | #ifdef _CONFIG_PROF_TCK |
| 769 | { _CONFIG_PROF_TCK, "_CONFIG_PROF_TCK" }, |
| 770 | #endif |
| 771 | #ifdef _CONFIG_NPROC_CONF |
| 772 | { _CONFIG_NPROC_CONF, "_CONFIG_NPROC_CONF" }, |
| 773 | #endif |
| 774 | #ifdef _CONFIG_NPROC_ONLN |
| 775 | { _CONFIG_NPROC_ONLN, "_CONFIG_NPROC_ONLN" }, |
| 776 | #endif |
| 777 | #ifdef _CONFIG_AIO_LISTIO_MAX |
| 778 | { _CONFIG_AIO_LISTIO_MAX, "_CONFIG_AIO_LISTIO_MAX" }, |
| 779 | #endif |
| 780 | #ifdef _CONFIG_AIO_MAX |
| 781 | { _CONFIG_AIO_MAX, "_CONFIG_AIO_MAX" }, |
| 782 | #endif |
| 783 | #ifdef _CONFIG_AIO_PRIO_DELTA_MAX |
| 784 | { _CONFIG_AIO_PRIO_DELTA_MAX, "_CONFIG_AIO_PRIO_DELTA_MAX" }, |
| 785 | #endif |
| 786 | #ifdef _CONFIG_CONFIG_DELAYTIMER_MAX |
| 787 | { _CONFIG_DELAYTIMER_MAX, "_CONFIG_DELAYTIMER_MAX" }, |
| 788 | #endif |
| 789 | #ifdef _CONFIG_MQ_OPEN_MAX |
| 790 | { _CONFIG_MQ_OPEN_MAX, "_CONFIG_MQ_OPEN_MAX" }, |
| 791 | #endif |
| 792 | #ifdef _CONFIG_MQ_PRIO_MAX |
| 793 | { _CONFIG_MQ_PRIO_MAX, "_CONFIG_MQ_PRIO_MAX" }, |
| 794 | #endif |
| 795 | #ifdef _CONFIG_RTSIG_MAX |
| 796 | { _CONFIG_RTSIG_MAX, "_CONFIG_RTSIG_MAX" }, |
| 797 | #endif |
| 798 | #ifdef _CONFIG_SEM_NSEMS_MAX |
| 799 | { _CONFIG_SEM_NSEMS_MAX, "_CONFIG_SEM_NSEMS_MAX" }, |
| 800 | #endif |
| 801 | #ifdef _CONFIG_SEM_VALUE_MAX |
| 802 | { _CONFIG_SEM_VALUE_MAX, "_CONFIG_SEM_VALUE_MAX" }, |
| 803 | #endif |
| 804 | #ifdef _CONFIG_SIGQUEUE_MAX |
| 805 | { _CONFIG_SIGQUEUE_MAX, "_CONFIG_SIGQUEUE_MAX" }, |
| 806 | #endif |
| 807 | #ifdef _CONFIG_SIGRT_MIN |
| 808 | { _CONFIG_SIGRT_MIN, "_CONFIG_SIGRT_MIN" }, |
| 809 | #endif |
| 810 | #ifdef _CONFIG_SIGRT_MAX |
| 811 | { _CONFIG_SIGRT_MAX, "_CONFIG_SIGRT_MAX" }, |
| 812 | #endif |
| 813 | #ifdef _CONFIG_TIMER_MAX |
| 814 | { _CONFIG_TIMER_MAX, "_CONFIG_TIMER_MAX" }, |
| 815 | #endif |
| 816 | #ifdef _CONFIG_CONFIG_PHYS_PAGES |
| 817 | { _CONFIG_PHYS_PAGES, "_CONFIG_PHYS_PAGES" }, |
| 818 | #endif |
| 819 | #ifdef _CONFIG_AVPHYS_PAGES |
| 820 | { _CONFIG_AVPHYS_PAGES, "_CONFIG_AVPHYS_PAGES" }, |
| 821 | #endif |
| 822 | { 0, NULL }, |
| 823 | }; |
| 824 | |
| 825 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 826 | sys_sysconfig(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 827 | { |
| 828 | if (entering(tcp)) |
| 829 | printxval(sysconfig_options, tcp->u_arg[0], "_CONFIG_???"); |
| 830 | return 0; |
| 831 | } |
| 832 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 833 | static const struct xlat sysinfo_options[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 834 | { SI_SYSNAME, "SI_SYSNAME" }, |
| 835 | { SI_HOSTNAME, "SI_HOSTNAME" }, |
| 836 | { SI_RELEASE, "SI_RELEASE" }, |
| 837 | { SI_VERSION, "SI_VERSION" }, |
| 838 | { SI_MACHINE, "SI_MACHINE" }, |
| 839 | { SI_ARCHITECTURE, "SI_ARCHITECTURE" }, |
| 840 | { SI_HW_SERIAL, "SI_HW_SERIAL" }, |
| 841 | { SI_HW_PROVIDER, "SI_HW_PROVIDER" }, |
| 842 | { SI_SRPC_DOMAIN, "SI_SRPC_DOMAIN" }, |
| 843 | #ifdef SI_SET_HOSTNAME |
| 844 | { SI_SET_HOSTNAME, "SI_SET_HOSTNAME" }, |
| 845 | #endif |
| 846 | #ifdef SI_SET_SRPC_DOMAIN |
| 847 | { SI_SET_SRPC_DOMAIN, "SI_SET_SRPC_DOMAIN" }, |
| 848 | #endif |
| 849 | #ifdef SI_SET_KERB_REALM |
| 850 | { SI_SET_KERB_REALM, "SI_SET_KERB_REALM" }, |
| 851 | #endif |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 852 | #ifdef SI_KERB_REALM |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 853 | { SI_KERB_REALM, "SI_KERB_REALM" }, |
| 854 | #endif |
| 855 | { 0, NULL }, |
| 856 | }; |
| 857 | |
| 858 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 859 | sys_sysinfo(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 860 | { |
| 861 | if (entering(tcp)) { |
| 862 | printxval(sysinfo_options, tcp->u_arg[0], "SI_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 863 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 864 | } |
| 865 | else { |
| 866 | /* Technically some calls write values. So what. */ |
| 867 | if (syserror(tcp)) |
| 868 | tprintf("%#lx", tcp->u_arg[1]); |
| 869 | else |
| 870 | printpath(tcp, tcp->u_arg[1]); |
| 871 | tprintf(", %lu", tcp->u_arg[2]); |
| 872 | } |
| 873 | return 0; |
| 874 | } |
| 875 | |
| 876 | #ifdef MIPS |
| 877 | |
| 878 | #include <sys/syssgi.h> |
| 879 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 880 | static const struct xlat syssgi_options[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 881 | { SGI_SYSID, "SGI_SYSID" }, |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 882 | #ifdef SGI_RDUBLK |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 883 | { SGI_RDUBLK, "SGI_RDUBLK" }, |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 884 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 885 | { SGI_TUNE, "SGI_TUNE" }, |
| 886 | { SGI_IDBG, "SGI_IDBG" }, |
| 887 | { SGI_INVENT, "SGI_INVENT" }, |
| 888 | { SGI_RDNAME, "SGI_RDNAME" }, |
| 889 | { SGI_SETLED, "SGI_SETLED" }, |
| 890 | { SGI_SETNVRAM, "SGI_SETNVRAM" }, |
| 891 | { SGI_GETNVRAM, "SGI_GETNVRAM" }, |
| 892 | { SGI_QUERY_FTIMER, "SGI_QUERY_FTIMER" }, |
| 893 | { SGI_QUERY_CYCLECNTR, "SGI_QUERY_CYCLECNTR" }, |
| 894 | { SGI_PROCSZ, "SGI_PROCSZ" }, |
| 895 | { SGI_SIGACTION, "SGI_SIGACTION" }, |
| 896 | { SGI_SIGPENDING, "SGI_SIGPENDING" }, |
| 897 | { SGI_SIGPROCMASK, "SGI_SIGPROCMASK" }, |
| 898 | { SGI_SIGSUSPEND, "SGI_SIGSUSPEND" }, |
| 899 | { SGI_SETSID, "SGI_SETSID" }, |
| 900 | { SGI_SETPGID, "SGI_SETPGID" }, |
| 901 | { SGI_SYSCONF, "SGI_SYSCONF" }, |
| 902 | { SGI_WAIT4, "SGI_WAIT4" }, |
| 903 | { SGI_PATHCONF, "SGI_PATHCONF" }, |
| 904 | { SGI_READB, "SGI_READB" }, |
| 905 | { SGI_WRITEB, "SGI_WRITEB" }, |
| 906 | { SGI_SETGROUPS, "SGI_SETGROUPS" }, |
| 907 | { SGI_GETGROUPS, "SGI_GETGROUPS" }, |
| 908 | { SGI_SETTIMEOFDAY, "SGI_SETTIMEOFDAY" }, |
| 909 | { SGI_SETTIMETRIM, "SGI_SETTIMETRIM" }, |
| 910 | { SGI_GETTIMETRIM, "SGI_GETTIMETRIM" }, |
| 911 | { SGI_SPROFIL, "SGI_SPROFIL" }, |
| 912 | { SGI_RUSAGE, "SGI_RUSAGE" }, |
| 913 | { SGI_SIGSTACK, "SGI_SIGSTACK" }, |
| 914 | { SGI_SIGSTATUS, "SGI_SIGSTATUS" }, |
| 915 | { SGI_NETPROC, "SGI_NETPROC" }, |
| 916 | { SGI_SIGALTSTACK, "SGI_SIGALTSTACK" }, |
| 917 | { SGI_BDFLUSHCNT, "SGI_BDFLUSHCNT" }, |
| 918 | { SGI_SSYNC, "SGI_SSYNC" }, |
| 919 | { SGI_NFSCNVT, "SGI_NFSCNVT" }, |
| 920 | { SGI_GETPGID, "SGI_GETPGID" }, |
| 921 | { SGI_GETSID, "SGI_GETSID" }, |
| 922 | { SGI_IOPROBE, "SGI_IOPROBE" }, |
| 923 | { SGI_CONFIG, "SGI_CONFIG" }, |
| 924 | { SGI_ELFMAP, "SGI_ELFMAP" }, |
| 925 | { SGI_MCONFIG, "SGI_MCONFIG" }, |
| 926 | { SGI_GETPLABEL, "SGI_GETPLABEL" }, |
| 927 | { SGI_SETPLABEL, "SGI_SETPLABEL" }, |
| 928 | { SGI_GETLABEL, "SGI_GETLABEL" }, |
| 929 | { SGI_SETLABEL, "SGI_SETLABEL" }, |
| 930 | { SGI_SATREAD, "SGI_SATREAD" }, |
| 931 | { SGI_SATWRITE, "SGI_SATWRITE" }, |
| 932 | { SGI_SATCTL, "SGI_SATCTL" }, |
| 933 | { SGI_LOADATTR, "SGI_LOADATTR" }, |
| 934 | { SGI_UNLOADATTR, "SGI_UNLOADATTR" }, |
| 935 | #ifdef SGI_RECVLMSG |
| 936 | { SGI_RECVLMSG, "SGI_RECVLMSG" }, |
| 937 | #endif |
| 938 | { SGI_PLANGMOUNT, "SGI_PLANGMOUNT" }, |
| 939 | { SGI_GETPSOACL, "SGI_GETPSOACL" }, |
| 940 | { SGI_SETPSOACL, "SGI_SETPSOACL" }, |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 941 | #ifdef SGI_EAG_GET_ATTR |
| 942 | { SGI_EAG_GET_ATTR, "SGI_EAG_GET_ATTR" }, |
| 943 | #endif |
| 944 | #ifdef SGI_EAG_SET_ATTR |
| 945 | { SGI_EAG_SET_ATTR, "SGI_EAG_SET_ATTR" }, |
| 946 | #endif |
| 947 | #ifdef SGI_EAG_GET_PROCATTR |
| 948 | { SGI_EAG_GET_PROCATTR, "SGI_EAG_GET_PROCATTR" }, |
| 949 | #endif |
| 950 | #ifdef SGI_EAG_SET_PROCATTR |
| 951 | { SGI_EAG_SET_PROCATTR, "SGI_EAG_SET_PROCATTR" }, |
| 952 | #endif |
| 953 | #ifdef SGI_FREVOKE |
| 954 | { SGI_FREVOKE, "SGI_FREVOKE" }, |
| 955 | #endif |
| 956 | #ifdef SGI_SBE_GET_INFO |
| 957 | { SGI_SBE_GET_INFO, "SGI_SBE_GET_INFO" }, |
| 958 | #endif |
| 959 | #ifdef SGI_SBE_CLR_INFO |
| 960 | { SGI_SBE_CLR_INFO, "SGI_SBE_CLR_INFO" }, |
| 961 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 962 | { SGI_RMI_FIXECC, "SGI_RMI_FIXECC" }, |
| 963 | { SGI_R4K_CERRS, "SGI_R4K_CERRS" }, |
| 964 | { SGI_GET_EVCONF, "SGI_GET_EVCONF" }, |
| 965 | { SGI_MPCWAROFF, "SGI_MPCWAROFF" }, |
| 966 | { SGI_SET_AUTOPWRON, "SGI_SET_AUTOPWRON" }, |
| 967 | { SGI_SPIPE, "SGI_SPIPE" }, |
| 968 | { SGI_SYMTAB, "SGI_SYMTAB" }, |
| 969 | #ifdef SGI_SET_FPDEBUG |
| 970 | { SGI_SET_FPDEBUG, "SGI_SET_FPDEBUG" }, |
| 971 | #endif |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 972 | #ifdef SGI_SET_FP_PRECISE |
| 973 | { SGI_SET_FP_PRECISE, "SGI_SET_FP_PRECISE" }, |
| 974 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 975 | { SGI_TOSSTSAVE, "SGI_TOSSTSAVE" }, |
| 976 | { SGI_FDHI, "SGI_FDHI" }, |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 977 | #ifdef SGI_SET_CONFIG_SMM |
| 978 | { SGI_SET_CONFIG_SMM, "SGI_SET_CONFIG_SMM" }, |
| 979 | #endif |
| 980 | #ifdef SGI_SET_FP_PRESERVE |
| 981 | { SGI_SET_FP_PRESERVE, "SGI_SET_FP_PRESERVE" }, |
| 982 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 983 | { SGI_MINRSS, "SGI_MINRSS" }, |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 984 | #ifdef SGI_GRIO |
| 985 | { SGI_GRIO, "SGI_GRIO" }, |
| 986 | #endif |
| 987 | #ifdef SGI_XLV_SET_TAB |
| 988 | { SGI_XLV_SET_TAB, "SGI_XLV_SET_TAB" }, |
| 989 | #endif |
| 990 | #ifdef SGI_XLV_GET_TAB |
| 991 | { SGI_XLV_GET_TAB, "SGI_XLV_GET_TAB" }, |
| 992 | #endif |
| 993 | #ifdef SGI_GET_FP_PRECISE |
| 994 | { SGI_GET_FP_PRECISE, "SGI_GET_FP_PRECISE" }, |
| 995 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 996 | #ifdef SGI_GET_CONFIG_SMM |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 997 | { SGI_GET_CONFIG_SMM, "SGI_GET_CONFIG_SMM" }, |
| 998 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 999 | #ifdef SGI_FP_IMPRECISE_SUPP |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1000 | { SGI_FP_IMPRECISE_SUPP,"SGI_FP_IMPRECISE_SUPP" }, |
| 1001 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1002 | #ifdef SGI_CONFIG_NSMM_SUPP |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1003 | { SGI_CONFIG_NSMM_SUPP, "SGI_CONFIG_NSMM_SUPP" }, |
| 1004 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1005 | #ifdef SGI_RT_TSTAMP_CREATE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1006 | { SGI_RT_TSTAMP_CREATE, "SGI_RT_TSTAMP_CREATE" }, |
| 1007 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1008 | #ifdef SGI_RT_TSTAMP_DELETE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1009 | { SGI_RT_TSTAMP_DELETE, "SGI_RT_TSTAMP_DELETE" }, |
| 1010 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1011 | #ifdef SGI_RT_TSTAMP_START |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1012 | { SGI_RT_TSTAMP_START, "SGI_RT_TSTAMP_START" }, |
| 1013 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1014 | #ifdef SGI_RT_TSTAMP_STOP |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1015 | { SGI_RT_TSTAMP_STOP, "SGI_RT_TSTAMP_STOP" }, |
| 1016 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1017 | #ifdef SGI_RT_TSTAMP_ADDR |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1018 | { SGI_RT_TSTAMP_ADDR, "SGI_RT_TSTAMP_ADDR" }, |
| 1019 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1020 | #ifdef SGI_RT_TSTAMP_MASK |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1021 | { SGI_RT_TSTAMP_MASK, "SGI_RT_TSTAMP_MASK" }, |
| 1022 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1023 | #ifdef SGI_RT_TSTAMP_EOB_MODE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1024 | { SGI_RT_TSTAMP_EOB_MODE,"SGI_RT_TSTAMP_EOB_MODE"}, |
| 1025 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1026 | #ifdef SGI_USE_FP_BCOPY |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1027 | { SGI_USE_FP_BCOPY, "SGI_USE_FP_BCOPY" }, |
| 1028 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1029 | #ifdef SGI_GET_UST |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1030 | { SGI_GET_UST, "SGI_GET_UST" }, |
| 1031 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1032 | #ifdef SGI_SPECULATIVE_EXEC |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1033 | { SGI_SPECULATIVE_EXEC, "SGI_SPECULATIVE_EXEC" }, |
| 1034 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1035 | #ifdef SGI_XLV_NEXT_RQST |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1036 | { SGI_XLV_NEXT_RQST, "SGI_XLV_NEXT_RQST" }, |
| 1037 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1038 | #ifdef SGI_XLV_ATTR_CURSOR |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1039 | { SGI_XLV_ATTR_CURSOR, "SGI_XLV_ATTR_CURSOR" }, |
| 1040 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1041 | #ifdef SGI_XLV_ATTR_GET |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1042 | { SGI_XLV_ATTR_GET, "SGI_XLV_ATTR_GET" }, |
| 1043 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1044 | #ifdef SGI_XLV_ATTR_SET |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1045 | { SGI_XLV_ATTR_SET, "SGI_XLV_ATTR_SET" }, |
| 1046 | #endif |
| 1047 | #ifdef SGI_BTOOLSIZE |
| 1048 | { SGI_BTOOLSIZE, "SGI_BTOOLSIZE" }, |
| 1049 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1050 | #ifdef SGI_BTOOLGET |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1051 | { SGI_BTOOLGET, "SGI_BTOOLGET" }, |
| 1052 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1053 | #ifdef SGI_BTOOLREINIT |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1054 | { SGI_BTOOLREINIT, "SGI_BTOOLREINIT" }, |
| 1055 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1056 | #ifdef SGI_CREATE_UUID |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1057 | { SGI_CREATE_UUID, "SGI_CREATE_UUID" }, |
| 1058 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1059 | #ifdef SGI_NOFPE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1060 | { SGI_NOFPE, "SGI_NOFPE" }, |
| 1061 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1062 | #ifdef SGI_OLD_SOFTFP |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1063 | { SGI_OLD_SOFTFP, "SGI_OLD_SOFTFP" }, |
| 1064 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1065 | #ifdef SGI_FS_INUMBERS |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1066 | { SGI_FS_INUMBERS, "SGI_FS_INUMBERS" }, |
| 1067 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1068 | #ifdef SGI_FS_BULKSTAT |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1069 | { SGI_FS_BULKSTAT, "SGI_FS_BULKSTAT" }, |
| 1070 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1071 | #ifdef SGI_RT_TSTAMP_WAIT |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1072 | { SGI_RT_TSTAMP_WAIT, "SGI_RT_TSTAMP_WAIT" }, |
| 1073 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1074 | #ifdef SGI_RT_TSTAMP_UPDATE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1075 | { SGI_RT_TSTAMP_UPDATE, "SGI_RT_TSTAMP_UPDATE" }, |
| 1076 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1077 | #ifdef SGI_PATH_TO_HANDLE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1078 | { SGI_PATH_TO_HANDLE, "SGI_PATH_TO_HANDLE" }, |
| 1079 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1080 | #ifdef SGI_PATH_TO_FSHANDLE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1081 | { SGI_PATH_TO_FSHANDLE, "SGI_PATH_TO_FSHANDLE" }, |
| 1082 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1083 | #ifdef SGI_FD_TO_HANDLE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1084 | { SGI_FD_TO_HANDLE, "SGI_FD_TO_HANDLE" }, |
| 1085 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1086 | #ifdef SGI_OPEN_BY_HANDLE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1087 | { SGI_OPEN_BY_HANDLE, "SGI_OPEN_BY_HANDLE" }, |
| 1088 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1089 | #ifdef SGI_READLINK_BY_HANDLE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1090 | { SGI_READLINK_BY_HANDLE,"SGI_READLINK_BY_HANDLE"}, |
| 1091 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1092 | #ifdef SGI_READ_DANGID |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1093 | { SGI_READ_DANGID, "SGI_READ_DANGID" }, |
| 1094 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1095 | #ifdef SGI_CONST |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1096 | { SGI_CONST, "SGI_CONST" }, |
| 1097 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1098 | #ifdef SGI_XFS_FSOPERATIONS |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1099 | { SGI_XFS_FSOPERATIONS, "SGI_XFS_FSOPERATIONS" }, |
| 1100 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1101 | #ifdef SGI_SETASH |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1102 | { SGI_SETASH, "SGI_SETASH" }, |
| 1103 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1104 | #ifdef SGI_GETASH |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1105 | { SGI_GETASH, "SGI_GETASH" }, |
| 1106 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1107 | #ifdef SGI_SETPRID |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1108 | { SGI_SETPRID, "SGI_SETPRID" }, |
| 1109 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1110 | #ifdef SGI_GETPRID |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1111 | { SGI_GETPRID, "SGI_GETPRID" }, |
| 1112 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1113 | #ifdef SGI_SETSPINFO |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1114 | { SGI_SETSPINFO, "SGI_SETSPINFO" }, |
| 1115 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1116 | #ifdef SGI_GETSPINFO |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1117 | { SGI_GETSPINFO, "SGI_GETSPINFO" }, |
| 1118 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1119 | #ifdef SGI_SHAREII |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1120 | { SGI_SHAREII, "SGI_SHAREII" }, |
| 1121 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1122 | #ifdef SGI_NEWARRAYSESS |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1123 | { SGI_NEWARRAYSESS, "SGI_NEWARRAYSESS" }, |
| 1124 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1125 | #ifdef SGI_GETDFLTPRID |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1126 | { SGI_GETDFLTPRID, "SGI_GETDFLTPRID" }, |
| 1127 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1128 | #ifdef SGI_SET_DISMISSED_EXC_CNT |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1129 | { SGI_SET_DISMISSED_EXC_CNT,"SGI_SET_DISMISSED_EXC_CNT" }, |
| 1130 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1131 | #ifdef SGI_GET_DISMISSED_EXC_CNT |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1132 | { SGI_GET_DISMISSED_EXC_CNT,"SGI_GET_DISMISSED_EXC_CNT" }, |
| 1133 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1134 | #ifdef SGI_CYCLECNTR_SIZE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1135 | { SGI_CYCLECNTR_SIZE, "SGI_CYCLECNTR_SIZE" }, |
| 1136 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1137 | #ifdef SGI_QUERY_FASTTIMER |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1138 | { SGI_QUERY_FASTTIMER, "SGI_QUERY_FASTTIMER" }, |
| 1139 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1140 | #ifdef SGI_PIDSINASH |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1141 | { SGI_PIDSINASH, "SGI_PIDSINASH" }, |
| 1142 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1143 | #ifdef SGI_ULI |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1144 | { SGI_ULI, "SGI_ULI" }, |
| 1145 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1146 | #ifdef SGI_LPG_SHMGET |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1147 | { SGI_LPG_SHMGET, "SGI_LPG_SHMGET" }, |
| 1148 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1149 | #ifdef SGI_LPG_MAP |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1150 | { SGI_LPG_MAP, "SGI_LPG_MAP" }, |
| 1151 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1152 | #ifdef SGI_CACHEFS_SYS |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1153 | { SGI_CACHEFS_SYS, "SGI_CACHEFS_SYS" }, |
| 1154 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1155 | #ifdef SGI_NFSNOTIFY |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1156 | { SGI_NFSNOTIFY, "SGI_NFSNOTIFY" }, |
| 1157 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1158 | #ifdef SGI_LOCKDSYS |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1159 | { SGI_LOCKDSYS, "SGI_LOCKDSYS" }, |
| 1160 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1161 | #ifdef SGI_EVENTCTR |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1162 | { SGI_EVENTCTR, "SGI_EVENTCTR" }, |
| 1163 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1164 | #ifdef SGI_GETPRUSAGE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1165 | { SGI_GETPRUSAGE, "SGI_GETPRUSAGE" }, |
| 1166 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1167 | #ifdef SGI_PROCMASK_LOCATION |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1168 | { SGI_PROCMASK_LOCATION,"SGI_PROCMASK_LOCATION" }, |
| 1169 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1170 | #ifdef SGI_UNUSED |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1171 | { SGI_UNUSED, "SGI_UNUSED" }, |
| 1172 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1173 | #ifdef SGI_CKPT_SYS |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1174 | { SGI_CKPT_SYS, "SGI_CKPT_SYS" }, |
| 1175 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1176 | #ifdef SGI_CKPT_SYS |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1177 | { SGI_CKPT_SYS, "SGI_CKPT_SYS" }, |
| 1178 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1179 | #ifdef SGI_GETGRPPID |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1180 | { SGI_GETGRPPID, "SGI_GETGRPPID" }, |
| 1181 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1182 | #ifdef SGI_GETSESPID |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1183 | { SGI_GETSESPID, "SGI_GETSESPID" }, |
| 1184 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1185 | #ifdef SGI_ENUMASHS |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1186 | { SGI_ENUMASHS, "SGI_ENUMASHS" }, |
| 1187 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1188 | #ifdef SGI_SETASMACHID |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1189 | { SGI_SETASMACHID, "SGI_SETASMACHID" }, |
| 1190 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1191 | #ifdef SGI_GETASMACHID |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1192 | { SGI_GETASMACHID, "SGI_GETASMACHID" }, |
| 1193 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1194 | #ifdef SGI_GETARSESS |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1195 | { SGI_GETARSESS, "SGI_GETARSESS" }, |
| 1196 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1197 | #ifdef SGI_JOINARRAYSESS |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1198 | { SGI_JOINARRAYSESS, "SGI_JOINARRAYSESS" }, |
| 1199 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1200 | #ifdef SGI_SPROC_KILL |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1201 | { SGI_SPROC_KILL, "SGI_SPROC_KILL" }, |
| 1202 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1203 | #ifdef SGI_DBA_CONFIG |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1204 | { SGI_DBA_CONFIG, "SGI_DBA_CONFIG" }, |
| 1205 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1206 | #ifdef SGI_RELEASE_NAME |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1207 | { SGI_RELEASE_NAME, "SGI_RELEASE_NAME" }, |
| 1208 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1209 | #ifdef SGI_SYNCH_CACHE_HANDLER |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1210 | { SGI_SYNCH_CACHE_HANDLER,"SGI_SYNCH_CACHE_HANDLER"}, |
| 1211 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1212 | #ifdef SGI_SWASH_INIT |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1213 | { SGI_SWASH_INIT, "SGI_SWASH_INIT" }, |
| 1214 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1215 | #ifdef SGI_NUMA_MIGR_PAGE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1216 | { SGI_NUMA_MIGR_PAGE, "SGI_NUMA_MIGR_PAGE" }, |
| 1217 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1218 | #ifdef SGI_NUMA_MIGR_PAGE_ALT |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1219 | { SGI_NUMA_MIGR_PAGE_ALT,"SGI_NUMA_MIGR_PAGE_ALT"}, |
| 1220 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1221 | #ifdef SGI_KAIO_USERINIT |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1222 | { SGI_KAIO_USERINIT, "SGI_KAIO_USERINIT" }, |
| 1223 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1224 | #ifdef SGI_KAIO_READ |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1225 | { SGI_KAIO_READ, "SGI_KAIO_READ" }, |
| 1226 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1227 | #ifdef SGI_KAIO_WRITE |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1228 | { SGI_KAIO_WRITE, "SGI_KAIO_WRITE" }, |
| 1229 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1230 | #ifdef SGI_KAIO_SUSPEND |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1231 | { SGI_KAIO_SUSPEND, "SGI_KAIO_SUSPEND" }, |
| 1232 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1233 | #ifdef SGI_KAIO_STATS |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1234 | { SGI_KAIO_STATS, "SGI_KAIO_STATS" }, |
| 1235 | #endif |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1236 | #ifdef SGI_INITIAL_PT_SPROC |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1237 | { SGI_INITIAL_PT_SPROC, "SGI_INITIAL_PT_SPROC" }, |
| 1238 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1239 | { 0, NULL }, |
| 1240 | }; |
| 1241 | |
| 1242 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1243 | sys_syssgi(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1244 | { |
| 1245 | int i; |
| 1246 | |
| 1247 | if (entering(tcp)) { |
| 1248 | printxval(syssgi_options, tcp->u_arg[0], "SGI_???"); |
| 1249 | switch (tcp->u_arg[0]) { |
| 1250 | default: |
| 1251 | for (i = 1; i < tcp->u_nargs; i++) |
| 1252 | tprintf(", %#lx", tcp->u_arg[i]); |
| 1253 | break; |
| 1254 | } |
| 1255 | } |
| 1256 | return 0; |
| 1257 | } |
| 1258 | |
| 1259 | #include <sys/types.h> |
| 1260 | #include <rpc/rpc.h> |
| 1261 | struct cred; |
| 1262 | struct uio; |
| 1263 | #include <sys/fsid.h> |
| 1264 | #include <sys/vnode.h> |
| 1265 | #include <sys/fs/nfs.h> |
| 1266 | #include <sys/fs/nfs_clnt.h> |
| 1267 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1268 | static const struct xlat mount_flags[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1269 | { MS_RDONLY, "MS_RDONLY" }, |
| 1270 | { MS_FSS, "MS_FSS" }, |
| 1271 | { MS_DATA, "MS_DATA" }, |
| 1272 | { MS_NOSUID, "MS_NOSUID" }, |
| 1273 | { MS_REMOUNT, "MS_REMOUNT" }, |
| 1274 | { MS_NOTRUNC, "MS_NOTRUNC" }, |
| 1275 | { MS_GRPID, "MS_GRPID" }, |
| 1276 | { MS_NODEV, "MS_NODEV" }, |
| 1277 | { MS_BEFORE, "MS_BEFORE" }, |
| 1278 | { MS_AFTER, "MS_AFTER" }, |
| 1279 | { 0, NULL }, |
| 1280 | }; |
| 1281 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1282 | static const struct xlat nfs_flags[] = { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1283 | { NFSMNT_SOFT, "NFSMNT_SOFT" }, |
| 1284 | { NFSMNT_WSIZE, "NFSMNT_WSIZE" }, |
| 1285 | { NFSMNT_RSIZE, "NFSMNT_RSIZE" }, |
| 1286 | { NFSMNT_TIMEO, "NFSMNT_TIMEO" }, |
| 1287 | { NFSMNT_RETRANS, "NFSMNT_RETRANS" }, |
| 1288 | { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" }, |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1289 | #ifdef NFSMNT_NOINT /* IRIX 6 */ |
| 1290 | { NFSMNT_NOINT, "NFSMNT_NOINT" }, |
| 1291 | #endif |
| 1292 | #ifdef NFSMNT_INT /* IRIX 5 */ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1293 | { NFSMNT_INT, "NFSMNT_INT" }, |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1294 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1295 | { NFSMNT_NOAC, "NFSMNT_NOAC" }, |
| 1296 | { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" }, |
| 1297 | { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" }, |
| 1298 | { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" }, |
| 1299 | { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" }, |
| 1300 | { NFSMNT_PRIVATE, "NFSMNT_PRIVATE" }, |
| 1301 | { NFSMNT_SYMTTL, "NFSMNT_SYMTTL" }, |
| 1302 | { NFSMNT_LOOPBACK, "NFSMNT_LOOPBACK" }, |
| 1303 | { NFSMNT_BASETYPE, "NFSMNT_BASETYPE" }, |
| 1304 | { NFSMNT_NAMEMAX, "NFSMNT_NAMEMAX" }, |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 1305 | #ifdef NFSMNT_SHORTUID /* IRIX 6 */ |
| 1306 | { NFSMNT_SHORTUID, "NFSMNT_SHORTUID" }, |
| 1307 | #endif |
| 1308 | #ifdef NFSMNT_ASYNCNLM /* IRIX 6 */ |
| 1309 | { NFSMNT_ASYNCNLM, "NFSMNT_ASYNCNLM" }, |
| 1310 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1311 | { 0, NULL }, |
| 1312 | }; |
| 1313 | |
| 1314 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1315 | sys_mount(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1316 | { |
| 1317 | if (entering(tcp)) { |
| 1318 | printpath(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1319 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1320 | printpath(tcp, tcp->u_arg[1]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1321 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1322 | printflags(mount_flags, tcp->u_arg[2], "MS_???"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1323 | if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1324 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1325 | tprintf("%ld", tcp->u_arg[3]); |
| 1326 | } |
| 1327 | if (tcp->u_arg[2] & MS_DATA) { |
| 1328 | int nfs_type = sysfs(GETFSIND, FSID_NFS); |
| 1329 | |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1330 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1331 | if (tcp->u_arg[3] == nfs_type) { |
| 1332 | struct nfs_args args; |
| 1333 | if (umove(tcp, tcp->u_arg[4], &args) < 0) |
| 1334 | tprintf("%#lx", tcp->u_arg[4]); |
| 1335 | else { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1336 | tprints("addr="); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1337 | printsock(tcp, (int) args.addr); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1338 | tprints(", flags="); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1339 | printflags(nfs_flags, args.flags, "NFSMNT_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1340 | tprints(", hostname="); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1341 | printstr(tcp, (int) args.hostname, -1); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1342 | tprints(", ...}"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1343 | } |
| 1344 | } |
| 1345 | else |
| 1346 | tprintf("%#lx", tcp->u_arg[4]); |
| 1347 | tprintf(", %ld", tcp->u_arg[5]); |
| 1348 | } |
| 1349 | } |
| 1350 | return 0; |
| 1351 | } |
| 1352 | |
| 1353 | #else /* !MIPS */ |
| 1354 | |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1355 | #if UNIXWARE |
| 1356 | |
| 1357 | #include <sys/types.h> |
| 1358 | #include <sys/fstyp.h> |
| 1359 | #include <sys/mount.h> |
| 1360 | #include <sys/xti.h> |
| 1361 | |
| 1362 | #define NFSCLIENT 1 |
| 1363 | #include <nfs/mount.h> |
| 1364 | |
| 1365 | #include <sys/fs/vx_ioctl.h> |
| 1366 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1367 | static const struct xlat mount_flags[] = { |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1368 | { MS_RDONLY, "MS_RDONLY" }, |
| 1369 | { MS_FSS, "MS_FSS" }, |
| 1370 | { MS_DATA, "MS_DATA" }, |
| 1371 | { MS_HADBAD, "MS_HADBAD" }, |
| 1372 | { MS_NOSUID, "MS_NOSUID" }, |
| 1373 | { MS_REMOUNT, "MS_REMOUNT" }, |
| 1374 | { MS_NOTRUNC, "MS_NOTRUNC" }, |
| 1375 | { MS_SOFTMNT, "MS_SOFTMNT" }, |
| 1376 | { MS_SYSSPACE, "MS_SYSSPACE" }, |
| 1377 | { 0, NULL }, |
| 1378 | }; |
| 1379 | |
| 1380 | #ifdef VX_MS_MASK |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1381 | static const struct xlat vxfs_flags[] = { |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1382 | { VX_MS_NOLOG, "VX_MS_NOLOG" }, |
| 1383 | { VX_MS_BLKCLEAR, "VX_MS_BLKCLEAR" }, |
| 1384 | { VX_MS_SNAPSHOT, "VX_MS_SNAPSHOT" }, |
| 1385 | { VX_MS_NODATAINLOG, "VX_MS_NODATAINLOG" }, |
| 1386 | { VX_MS_DELAYLOG, "VX_MS_DELAYLOG" }, |
| 1387 | { VX_MS_TMPLOG, "VX_MS_TMPLOG" }, |
| 1388 | { VX_MS_FILESET, "VX_MS_FILESET" }, |
| 1389 | |
| 1390 | { VX_MS_CACHE_DIRECT, "VX_MS_CACHE_DIRECT" }, |
| 1391 | { VX_MS_CACHE_DSYNC, "VX_MS_CACHE_DSYNC" }, |
| 1392 | { VX_MS_CACHE_CLOSESYNC,"VX_MS_CACHE_CLOSESYNC" }, |
| 1393 | { VX_MS_CACHE_TMPCACHE, "VX_MS_CACHE_TMPCACHE" }, |
| 1394 | |
| 1395 | { VX_MS_OSYNC_DIRECT, "VX_MS_OSYNC_DIRECT" }, |
| 1396 | { VX_MS_OSYNC_DSYNC, "VX_MS_OSYNC_DSYNC" }, |
| 1397 | { VX_MS_OSYNC_CLOSESYNC,"VX_MS_OSYNC_CLOSESYNC" }, |
| 1398 | { VX_MS_OSYNC_DELAY, "VX_MS_OSYNC_DELAY" }, |
| 1399 | { 0, NULL, }, |
| 1400 | }; |
| 1401 | #endif |
| 1402 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1403 | static const struct xlat nfs_flags[] = { |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1404 | { NFSMNT_SOFT, "NFSMNT_SOFT" }, |
| 1405 | { NFSMNT_WSIZE, "NFSMNT_WSIZE" }, |
| 1406 | { NFSMNT_RSIZE, "NFSMNT_RSIZE" }, |
| 1407 | { NFSMNT_TIMEO, "NFSMNT_TIMEO" }, |
| 1408 | { NFSMNT_RETRANS, "NFSMNT_RETRANS" }, |
| 1409 | { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" }, |
| 1410 | { NFSMNT_INT, "NFSMNT_INT" }, |
| 1411 | { NFSMNT_NOAC, "NFSMNT_NOAC" }, |
| 1412 | { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" }, |
| 1413 | { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" }, |
| 1414 | { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" }, |
| 1415 | { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" }, |
| 1416 | { NFSMNT_SECURE, "NFSMNT_SECURE" }, |
| 1417 | { NFSMNT_NOCTO, "NFSMNT_NOCTO" }, |
| 1418 | { NFSMNT_GRPID, "NFSMNT_GRPID" }, |
| 1419 | { NFSMNT_RPCTIMESYNC, "NFSMNT_RPCTIMESYNC" }, |
| 1420 | { NFSMNT_LWPSMAX, "NFSMNT_LWPSMAX" }, |
| 1421 | { 0, NULL }, |
| 1422 | }; |
| 1423 | |
| 1424 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1425 | sys_mount(struct tcb *tcp) |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1426 | { |
| 1427 | if (entering(tcp)) { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1428 | char fstyp[FSTYPSZ]; |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1429 | printpath(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1430 | tprints(", "); |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1431 | printpath(tcp, tcp->u_arg[1]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1432 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1433 | printflags(mount_flags, tcp->u_arg[2], "MS_???"); |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1434 | /* The doc sez that the file system type is given as a |
| 1435 | fsindex, and we should use sysfs to work out the name. |
| 1436 | This appears to be untrue for UW. Maybe it's untrue |
| 1437 | for all SVR4's? */ |
| 1438 | if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) { |
| 1439 | if (umovestr(tcp, tcp->u_arg[3], FSTYPSZ, fstyp) < 0) { |
| 1440 | *fstyp = 0; |
| 1441 | tprintf(", %ld", tcp->u_arg[3]); |
| 1442 | } |
| 1443 | else |
| 1444 | tprintf(", \"%s\"", fstyp); |
| 1445 | } |
| 1446 | if (tcp->u_arg[2] & MS_DATA) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1447 | tprints(", "); |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1448 | #ifdef VX_MS_MASK |
| 1449 | /* On UW7 they don't give us the defines and structs |
| 1450 | we need to see what is going on. Bummer. */ |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1451 | if (strcmp(fstyp, "vxfs") == 0) { |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1452 | struct vx_mountargs5 args; |
| 1453 | if (umove(tcp, tcp->u_arg[4], &args) < 0) |
| 1454 | tprintf("%#lx", tcp->u_arg[4]); |
| 1455 | else { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1456 | tprints("{ flags="); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1457 | printflags(vxfs_flags, args.mflags, "VX_MS_???"); |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1458 | if (args.mflags & VX_MS_SNAPSHOT) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1459 | tprints(", snapof="); |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1460 | printstr(tcp, |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1461 | (long) args.primaryspec, |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1462 | -1); |
| 1463 | if (args.snapsize > 0) |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1464 | tprintf(", snapsize=%ld", args.snapsize); |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1465 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1466 | tprints(" }"); |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1467 | } |
| 1468 | } |
| 1469 | else |
| 1470 | #endif |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1471 | if (strcmp(fstyp, "specfs") == 0) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1472 | tprints("dev="); |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1473 | printstr(tcp, tcp->u_arg[4], -1); |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1474 | } |
| 1475 | else |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1476 | if (strcmp(fstyp, "nfs") == 0) { |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1477 | struct nfs_args args; |
| 1478 | if (umove(tcp, tcp->u_arg[4], &args) < 0) |
| 1479 | tprintf("%#lx", tcp->u_arg[4]); |
| 1480 | else { |
| 1481 | struct netbuf addr; |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1482 | tprints("{ addr="); |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1483 | if (umove(tcp, (int) args.addr, &addr) < 0) { |
| 1484 | tprintf("%#lx", (long) args.addr); |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1485 | } |
| 1486 | else { |
| 1487 | printsock(tcp, (int) addr.buf, addr.len); |
| 1488 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1489 | tprints(", flags="); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1490 | printflags(nfs_flags, args.flags, "NFSMNT_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1491 | tprints(", hostname="); |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1492 | printstr(tcp, (int) args.hostname, -1); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1493 | tprints(", ...}"); |
Wichert Akkerman | 3377df7 | 1999-11-26 13:14:41 +0000 | [diff] [blame] | 1494 | } |
| 1495 | } |
| 1496 | else |
| 1497 | tprintf("%#lx", tcp->u_arg[4]); |
| 1498 | tprintf(", %ld", tcp->u_arg[5]); |
| 1499 | } |
| 1500 | } |
| 1501 | return 0; |
| 1502 | } |
| 1503 | |
| 1504 | #else /* !UNIXWARE */ |
| 1505 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1506 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1507 | sys_mount(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1508 | { |
| 1509 | if (entering(tcp)) { |
| 1510 | printpath(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1511 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1512 | printpath(tcp, tcp->u_arg[1]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1513 | tprints(", ..."); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1514 | } |
| 1515 | return 0; |
| 1516 | } |
Wichert Akkerman | ea78f0f | 1999-11-29 15:34:02 +0000 | [diff] [blame] | 1517 | #endif /* !UNIXWARE */ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1518 | |
| 1519 | #endif /* !MIPS */ |
| 1520 | |
| 1521 | #endif /* SVR4 */ |
| 1522 | |
Nate Sammons | 8d5860c | 1999-07-03 18:53:05 +0000 | [diff] [blame] | 1523 | #ifdef SYS_capget |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1524 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1525 | static const struct xlat capabilities[] = { |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1526 | { 1<<CAP_CHOWN, "CAP_CHOWN" }, |
| 1527 | { 1<<CAP_DAC_OVERRIDE, "CAP_DAC_OVERRIDE"}, |
| 1528 | { 1<<CAP_DAC_READ_SEARCH,"CAP_DAC_READ_SEARCH"}, |
| 1529 | { 1<<CAP_FOWNER, "CAP_FOWNER" }, |
| 1530 | { 1<<CAP_FSETID, "CAP_FSETID" }, |
| 1531 | { 1<<CAP_KILL, "CAP_KILL" }, |
| 1532 | { 1<<CAP_SETGID, "CAP_SETGID" }, |
| 1533 | { 1<<CAP_SETUID, "CAP_SETUID" }, |
| 1534 | { 1<<CAP_SETPCAP, "CAP_SETPCAP" }, |
| 1535 | { 1<<CAP_LINUX_IMMUTABLE,"CAP_LINUX_IMMUTABLE"}, |
| 1536 | { 1<<CAP_NET_BIND_SERVICE,"CAP_NET_BIND_SERVICE"}, |
| 1537 | { 1<<CAP_NET_BROADCAST, "CAP_NET_BROADCAST"}, |
| 1538 | { 1<<CAP_NET_ADMIN, "CAP_NET_ADMIN" }, |
| 1539 | { 1<<CAP_NET_RAW, "CAP_NET_RAW" }, |
| 1540 | { 1<<CAP_IPC_LOCK, "CAP_IPC_LOCK" }, |
| 1541 | { 1<<CAP_IPC_OWNER, "CAP_IPC_OWNER" }, |
| 1542 | { 1<<CAP_SYS_MODULE, "CAP_SYS_MODULE"}, |
| 1543 | { 1<<CAP_SYS_RAWIO, "CAP_SYS_RAWIO" }, |
| 1544 | { 1<<CAP_SYS_CHROOT, "CAP_SYS_CHROOT"}, |
| 1545 | { 1<<CAP_SYS_PTRACE, "CAP_SYS_PTRACE"}, |
| 1546 | { 1<<CAP_SYS_PACCT, "CAP_SYS_PACCT" }, |
| 1547 | { 1<<CAP_SYS_ADMIN, "CAP_SYS_ADMIN" }, |
| 1548 | { 1<<CAP_SYS_BOOT, "CAP_SYS_BOOT" }, |
| 1549 | { 1<<CAP_SYS_NICE, "CAP_SYS_NICE" }, |
| 1550 | { 1<<CAP_SYS_RESOURCE, "CAP_SYS_RESOURCE"}, |
| 1551 | { 1<<CAP_SYS_TIME, "CAP_SYS_TIME" }, |
| 1552 | { 1<<CAP_SYS_TTY_CONFIG,"CAP_SYS_TTY_CONFIG"}, |
Dmitry V. Levin | 949f451 | 2008-11-11 00:21:09 +0000 | [diff] [blame] | 1553 | #ifdef CAP_MKNOD |
| 1554 | { 1<<CAP_MKNOD, "CAP_MKNOD" }, |
| 1555 | #endif |
| 1556 | #ifdef CAP_LEASE |
| 1557 | { 1<<CAP_LEASE, "CAP_LEASE" }, |
| 1558 | #endif |
| 1559 | #ifdef CAP_AUDIT_WRITE |
| 1560 | { 1<<CAP_AUDIT_WRITE, "CAP_AUDIT_WRITE"}, |
| 1561 | #endif |
| 1562 | #ifdef CAP_AUDIT_CONTROL |
| 1563 | { 1<<CAP_AUDIT_CONTROL, "CAP_AUDIT_CONTROL"}, |
| 1564 | #endif |
| 1565 | #ifdef CAP_SETFCAP |
| 1566 | { 1<<CAP_SETFCAP, "CAP_SETFCAP" }, |
| 1567 | #endif |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1568 | { 0, NULL }, |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1569 | }; |
| 1570 | |
| 1571 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1572 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1573 | sys_capget(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1574 | { |
Denys Vlasenko | b0bafbb | 2011-06-23 13:10:28 +0200 | [diff] [blame] | 1575 | /* cap_user_ types are _pointers_ to (small) structs. */ |
| 1576 | /* Structs themselves have no names defined. */ |
| 1577 | /* Have to use ugly hack to place them on stack. */ |
| 1578 | cap_user_header_t arg0; |
| 1579 | cap_user_data_t arg1; |
| 1580 | long a0[sizeof(*arg0) / sizeof(long) + 1]; |
| 1581 | long a1[sizeof(*arg1) / sizeof(long) + 1]; |
Dmitry V. Levin | 1c706b3 | 2011-06-23 13:25:09 +0000 | [diff] [blame] | 1582 | arg0 = (cap_user_header_t) a0; |
| 1583 | arg1 = (cap_user_data_t ) a1; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1584 | |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1585 | if (!entering(tcp)) { |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1586 | if (!tcp->u_arg[0]) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1587 | tprints("NULL"); |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1588 | else if (!verbose(tcp)) |
| 1589 | tprintf("%#lx", tcp->u_arg[0]); |
| 1590 | else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1591 | tprints("???"); |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1592 | else { |
| 1593 | tprintf("%#x, %d", arg0->version, arg0->pid); |
| 1594 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1595 | tprints(", "); |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1596 | if (!tcp->u_arg[1]) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1597 | tprints("NULL"); |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1598 | else if (!verbose(tcp)) |
| 1599 | tprintf("%#lx", tcp->u_arg[1]); |
| 1600 | else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1601 | tprints("???"); |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1602 | else { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1603 | tprints("{"); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1604 | printflags(capabilities, arg1->effective, "CAP_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1605 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1606 | printflags(capabilities, arg1->permitted, "CAP_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1607 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1608 | printflags(capabilities, arg1->inheritable, "CAP_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1609 | tprints("}"); |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1610 | } |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1611 | } |
| 1612 | return 0; |
| 1613 | } |
| 1614 | |
| 1615 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1616 | sys_capset(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1617 | { |
Denys Vlasenko | b0bafbb | 2011-06-23 13:10:28 +0200 | [diff] [blame] | 1618 | cap_user_header_t arg0; |
| 1619 | cap_user_data_t arg1; |
| 1620 | long a0[sizeof(*arg0) / sizeof(long) + 1]; |
| 1621 | long a1[sizeof(*arg1) / sizeof(long) + 1]; |
Dmitry V. Levin | 1c706b3 | 2011-06-23 13:25:09 +0000 | [diff] [blame] | 1622 | arg0 = (cap_user_header_t) a0; |
| 1623 | arg1 = (cap_user_data_t ) a1; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1624 | |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1625 | if (entering(tcp)) { |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1626 | if (!tcp->u_arg[0]) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1627 | tprints("NULL"); |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1628 | else if (!verbose(tcp)) |
| 1629 | tprintf("%#lx", tcp->u_arg[0]); |
| 1630 | else if (umoven(tcp, tcp->u_arg[0], sizeof(*arg0), (char *) arg0) < 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1631 | tprints("???"); |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1632 | else { |
| 1633 | tprintf("%#x, %d", arg0->version, arg0->pid); |
| 1634 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1635 | tprints(", "); |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1636 | if (!tcp->u_arg[1]) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1637 | tprints("NULL"); |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1638 | else if (!verbose(tcp)) |
| 1639 | tprintf("%#lx", tcp->u_arg[1]); |
| 1640 | else if (umoven(tcp, tcp->u_arg[1], sizeof(*arg1), (char *) arg1) < 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1641 | tprints("???"); |
Wichert Akkerman | c792698 | 2000-04-10 22:22:31 +0000 | [diff] [blame] | 1642 | else { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1643 | tprints("{"); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1644 | printflags(capabilities, arg1->effective, "CAP_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1645 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1646 | printflags(capabilities, arg1->permitted, "CAP_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1647 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 1648 | printflags(capabilities, arg1->inheritable, "CAP_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1649 | tprints("}"); |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 1650 | } |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1651 | } |
| 1652 | return 0; |
| 1653 | } |
| 1654 | |
| 1655 | #else |
| 1656 | |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1657 | int sys_capget(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1658 | { |
| 1659 | return printargs(tcp); |
| 1660 | } |
| 1661 | |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1662 | int sys_capset(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1663 | { |
| 1664 | return printargs(tcp); |
| 1665 | } |
| 1666 | |
| 1667 | #endif |
| 1668 | |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1669 | #ifdef LINUX |
Dmitry V. Levin | 35a5578 | 2006-12-04 13:48:10 +0000 | [diff] [blame] | 1670 | /* Linux 2.6.18+ headers removed CTL_PROC enum. */ |
| 1671 | # define CTL_PROC 4 |
Roland McGrath | 5eb1aa5 | 2007-01-11 22:48:39 +0000 | [diff] [blame] | 1672 | # define CTL_CPU 10 /* older headers lack */ |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1673 | static const struct xlat sysctl_root[] = { |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1674 | { CTL_KERN, "CTL_KERN" }, |
| 1675 | { CTL_VM, "CTL_VM" }, |
| 1676 | { CTL_NET, "CTL_NET" }, |
| 1677 | { CTL_PROC, "CTL_PROC" }, |
| 1678 | { CTL_FS, "CTL_FS" }, |
| 1679 | { CTL_DEBUG, "CTL_DEBUG" }, |
| 1680 | { CTL_DEV, "CTL_DEV" }, |
Dmitry V. Levin | 35a5578 | 2006-12-04 13:48:10 +0000 | [diff] [blame] | 1681 | { CTL_BUS, "CTL_BUS" }, |
| 1682 | { CTL_ABI, "CTL_ABI" }, |
| 1683 | { CTL_CPU, "CTL_CPU" }, |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1684 | { 0, NULL } |
| 1685 | }; |
| 1686 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1687 | static const struct xlat sysctl_kern[] = { |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1688 | { KERN_OSTYPE, "KERN_OSTYPE" }, |
| 1689 | { KERN_OSRELEASE, "KERN_OSRELEASE" }, |
| 1690 | { KERN_OSREV, "KERN_OSREV" }, |
| 1691 | { KERN_VERSION, "KERN_VERSION" }, |
| 1692 | { KERN_SECUREMASK, "KERN_SECUREMASK" }, |
| 1693 | { KERN_PROF, "KERN_PROF" }, |
| 1694 | { KERN_NODENAME, "KERN_NODENAME" }, |
| 1695 | { KERN_DOMAINNAME, "KERN_DOMAINNAME" }, |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 1696 | #ifdef KERN_SECURELVL |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1697 | { KERN_SECURELVL, "KERN_SECURELVL" }, |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 1698 | #endif |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1699 | { KERN_PANIC, "KERN_PANIC" }, |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 1700 | #ifdef KERN_REALROOTDEV |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1701 | { KERN_REALROOTDEV, "KERN_REALROOTDEV" }, |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 1702 | #endif |
| 1703 | #ifdef KERN_JAVA_INTERPRETER |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1704 | { KERN_JAVA_INTERPRETER, "KERN_JAVA_INTERPRETER" }, |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 1705 | #endif |
| 1706 | #ifdef KERN_JAVA_APPLETVIEWER |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1707 | { KERN_JAVA_APPLETVIEWER, "KERN_JAVA_APPLETVIEWER" }, |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 1708 | #endif |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1709 | { KERN_SPARC_REBOOT, "KERN_SPARC_REBOOT" }, |
| 1710 | { KERN_CTLALTDEL, "KERN_CTLALTDEL" }, |
| 1711 | { KERN_PRINTK, "KERN_PRINTK" }, |
| 1712 | { KERN_NAMETRANS, "KERN_NAMETRANS" }, |
| 1713 | { KERN_PPC_HTABRECLAIM, "KERN_PPC_HTABRECLAIM" }, |
| 1714 | { KERN_PPC_ZEROPAGED, "KERN_PPC_ZEROPAGED" }, |
| 1715 | { KERN_PPC_POWERSAVE_NAP, "KERN_PPC_POWERSAVE_NAP" }, |
| 1716 | { KERN_MODPROBE, "KERN_MODPROBE" }, |
| 1717 | { KERN_SG_BIG_BUFF, "KERN_SG_BIG_BUFF" }, |
| 1718 | { KERN_ACCT, "KERN_ACCT" }, |
| 1719 | { KERN_PPC_L2CR, "KERN_PPC_L2CR" }, |
| 1720 | { KERN_RTSIGNR, "KERN_RTSIGNR" }, |
| 1721 | { KERN_RTSIGMAX, "KERN_RTSIGMAX" }, |
| 1722 | { KERN_SHMMAX, "KERN_SHMMAX" }, |
| 1723 | { KERN_MSGMAX, "KERN_MSGMAX" }, |
| 1724 | { KERN_MSGMNB, "KERN_MSGMNB" }, |
| 1725 | { KERN_MSGPOOL, "KERN_MSGPOOL" }, |
| 1726 | { 0, NULL } |
| 1727 | }; |
| 1728 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1729 | static const struct xlat sysctl_vm[] = { |
Roland McGrath | a796fd0 | 2004-03-01 22:10:54 +0000 | [diff] [blame] | 1730 | #ifdef VM_SWAPCTL |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1731 | { VM_SWAPCTL, "VM_SWAPCTL" }, |
Roland McGrath | a796fd0 | 2004-03-01 22:10:54 +0000 | [diff] [blame] | 1732 | #endif |
| 1733 | #ifdef VM_UNUSED1 |
| 1734 | { VM_UNUSED1, "VM_UNUSED1" }, |
| 1735 | #endif |
| 1736 | #ifdef VM_SWAPOUT |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1737 | { VM_SWAPOUT, "VM_SWAPOUT" }, |
Roland McGrath | a796fd0 | 2004-03-01 22:10:54 +0000 | [diff] [blame] | 1738 | #endif |
| 1739 | #ifdef VM_UNUSED2 |
| 1740 | { VM_UNUSED2, "VM_UNUSED2" }, |
| 1741 | #endif |
| 1742 | #ifdef VM_FREEPG |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1743 | { VM_FREEPG, "VM_FREEPG" }, |
Roland McGrath | a796fd0 | 2004-03-01 22:10:54 +0000 | [diff] [blame] | 1744 | #endif |
| 1745 | #ifdef VM_UNUSED3 |
| 1746 | { VM_UNUSED3, "VM_UNUSED3" }, |
| 1747 | #endif |
| 1748 | #ifdef VM_BDFLUSH |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1749 | { VM_BDFLUSH, "VM_BDFLUSH" }, |
Roland McGrath | a796fd0 | 2004-03-01 22:10:54 +0000 | [diff] [blame] | 1750 | #endif |
| 1751 | #ifdef VM_UNUSED4 |
| 1752 | { VM_UNUSED4, "VM_UNUSED4" }, |
| 1753 | #endif |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1754 | { VM_OVERCOMMIT_MEMORY, "VM_OVERCOMMIT_MEMORY" }, |
Roland McGrath | a796fd0 | 2004-03-01 22:10:54 +0000 | [diff] [blame] | 1755 | #ifdef VM_BUFFERMEM |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1756 | { VM_BUFFERMEM, "VM_BUFFERMEM" }, |
Roland McGrath | a796fd0 | 2004-03-01 22:10:54 +0000 | [diff] [blame] | 1757 | #endif |
| 1758 | #ifdef VM_UNUSED5 |
| 1759 | { VM_UNUSED5, "VM_UNUSED5" }, |
| 1760 | #endif |
| 1761 | #ifdef VM_PAGECACHE |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1762 | { VM_PAGECACHE, "VM_PAGECACHE" }, |
Roland McGrath | a796fd0 | 2004-03-01 22:10:54 +0000 | [diff] [blame] | 1763 | #endif |
| 1764 | #ifdef VM_UNUSED7 |
| 1765 | { VM_UNUSED7, "VM_UNUSED7" }, |
| 1766 | #endif |
| 1767 | #ifdef VM_PAGERDAEMON |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1768 | { VM_PAGERDAEMON, "VM_PAGERDAEMON" }, |
Roland McGrath | a796fd0 | 2004-03-01 22:10:54 +0000 | [diff] [blame] | 1769 | #endif |
| 1770 | #ifdef VM_UNUSED8 |
| 1771 | { VM_UNUSED8, "VM_UNUSED8" }, |
| 1772 | #endif |
| 1773 | #ifdef VM_PGT_CACHE |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1774 | { VM_PGT_CACHE, "VM_PGT_CACHE" }, |
Roland McGrath | a796fd0 | 2004-03-01 22:10:54 +0000 | [diff] [blame] | 1775 | #endif |
| 1776 | #ifdef VM_UNUSED9 |
| 1777 | { VM_UNUSED9, "VM_UNUSED9" }, |
| 1778 | #endif |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1779 | { VM_PAGE_CLUSTER, "VM_PAGE_CLUSTER" }, |
| 1780 | { 0, NULL }, |
| 1781 | }; |
| 1782 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1783 | static const struct xlat sysctl_net[] = { |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1784 | { NET_CORE, "NET_CORE" }, |
| 1785 | { NET_ETHER, "NET_ETHER" }, |
| 1786 | { NET_802, "NET_802" }, |
| 1787 | { NET_UNIX, "NET_UNIX" }, |
| 1788 | { NET_IPV4, "NET_IPV4" }, |
| 1789 | { NET_IPX, "NET_IPX" }, |
| 1790 | { NET_ATALK, "NET_ATALK" }, |
| 1791 | { NET_NETROM, "NET_NETROM" }, |
| 1792 | { NET_AX25, "NET_AX25" }, |
| 1793 | { NET_BRIDGE, "NET_BRIDGE" }, |
| 1794 | { NET_ROSE, "NET_ROSE" }, |
| 1795 | { NET_IPV6, "NET_IPV6" }, |
| 1796 | { NET_X25, "NET_X25" }, |
| 1797 | { NET_TR, "NET_TR" }, |
| 1798 | { NET_DECNET, "NET_DECNET" }, |
| 1799 | { 0, NULL } |
| 1800 | }; |
| 1801 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1802 | static const struct xlat sysctl_net_core[] = { |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1803 | { NET_CORE_WMEM_MAX, "NET_CORE_WMEM_MAX" }, |
| 1804 | { NET_CORE_RMEM_MAX, "NET_CORE_RMEM_MAX" }, |
| 1805 | { NET_CORE_WMEM_DEFAULT, "NET_CORE_WMEM_DEFAULT" }, |
| 1806 | { NET_CORE_RMEM_DEFAULT, "NET_CORE_RMEM_DEFAULT" }, |
| 1807 | { NET_CORE_MAX_BACKLOG, "NET_CORE_MAX_BACKLOG" }, |
| 1808 | { NET_CORE_FASTROUTE, "NET_CORE_FASTROUTE" }, |
| 1809 | { NET_CORE_MSG_COST, "NET_CORE_MSG_COST" }, |
| 1810 | { NET_CORE_MSG_BURST, "NET_CORE_MSG_BURST" }, |
| 1811 | { NET_CORE_OPTMEM_MAX, "NET_CORE_OPTMEM_MAX" }, |
| 1812 | { 0, NULL } |
| 1813 | }; |
| 1814 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1815 | static const struct xlat sysctl_net_unix[] = { |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1816 | { NET_UNIX_DESTROY_DELAY, "NET_UNIX_DESTROY_DELAY" }, |
| 1817 | { NET_UNIX_DELETE_DELAY, "NET_UNIX_DELETE_DELAY" }, |
| 1818 | { 0, NULL } |
| 1819 | }; |
| 1820 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1821 | static const struct xlat sysctl_net_ipv4[] = { |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1822 | { NET_IPV4_FORWARD, "NET_IPV4_FORWARD" }, |
| 1823 | { NET_IPV4_DYNADDR, "NET_IPV4_DYNADDR" }, |
| 1824 | { NET_IPV4_CONF, "NET_IPV4_CONF" }, |
| 1825 | { NET_IPV4_NEIGH, "NET_IPV4_NEIGH" }, |
| 1826 | { NET_IPV4_ROUTE, "NET_IPV4_ROUTE" }, |
| 1827 | { NET_IPV4_FIB_HASH, "NET_IPV4_FIB_HASH" }, |
| 1828 | { NET_IPV4_TCP_TIMESTAMPS, "NET_IPV4_TCP_TIMESTAMPS" }, |
| 1829 | { NET_IPV4_TCP_WINDOW_SCALING, "NET_IPV4_TCP_WINDOW_SCALING" }, |
| 1830 | { NET_IPV4_TCP_SACK, "NET_IPV4_TCP_SACK" }, |
| 1831 | { NET_IPV4_TCP_RETRANS_COLLAPSE, "NET_IPV4_TCP_RETRANS_COLLAPSE" }, |
| 1832 | { NET_IPV4_DEFAULT_TTL, "NET_IPV4_DEFAULT_TTL" }, |
| 1833 | { NET_IPV4_AUTOCONFIG, "NET_IPV4_AUTOCONFIG" }, |
| 1834 | { NET_IPV4_NO_PMTU_DISC, "NET_IPV4_NO_PMTU_DISC" }, |
| 1835 | { NET_IPV4_TCP_SYN_RETRIES, "NET_IPV4_TCP_SYN_RETRIES" }, |
| 1836 | { NET_IPV4_IPFRAG_HIGH_THRESH, "NET_IPV4_IPFRAG_HIGH_THRESH" }, |
| 1837 | { NET_IPV4_IPFRAG_LOW_THRESH, "NET_IPV4_IPFRAG_LOW_THRESH" }, |
| 1838 | { NET_IPV4_IPFRAG_TIME, "NET_IPV4_IPFRAG_TIME" }, |
| 1839 | { NET_IPV4_TCP_MAX_KA_PROBES, "NET_IPV4_TCP_MAX_KA_PROBES" }, |
| 1840 | { NET_IPV4_TCP_KEEPALIVE_TIME, "NET_IPV4_TCP_KEEPALIVE_TIME" }, |
| 1841 | { NET_IPV4_TCP_KEEPALIVE_PROBES, "NET_IPV4_TCP_KEEPALIVE_PROBES" }, |
| 1842 | { NET_IPV4_TCP_RETRIES1, "NET_IPV4_TCP_RETRIES1" }, |
| 1843 | { NET_IPV4_TCP_RETRIES2, "NET_IPV4_TCP_RETRIES2" }, |
| 1844 | { NET_IPV4_TCP_FIN_TIMEOUT, "NET_IPV4_TCP_FIN_TIMEOUT" }, |
| 1845 | { NET_IPV4_IP_MASQ_DEBUG, "NET_IPV4_IP_MASQ_DEBUG" }, |
| 1846 | { NET_TCP_SYNCOOKIES, "NET_TCP_SYNCOOKIES" }, |
| 1847 | { NET_TCP_STDURG, "NET_TCP_STDURG" }, |
| 1848 | { NET_TCP_RFC1337, "NET_TCP_RFC1337" }, |
| 1849 | { NET_TCP_SYN_TAILDROP, "NET_TCP_SYN_TAILDROP" }, |
| 1850 | { NET_TCP_MAX_SYN_BACKLOG, "NET_TCP_MAX_SYN_BACKLOG" }, |
| 1851 | { NET_IPV4_LOCAL_PORT_RANGE, "NET_IPV4_LOCAL_PORT_RANGE" }, |
| 1852 | { NET_IPV4_ICMP_ECHO_IGNORE_ALL, "NET_IPV4_ICMP_ECHO_IGNORE_ALL" }, |
| 1853 | { NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS" }, |
| 1854 | { NET_IPV4_ICMP_SOURCEQUENCH_RATE, "NET_IPV4_ICMP_SOURCEQUENCH_RATE" }, |
| 1855 | { NET_IPV4_ICMP_DESTUNREACH_RATE, "NET_IPV4_ICMP_DESTUNREACH_RATE" }, |
| 1856 | { NET_IPV4_ICMP_TIMEEXCEED_RATE, "NET_IPV4_ICMP_TIMEEXCEED_RATE" }, |
| 1857 | { NET_IPV4_ICMP_PARAMPROB_RATE, "NET_IPV4_ICMP_PARAMPROB_RATE" }, |
| 1858 | { NET_IPV4_ICMP_ECHOREPLY_RATE, "NET_IPV4_ICMP_ECHOREPLY_RATE" }, |
| 1859 | { NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES" }, |
| 1860 | { NET_IPV4_IGMP_MAX_MEMBERSHIPS, "NET_IPV4_IGMP_MAX_MEMBERSHIPS" }, |
| 1861 | { 0, NULL } |
| 1862 | }; |
| 1863 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1864 | static const struct xlat sysctl_net_ipv4_route[] = { |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1865 | { NET_IPV4_ROUTE_FLUSH, "NET_IPV4_ROUTE_FLUSH" }, |
| 1866 | { NET_IPV4_ROUTE_MIN_DELAY, "NET_IPV4_ROUTE_MIN_DELAY" }, |
| 1867 | { NET_IPV4_ROUTE_MAX_DELAY, "NET_IPV4_ROUTE_MAX_DELAY" }, |
| 1868 | { NET_IPV4_ROUTE_GC_THRESH, "NET_IPV4_ROUTE_GC_THRESH" }, |
| 1869 | { NET_IPV4_ROUTE_MAX_SIZE, "NET_IPV4_ROUTE_MAX_SIZE" }, |
| 1870 | { NET_IPV4_ROUTE_GC_MIN_INTERVAL, "NET_IPV4_ROUTE_GC_MIN_INTERVAL" }, |
| 1871 | { NET_IPV4_ROUTE_GC_TIMEOUT, "NET_IPV4_ROUTE_GC_TIMEOUT" }, |
| 1872 | { NET_IPV4_ROUTE_GC_INTERVAL, "NET_IPV4_ROUTE_GC_INTERVAL" }, |
| 1873 | { NET_IPV4_ROUTE_REDIRECT_LOAD, "NET_IPV4_ROUTE_REDIRECT_LOAD" }, |
| 1874 | { NET_IPV4_ROUTE_REDIRECT_NUMBER, "NET_IPV4_ROUTE_REDIRECT_NUMBER" }, |
| 1875 | { NET_IPV4_ROUTE_REDIRECT_SILENCE, "NET_IPV4_ROUTE_REDIRECT_SILENCE" }, |
| 1876 | { NET_IPV4_ROUTE_ERROR_COST, "NET_IPV4_ROUTE_ERROR_COST" }, |
| 1877 | { NET_IPV4_ROUTE_ERROR_BURST, "NET_IPV4_ROUTE_ERROR_BURST" }, |
| 1878 | { NET_IPV4_ROUTE_GC_ELASTICITY, "NET_IPV4_ROUTE_GC_ELASTICITY" }, |
| 1879 | { 0, NULL } |
| 1880 | }; |
| 1881 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1882 | static const struct xlat sysctl_net_ipv4_conf[] = { |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1883 | { NET_IPV4_CONF_FORWARDING, "NET_IPV4_CONF_FORWARDING" }, |
| 1884 | { NET_IPV4_CONF_MC_FORWARDING, "NET_IPV4_CONF_MC_FORWARDING" }, |
| 1885 | { NET_IPV4_CONF_PROXY_ARP, "NET_IPV4_CONF_PROXY_ARP" }, |
| 1886 | { NET_IPV4_CONF_ACCEPT_REDIRECTS, "NET_IPV4_CONF_ACCEPT_REDIRECTS" }, |
| 1887 | { NET_IPV4_CONF_SECURE_REDIRECTS, "NET_IPV4_CONF_SECURE_REDIRECTS" }, |
| 1888 | { NET_IPV4_CONF_SEND_REDIRECTS, "NET_IPV4_CONF_SEND_REDIRECTS" }, |
| 1889 | { NET_IPV4_CONF_SHARED_MEDIA, "NET_IPV4_CONF_SHARED_MEDIA" }, |
| 1890 | { NET_IPV4_CONF_RP_FILTER, "NET_IPV4_CONF_RP_FILTER" }, |
| 1891 | { NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, "NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE" }, |
| 1892 | { NET_IPV4_CONF_BOOTP_RELAY, "NET_IPV4_CONF_BOOTP_RELAY" }, |
| 1893 | { NET_IPV4_CONF_LOG_MARTIANS, "NET_IPV4_CONF_LOG_MARTIANS" }, |
| 1894 | { 0, NULL } |
| 1895 | }; |
| 1896 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1897 | static const struct xlat sysctl_net_ipv6[] = { |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1898 | { NET_IPV6_CONF, "NET_IPV6_CONF" }, |
| 1899 | { NET_IPV6_NEIGH, "NET_IPV6_NEIGH" }, |
| 1900 | { NET_IPV6_ROUTE, "NET_IPV6_ROUTE" }, |
| 1901 | { 0, NULL } |
| 1902 | }; |
| 1903 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 1904 | static const struct xlat sysctl_net_ipv6_route[] = { |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1905 | { NET_IPV6_ROUTE_FLUSH, "NET_IPV6_ROUTE_FLUSH" }, |
| 1906 | { NET_IPV6_ROUTE_GC_THRESH, "NET_IPV6_ROUTE_GC_THRESH" }, |
| 1907 | { NET_IPV6_ROUTE_MAX_SIZE, "NET_IPV6_ROUTE_MAX_SIZE" }, |
| 1908 | { NET_IPV6_ROUTE_GC_MIN_INTERVAL, "NET_IPV6_ROUTE_GC_MIN_INTERVAL" }, |
| 1909 | { NET_IPV6_ROUTE_GC_TIMEOUT, "NET_IPV6_ROUTE_GC_TIMEOUT" }, |
| 1910 | { NET_IPV6_ROUTE_GC_INTERVAL, "NET_IPV6_ROUTE_GC_INTERVAL" }, |
| 1911 | { NET_IPV6_ROUTE_GC_ELASTICITY, "NET_IPV6_ROUTE_GC_ELASTICITY" }, |
| 1912 | { 0, NULL } |
| 1913 | }; |
| 1914 | |
| 1915 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 1916 | sys_sysctl(struct tcb *tcp) |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1917 | { |
| 1918 | struct __sysctl_args info; |
| 1919 | int *name; |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1920 | unsigned long size; |
| 1921 | |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1922 | if (umove(tcp, tcp->u_arg[0], &info) < 0) |
Roland McGrath | 2cbe44e | 2005-05-26 23:21:09 +0000 | [diff] [blame] | 1923 | return printargs(tcp); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1924 | |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 1925 | size = sizeof(int) * (unsigned long) info.nlen; |
| 1926 | name = (size / sizeof(int) != info.nlen) ? NULL : malloc(size); |
Roland McGrath | 2cbe44e | 2005-05-26 23:21:09 +0000 | [diff] [blame] | 1927 | if (name == NULL || |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1928 | umoven(tcp, (unsigned long) info.name, size, (char *) name) < 0) { |
| 1929 | free(name); |
| 1930 | if (entering(tcp)) |
| 1931 | tprintf("{%p, %d, %p, %p, %p, %Zu}", |
| 1932 | info.name, info.nlen, info.oldval, |
| 1933 | info.oldlenp, info.newval, info.newlen); |
Roland McGrath | 2cbe44e | 2005-05-26 23:21:09 +0000 | [diff] [blame] | 1934 | return 0; |
| 1935 | } |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1936 | |
| 1937 | if (entering(tcp)) { |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 1938 | int cnt = 0, max_cnt; |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1939 | |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1940 | tprints("{{"); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1941 | |
| 1942 | if (info.nlen == 0) |
| 1943 | goto out; |
| 1944 | printxval(sysctl_root, name[0], "CTL_???"); |
| 1945 | ++cnt; |
| 1946 | |
| 1947 | if (info.nlen == 1) |
| 1948 | goto out; |
| 1949 | switch (name[0]) { |
| 1950 | case CTL_KERN: |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1951 | tprints(", "); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1952 | printxval(sysctl_kern, name[1], "KERN_???"); |
| 1953 | ++cnt; |
| 1954 | break; |
| 1955 | case CTL_VM: |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1956 | tprints(", "); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1957 | printxval(sysctl_vm, name[1], "VM_???"); |
| 1958 | ++cnt; |
| 1959 | break; |
| 1960 | case CTL_NET: |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1961 | tprints(", "); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1962 | printxval(sysctl_net, name[1], "NET_???"); |
| 1963 | ++cnt; |
| 1964 | |
| 1965 | if (info.nlen == 2) |
| 1966 | goto out; |
| 1967 | switch (name[1]) { |
| 1968 | case NET_CORE: |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1969 | tprints(", "); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1970 | printxval(sysctl_net_core, name[2], |
| 1971 | "NET_CORE_???"); |
| 1972 | break; |
| 1973 | case NET_UNIX: |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1974 | tprints(", "); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1975 | printxval(sysctl_net_unix, name[2], |
| 1976 | "NET_UNIX_???"); |
| 1977 | break; |
| 1978 | case NET_IPV4: |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1979 | tprints(", "); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1980 | printxval(sysctl_net_ipv4, name[2], |
| 1981 | "NET_IPV4_???"); |
| 1982 | |
| 1983 | if (info.nlen == 3) |
| 1984 | goto out; |
| 1985 | switch (name[2]) { |
| 1986 | case NET_IPV4_ROUTE: |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1987 | tprints(", "); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1988 | printxval(sysctl_net_ipv4_route, |
| 1989 | name[3], |
| 1990 | "NET_IPV4_ROUTE_???"); |
| 1991 | break; |
| 1992 | case NET_IPV4_CONF: |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 1993 | tprints(", "); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 1994 | printxval(sysctl_net_ipv4_conf, |
| 1995 | name[3], |
| 1996 | "NET_IPV4_CONF_???"); |
| 1997 | break; |
| 1998 | default: |
| 1999 | goto out; |
| 2000 | } |
| 2001 | break; |
| 2002 | case NET_IPV6: |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2003 | tprints(", "); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2004 | printxval(sysctl_net_ipv6, name[2], |
| 2005 | "NET_IPV6_???"); |
| 2006 | |
| 2007 | if (info.nlen == 3) |
| 2008 | goto out; |
| 2009 | switch (name[2]) { |
| 2010 | case NET_IPV6_ROUTE: |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2011 | tprints(", "); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2012 | printxval(sysctl_net_ipv6_route, |
| 2013 | name[3], |
| 2014 | "NET_IPV6_ROUTE_???"); |
| 2015 | break; |
| 2016 | default: |
| 2017 | goto out; |
| 2018 | } |
| 2019 | break; |
| 2020 | default: |
| 2021 | goto out; |
| 2022 | } |
| 2023 | break; |
| 2024 | default: |
| 2025 | goto out; |
| 2026 | } |
| 2027 | out: |
Roland McGrath | 8e4a3e6 | 2006-01-12 11:03:46 +0000 | [diff] [blame] | 2028 | max_cnt = info.nlen; |
| 2029 | if (abbrev(tcp) && max_cnt > max_strlen) |
| 2030 | max_cnt = max_strlen; |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 2031 | while (cnt < max_cnt) |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2032 | tprintf(", %x", name[cnt++]); |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 2033 | if (cnt < info.nlen) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2034 | tprints(", ..."); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2035 | tprintf("}, %d, ", info.nlen); |
| 2036 | } else { |
| 2037 | size_t oldlen; |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 2038 | if (umove(tcp, (size_t)info.oldlenp, &oldlen) >= 0 |
| 2039 | && info.nlen >= 2 |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2040 | && ((name[0] == CTL_KERN |
| 2041 | && (name[1] == KERN_OSRELEASE |
| 2042 | || name[1] == KERN_OSTYPE |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 2043 | #ifdef KERN_JAVA_INTERPRETER |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2044 | || name[1] == KERN_JAVA_INTERPRETER |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 2045 | #endif |
| 2046 | #ifdef KERN_JAVA_APPLETVIEWER |
| 2047 | || name[1] == KERN_JAVA_APPLETVIEWER |
| 2048 | #endif |
| 2049 | )))) { |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2050 | printpath(tcp, (size_t)info.oldval); |
Wichert Akkerman | 8b1b40c | 2000-02-03 21:58:30 +0000 | [diff] [blame] | 2051 | tprintf(", %Zu, ", oldlen); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2052 | if (info.newval == 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2053 | tprints("NULL"); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2054 | else if (syserror(tcp)) |
| 2055 | tprintf("%p", info.newval); |
| 2056 | else |
| 2057 | printpath(tcp, (size_t)info.newval); |
| 2058 | tprintf(", %Zd", info.newlen); |
| 2059 | } else { |
Wichert Akkerman | 8b1b40c | 2000-02-03 21:58:30 +0000 | [diff] [blame] | 2060 | tprintf("%p, %Zd, %p, %Zd", info.oldval, oldlen, |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2061 | info.newval, info.newlen); |
| 2062 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2063 | tprints("}"); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2064 | } |
Roland McGrath | 2cbe44e | 2005-05-26 23:21:09 +0000 | [diff] [blame] | 2065 | |
| 2066 | free(name); |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2067 | return 0; |
| 2068 | } |
| 2069 | #else |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 2070 | int sys_sysctl(struct tcb *tcp) |
Wichert Akkerman | 22fe9d2 | 1999-05-27 12:00:57 +0000 | [diff] [blame] | 2071 | { |
| 2072 | return printargs(tcp); |
| 2073 | } |
| 2074 | #endif |
| 2075 | |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 2076 | #ifdef FREEBSD |
| 2077 | #include <sys/sysctl.h> |
| 2078 | |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 2079 | int sys___sysctl(struct tcb *tcp) |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 2080 | { |
| 2081 | int qoid[CTL_MAXNAME+2]; |
| 2082 | char ctl[1024]; |
| 2083 | size_t len; |
| 2084 | int i, numeric; |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 2085 | |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 2086 | if (entering(tcp)) { |
| 2087 | if (tcp->u_arg[1] < 0 || tcp->u_arg[1] > CTL_MAXNAME || |
| 2088 | (umoven(tcp, tcp->u_arg[0], tcp->u_arg[1] * sizeof(int), |
| 2089 | (char *) (qoid + 2)) < 0)) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2090 | tprints("[...], "); |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 2091 | else { |
| 2092 | /* Use sysctl to ask the name of the current MIB |
| 2093 | This uses the undocumented "Staff-functions" used |
| 2094 | by the sysctl program. See kern_sysctl.c for |
| 2095 | details. */ |
| 2096 | qoid[0] = 0; /* sysctl */ |
| 2097 | qoid[1] = 1; /* name */ |
| 2098 | i = sizeof(ctl); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2099 | tprints("["); |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 2100 | if (sysctl(qoid, tcp->u_arg[1] + 2, ctl, &i, 0, 0) >= 0) { |
| 2101 | numeric = !abbrev(tcp); |
| 2102 | tprintf("%s%s", ctl, numeric ? ", " : ""); |
| 2103 | } else |
| 2104 | numeric = 1; |
| 2105 | if (numeric) { |
| 2106 | for (i = 0; i < tcp->u_arg[1]; i++) |
| 2107 | tprintf("%s%d", i ? "." : "", qoid[i + 2]); |
| 2108 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2109 | tprints("], "); |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 2110 | tprintf("%lu, ", tcp->u_arg[1]); |
| 2111 | } |
| 2112 | } else { |
| 2113 | if (!syserror(tcp) && (umove(tcp, tcp->u_arg[3], &len) >= 0)) { |
| 2114 | printstr(tcp, tcp->u_arg[2], len); |
| 2115 | tprintf(", [%u], ", len); |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 2116 | } else |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 2117 | tprintf("%#lx, %#lx, ", tcp->u_arg[2], tcp->u_arg[3]); |
| 2118 | printstr(tcp, tcp->u_arg[4], tcp->u_arg[5]); |
| 2119 | tprintf(", %lu", tcp->u_arg[5]); |
| 2120 | } |
| 2121 | return 0; |
| 2122 | } |
| 2123 | #endif |
Wichert Akkerman | 16a03d2 | 2000-08-10 02:14:04 +0000 | [diff] [blame] | 2124 | |
| 2125 | #if UNIXWARE >= 2 |
| 2126 | |
| 2127 | #include <sys/ksym.h> |
| 2128 | #include <sys/elf.h> |
| 2129 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 2130 | static const struct xlat ksym_flags[] = { |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 2131 | { STT_NOTYPE, "STT_NOTYPE" }, |
| 2132 | { STT_FUNC, "STT_FUNC" }, |
| 2133 | { STT_OBJECT, "STT_OBJECT" }, |
Wichert Akkerman | 16a03d2 | 2000-08-10 02:14:04 +0000 | [diff] [blame] | 2134 | { 0, NULL }, |
| 2135 | }; |
| 2136 | |
| 2137 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 2138 | sys_getksym(struct tcb *tcp) |
Wichert Akkerman | 16a03d2 | 2000-08-10 02:14:04 +0000 | [diff] [blame] | 2139 | { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2140 | if (entering(tcp)) { |
Wichert Akkerman | 16a03d2 | 2000-08-10 02:14:04 +0000 | [diff] [blame] | 2141 | printstr(tcp, tcp->u_arg[0], -1); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2142 | tprints(", "); |
Wichert Akkerman | 16a03d2 | 2000-08-10 02:14:04 +0000 | [diff] [blame] | 2143 | } |
| 2144 | else { |
| 2145 | if (syserror(tcp)) { |
| 2146 | tprintf("%#lx, %#lx", |
| 2147 | tcp->u_arg[1], tcp->u_arg[2]); |
| 2148 | } |
| 2149 | else { |
| 2150 | int val; |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2151 | printnum(tcp, tcp->u_arg[1], "%#lx"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2152 | tprints(", "); |
Wichert Akkerman | 16a03d2 | 2000-08-10 02:14:04 +0000 | [diff] [blame] | 2153 | if (umove(tcp, tcp->u_arg[2], &val) < 0) { |
| 2154 | tprintf("%#lx", tcp->u_arg[2]); |
| 2155 | } |
| 2156 | else { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2157 | tprints("["); |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2158 | printxval(ksym_flags, val, "STT_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2159 | tprints("]"); |
Wichert Akkerman | 16a03d2 | 2000-08-10 02:14:04 +0000 | [diff] [blame] | 2160 | } |
| 2161 | } |
| 2162 | } |
| 2163 | |
| 2164 | return 0; |
| 2165 | } |
| 2166 | |
Roland McGrath | 5ef24ab | 2004-02-20 02:22:35 +0000 | [diff] [blame] | 2167 | #ifdef HAVE_SYS_NSCSYS_H |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2168 | |
John Hughes | 0aadba4 | 2001-10-16 18:19:52 +0000 | [diff] [blame] | 2169 | struct cred; |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2170 | #include <sys/nscsys.h> |
| 2171 | |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2172 | static const struct xlat ssi_cmd[] = { |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2173 | { SSISYS_BADOP, "SSISYS_BADOP" }, |
| 2174 | { SSISYS_LDLVL_INIT,"SSISYS_LDLVL_INIT"}, |
| 2175 | { SSISYS_LDLVL_GETVEC,"SSISYS_LDLVL_GETVEC"}, |
| 2176 | { SSISYS_LDLVL_PUTVEC,"SSISYS_LDLVL_PUTVEC"}, |
| 2177 | { SSISYS_LDLVL_PUTRCMDS,"SSISYS_LDLVL_PUTRCMDS"}, |
| 2178 | { SSISYS_LDLVL_SETREXEC,"SSISYS_LDLVL_SETREXEC"}, |
| 2179 | { SSISYS_CMS_CLUSTERID,"SSISYS_CMS_CLUSTERID"}, |
| 2180 | { SSISYS_CFS_STATVFS,"SSISYS_CFS_STATVFS"}, |
| 2181 | { SSISYS_NODE_GETNUM,"SSISYS_NODE_GETNUM"}, |
| 2182 | { SSISYS_NODE_TABLE,"SSISYS_NODE_TABLE"}, |
| 2183 | { SSISYS_NODE_DOWN,"SSISYS_NODE_DOWN"}, |
| 2184 | { SSISYS_RECLAIM_CHILD,"SSISYS_RECLAIM_CHILD"}, |
| 2185 | { SSISYS_IPC_GETINFO,"SSISYS_IPC_GETINFO"}, |
| 2186 | { SSISYS_ICS_TEST,"SSISYS_ICS_TEST"}, |
| 2187 | { SSISYS_NODE_PID,"SSISYS_NODE_PID"}, |
| 2188 | { SSISYS_ISLOCAL,"SSISYS_ISLOCAL"}, |
| 2189 | { SSISYS_CFS_ISSTACKED,"SSISYS_CFS_ISSTACKED"}, |
| 2190 | { SSISYS_DNET_SYNC,"SSISYS_DNET_SYNC"}, |
| 2191 | { SSISYS_CFS_WAIT_MODE,"SSISYS_CFS_WAIT_MODE"}, |
| 2192 | { SSISYS_CFS_UMOUNT,"SSISYS_CFS_UMOUNT"}, |
| 2193 | { SSISYS_LLSTAT,"SSISYS_LLSTAT" }, |
| 2194 | { SSISYS_LTS_PERFTEST,"SSISYS_LTS_PERFTEST"}, |
| 2195 | { SSISYS_LTS_CONFIG,"SSISYS_LTS_CONFIG"}, |
| 2196 | { SSISYS_SNET_PERFTEST,"SSISYS_SNET_PERFTEST"}, |
| 2197 | { SSISYS_IGNORE_HALFUP,"SSISYS_IGNORE_HALFUP"}, |
| 2198 | { SSISYS_NODE_ROOTDEV,"SSISYS_NODE_ROOTDEV"}, |
| 2199 | { SSISYS_GET_PRIMARY,"SSISYS_GET_PRIMARY"}, |
| 2200 | { SSISYS_GET_SECONDARY,"SSISYS_GET_SECONDARY"}, |
| 2201 | { SSISYS_GET_ROOTDISK,"SSISYS_GET_ROOTDISK"}, |
| 2202 | { SSISYS_CLUSTERNODE_NUM,"SSISYS_CLUSTERNODE_NUM"}, |
| 2203 | { SSISYS_CLUSTER_MEMBERSHIP,"SSISYS_CLUSTER_MEMBERSHIP"}, |
| 2204 | { SSISYS_CLUSTER_DETAILEDTRANS,"SSISYS_CLUSTER_DETAILEDTRANS"}, |
| 2205 | { SSISYS_CLUSTERNODE_INFO,"SSISYS_CLUSTERNODE_INFO"}, |
| 2206 | { SSISYS_CLUSTERNODE_SETINFO,"SSISYS_CLUSTERNODE_SETINFO"}, |
| 2207 | { SSISYS_CLUSTERNODE_AVAIL,"SSISYS_CLUSTERNODE_AVAIL"}, |
| 2208 | { SSISYS_CLUSTER_MAXNODES,"SSISYS_CLUSTER_MAXNODES"}, |
| 2209 | { SSISYS_SET_MEMPRIO,"SSISYS_SET_MEMPRIO"}, |
| 2210 | { SSISYS_GET_USERS,"SSISYS_GET_USERS"}, |
| 2211 | { SSISYS_FORCE_ROOT_NODE,"SSISYS_FORCE_ROOT_NODE"}, |
| 2212 | { SSISYS_CVIP_SET,"SSISYS_CVIP_SET"}, |
| 2213 | { SSISYS_CVIP_GET,"SSISYS_CVIP_GET"}, |
| 2214 | { SSISYS_GET_NODE_COUNTS,"SSISYS_GET_NODE_COUNTS"}, |
| 2215 | { SSISYS_GET_TRANSPORT,"SSISYS_GET_TRANSPORT"}, |
| 2216 | { 0, NULL }, |
| 2217 | }; |
| 2218 | |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 2219 | int sys_ssisys(struct tcb *tcp) |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2220 | { |
| 2221 | struct ssisys_iovec iov; |
John Hughes | 2d8b2c5 | 2001-10-18 14:52:24 +0000 | [diff] [blame] | 2222 | cls_nodeinfo_args_t cni; |
| 2223 | clusternode_info_t info; |
| 2224 | |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2225 | if (entering(tcp)) { |
John Hughes | 0aadba4 | 2001-10-16 18:19:52 +0000 | [diff] [blame] | 2226 | ts_reclaim_child_inargs_t trc; |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2227 | if (tcp->u_arg[1] != sizeof iov || |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2228 | umove(tcp, tcp->u_arg[0], &iov) < 0) |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2229 | { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2230 | tprintf("%#lx, %ld", tcp->u_arg[0], tcp->u_arg[1]); |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2231 | return 0; |
| 2232 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 2233 | tprints("{id="); |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2234 | printxval(ssi_cmd, iov.tio_id.id_cmd, "SSISYS_???"); |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2235 | tprintf(":%d", iov.tio_id.id_ver); |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2236 | switch (iov.tio_id.id_cmd) { |
John Hughes | 0aadba4 | 2001-10-16 18:19:52 +0000 | [diff] [blame] | 2237 | case SSISYS_RECLAIM_CHILD: |
| 2238 | if (iov.tio_udatainlen != sizeof trc || |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2239 | umove(tcp, (long) iov.tio_udatain, &trc) < 0) |
John Hughes | 0aadba4 | 2001-10-16 18:19:52 +0000 | [diff] [blame] | 2240 | goto bad; |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2241 | tprintf(", in={pid=%ld, start=%ld}", |
Roland McGrath | 5ef24ab | 2004-02-20 02:22:35 +0000 | [diff] [blame] | 2242 | trc.trc_pid, trc.trc_start); |
John Hughes | 0aadba4 | 2001-10-16 18:19:52 +0000 | [diff] [blame] | 2243 | break; |
| 2244 | case SSISYS_CLUSTERNODE_INFO: |
| 2245 | if (iov.tio_udatainlen != sizeof cni || |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2246 | umove(tcp, (long) iov.tio_udatain, &cni) < 0) |
John Hughes | 0aadba4 | 2001-10-16 18:19:52 +0000 | [diff] [blame] | 2247 | goto bad; |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2248 | tprintf(", in={node=%ld, len=%d}", |
John Hughes | 0aadba4 | 2001-10-16 18:19:52 +0000 | [diff] [blame] | 2249 | cni.nodenum, cni.info_len); |
| 2250 | break; |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2251 | default: |
John Hughes | 0aadba4 | 2001-10-16 18:19:52 +0000 | [diff] [blame] | 2252 | bad: |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2253 | if (iov.tio_udatainlen) { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2254 | tprintf(", in=[/* %d bytes */]", |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2255 | iov.tio_udatainlen); |
| 2256 | } |
| 2257 | } |
| 2258 | } |
| 2259 | else { |
John Hughes | 2d8b2c5 | 2001-10-18 14:52:24 +0000 | [diff] [blame] | 2260 | if (tcp->u_arg[1] != sizeof iov || |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2261 | umove(tcp, tcp->u_arg[0], &iov) < 0) |
John Hughes | 2d8b2c5 | 2001-10-18 14:52:24 +0000 | [diff] [blame] | 2262 | goto done; |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2263 | switch (iov.tio_id.id_cmd) { |
John Hughes | 2d8b2c5 | 2001-10-18 14:52:24 +0000 | [diff] [blame] | 2264 | case SSISYS_CLUSTERNODE_INFO: |
| 2265 | if (iov.tio_udatainlen != sizeof cni || |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2266 | umove(tcp, (long) iov.tio_udatain, &cni) < 0) |
John Hughes | 2d8b2c5 | 2001-10-18 14:52:24 +0000 | [diff] [blame] | 2267 | goto bad_out; |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 2268 | if (cni.info_len != sizeof info || |
Roland McGrath | 5ef24ab | 2004-02-20 02:22:35 +0000 | [diff] [blame] | 2269 | iov.tio_udataoutlen != sizeof &info || |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2270 | umove(tcp, (long) iov.tio_udataout, &info) < 0) |
John Hughes | 2d8b2c5 | 2001-10-18 14:52:24 +0000 | [diff] [blame] | 2271 | goto bad_out; |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2272 | tprintf(", out={node=%ld, cpus=%d, online=%d}", |
John Hughes | 2d8b2c5 | 2001-10-18 14:52:24 +0000 | [diff] [blame] | 2273 | info.node_num, info.node_totalcpus, |
| 2274 | info.node_onlinecpus); |
| 2275 | break; |
Roland McGrath | ced50da | 2004-08-31 06:48:46 +0000 | [diff] [blame] | 2276 | |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2277 | default: |
John Hughes | 2d8b2c5 | 2001-10-18 14:52:24 +0000 | [diff] [blame] | 2278 | bad_out: |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2279 | if (iov.tio_udataoutlen) { |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2280 | tprintf(", out=[/* %d bytes */]", |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2281 | iov.tio_udataoutlen); |
| 2282 | } |
| 2283 | } |
John Hughes | 2d8b2c5 | 2001-10-18 14:52:24 +0000 | [diff] [blame] | 2284 | done: |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2285 | tprintf("}, %ld", tcp->u_arg[1]); |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2286 | } |
| 2287 | return 0; |
| 2288 | } |
| 2289 | |
Roland McGrath | 5ef24ab | 2004-02-20 02:22:35 +0000 | [diff] [blame] | 2290 | #endif |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 2291 | |
Roland McGrath | 5ef24ab | 2004-02-20 02:22:35 +0000 | [diff] [blame] | 2292 | #endif /* UNIXWARE > 2 */ |
Wichert Akkerman | 0cbfb32 | 2001-02-19 13:35:53 +0000 | [diff] [blame] | 2293 | |
| 2294 | #ifdef MIPS |
| 2295 | |
Wichert Akkerman | d6b9249 | 2001-04-07 21:37:12 +0000 | [diff] [blame] | 2296 | #ifndef __NEW_UTS_LEN |
| 2297 | #define __NEW_UTS_LEN 64 |
| 2298 | #endif |
| 2299 | |
Roland McGrath | d9f816f | 2004-09-04 03:39:20 +0000 | [diff] [blame] | 2300 | static const struct xlat sysmips_operations[] = { |
Wichert Akkerman | 0cbfb32 | 2001-02-19 13:35:53 +0000 | [diff] [blame] | 2301 | { SETNAME, "SETNAME" }, |
| 2302 | { FLUSH_CACHE, "FLUSH_CACHE" }, |
| 2303 | { MIPS_FIXADE, "MIPS_FIXADE" }, |
| 2304 | { MIPS_RDNVRAM, "MIPS_RDNVRAM" }, |
| 2305 | { MIPS_ATOMIC_SET, "MIPS_ATOMIC_SET" }, |
| 2306 | { 0, NULL } |
| 2307 | }; |
| 2308 | |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 2309 | int sys_sysmips(struct tcb *tcp) |
Wichert Akkerman | 0cbfb32 | 2001-02-19 13:35:53 +0000 | [diff] [blame] | 2310 | { |
| 2311 | if (entering(tcp)) { |
Wichert Akkerman | 3472dd5 | 2001-04-10 10:27:52 +0000 | [diff] [blame] | 2312 | printxval(sysmips_operations, tcp->u_arg[0], "???"); |
Wichert Akkerman | 0cbfb32 | 2001-02-19 13:35:53 +0000 | [diff] [blame] | 2313 | if (!verbose(tcp)) { |
Wichert Akkerman | 3472dd5 | 2001-04-10 10:27:52 +0000 | [diff] [blame] | 2314 | tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]); |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 2315 | } else if (tcp->u_arg[0] == SETNAME) { |
Wichert Akkerman | 3472dd5 | 2001-04-10 10:27:52 +0000 | [diff] [blame] | 2316 | char nodename[__NEW_UTS_LEN + 1]; |
| 2317 | if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), nodename) < 0) |
Wichert Akkerman | 0cbfb32 | 2001-02-19 13:35:53 +0000 | [diff] [blame] | 2318 | tprintf(", %#lx", tcp->u_arg[1]); |
| 2319 | else |
| 2320 | tprintf(", \"%s\"", nodename); |
Wichert Akkerman | 3472dd5 | 2001-04-10 10:27:52 +0000 | [diff] [blame] | 2321 | } else if (tcp->u_arg[0] == MIPS_ATOMIC_SET) { |
| 2322 | tprintf(", %#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]); |
| 2323 | } else if (tcp->u_arg[0] == MIPS_FIXADE) { |
| 2324 | tprintf(", 0x%lx", tcp->u_arg[1]); |
Wichert Akkerman | 0cbfb32 | 2001-02-19 13:35:53 +0000 | [diff] [blame] | 2325 | } else { |
Wichert Akkerman | 3472dd5 | 2001-04-10 10:27:52 +0000 | [diff] [blame] | 2326 | tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]); |
Wichert Akkerman | 0cbfb32 | 2001-02-19 13:35:53 +0000 | [diff] [blame] | 2327 | } |
| 2328 | } |
| 2329 | |
| 2330 | return 0; |
| 2331 | } |
| 2332 | |
| 2333 | #endif /* MIPS */ |