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