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