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