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