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