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 | #include <fcntl.h> |
John Hughes | 1d08dcf | 2001-07-10 13:48:44 +0000 | [diff] [blame] | 36 | #if HAVE_SYS_UIO_H |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 37 | #include <sys/uio.h> |
John Hughes | 1d08dcf | 2001-07-10 13:48:44 +0000 | [diff] [blame] | 38 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 39 | |
John Hughes | 70623be | 2001-03-08 13:59:00 +0000 | [diff] [blame] | 40 | #ifdef HAVE_LONG_LONG_OFF_T |
| 41 | /* |
| 42 | * Hacks for systems that have a long long off_t |
| 43 | */ |
| 44 | |
| 45 | #define sys_pread64 sys_pread |
| 46 | #define sys_pwrite64 sys_pwrite |
| 47 | #endif |
| 48 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 49 | int |
| 50 | sys_read(tcp) |
| 51 | struct tcb *tcp; |
| 52 | { |
| 53 | if (entering(tcp)) { |
| 54 | tprintf("%ld, ", tcp->u_arg[0]); |
| 55 | } else { |
| 56 | if (syserror(tcp)) |
| 57 | tprintf("%#lx", tcp->u_arg[1]); |
| 58 | else |
| 59 | printstr(tcp, tcp->u_arg[1], tcp->u_rval); |
| 60 | tprintf(", %lu", tcp->u_arg[2]); |
| 61 | } |
| 62 | return 0; |
| 63 | } |
| 64 | |
| 65 | int |
| 66 | sys_write(tcp) |
| 67 | struct tcb *tcp; |
| 68 | { |
| 69 | if (entering(tcp)) { |
| 70 | tprintf("%ld, ", tcp->u_arg[0]); |
| 71 | printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); |
| 72 | tprintf(", %lu", tcp->u_arg[2]); |
| 73 | } |
| 74 | return 0; |
| 75 | } |
| 76 | |
John Hughes | 1d08dcf | 2001-07-10 13:48:44 +0000 | [diff] [blame] | 77 | #if HAVE_SYS_UIO_H |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 78 | void |
| 79 | tprint_iov(tcp, len, addr) |
| 80 | struct tcb * tcp; |
| 81 | int len; |
John Hughes | 1d08dcf | 2001-07-10 13:48:44 +0000 | [diff] [blame] | 82 | long addr; |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 83 | { |
| 84 | struct iovec *iov; |
| 85 | int i; |
| 86 | |
| 87 | |
| 88 | if (!len) { |
| 89 | tprintf("[]"); |
| 90 | return; |
| 91 | } |
Roland McGrath | 186c5ac | 2002-12-15 23:58:23 +0000 | [diff] [blame] | 92 | |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 93 | if ((iov = (struct iovec *) malloc(len * sizeof *iov)) == NULL) { |
| 94 | fprintf(stderr, "No memory"); |
| 95 | return; |
| 96 | } |
John Hughes | 1d08dcf | 2001-07-10 13:48:44 +0000 | [diff] [blame] | 97 | if (umoven(tcp, addr, |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 98 | len * sizeof *iov, (char *) iov) < 0) { |
| 99 | tprintf("%#lx", tcp->u_arg[1]); |
| 100 | } else { |
| 101 | tprintf("["); |
| 102 | for (i = 0; i < len; i++) { |
| 103 | if (i) |
| 104 | tprintf(", "); |
| 105 | tprintf("{"); |
| 106 | printstr(tcp, (long) iov[i].iov_base, |
| 107 | iov[i].iov_len); |
| 108 | tprintf(", %lu}", (unsigned long)iov[i].iov_len); |
| 109 | } |
| 110 | tprintf("]"); |
| 111 | } |
| 112 | free((char *) iov); |
| 113 | } |
| 114 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 115 | int |
| 116 | sys_readv(tcp) |
| 117 | struct tcb *tcp; |
| 118 | { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 119 | if (entering(tcp)) { |
| 120 | tprintf("%ld, ", tcp->u_arg[0]); |
| 121 | } else { |
| 122 | if (syserror(tcp)) { |
| 123 | tprintf("%#lx, %lu", |
| 124 | tcp->u_arg[1], tcp->u_arg[2]); |
| 125 | return 0; |
| 126 | } |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 127 | tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 128 | tprintf(", %lu", tcp->u_arg[2]); |
| 129 | } |
| 130 | return 0; |
| 131 | } |
| 132 | |
| 133 | int |
| 134 | sys_writev(tcp) |
| 135 | struct tcb *tcp; |
| 136 | { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 137 | if (entering(tcp)) { |
| 138 | tprintf("%ld, ", tcp->u_arg[0]); |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 139 | tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 140 | tprintf(", %lu", tcp->u_arg[2]); |
| 141 | } |
| 142 | return 0; |
| 143 | } |
John Hughes | 1d08dcf | 2001-07-10 13:48:44 +0000 | [diff] [blame] | 144 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 145 | |
John Hughes | 5a826b8 | 2001-03-07 13:21:24 +0000 | [diff] [blame] | 146 | #if defined(SVR4) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 147 | |
| 148 | int |
| 149 | sys_pread(tcp) |
| 150 | struct tcb *tcp; |
| 151 | { |
| 152 | if (entering(tcp)) { |
| 153 | tprintf("%ld, ", tcp->u_arg[0]); |
| 154 | } else { |
| 155 | if (syserror(tcp)) |
| 156 | tprintf("%#lx", tcp->u_arg[1]); |
| 157 | else |
| 158 | printstr(tcp, tcp->u_arg[1], tcp->u_rval); |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 159 | #if UNIXWARE |
| 160 | /* off_t is signed int */ |
| 161 | tprintf(", %lu, %ld", tcp->u_arg[2], tcp->u_arg[3]); |
| 162 | #else |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 163 | tprintf(", %lu, %llu", tcp->u_arg[2], |
Roland McGrath | 2fe2a3e | 2004-10-07 19:09:16 +0000 | [diff] [blame] | 164 | LONG_LONG(tcp->u_arg[3], tcp->u_arg[4])); |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 165 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 166 | } |
| 167 | return 0; |
| 168 | } |
| 169 | |
| 170 | int |
| 171 | sys_pwrite(tcp) |
| 172 | struct tcb *tcp; |
| 173 | { |
| 174 | if (entering(tcp)) { |
| 175 | tprintf("%ld, ", tcp->u_arg[0]); |
| 176 | printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 177 | #if UNIXWARE |
| 178 | /* off_t is signed int */ |
| 179 | tprintf(", %lu, %ld", tcp->u_arg[2], tcp->u_arg[3]); |
| 180 | #else |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 181 | tprintf(", %lu, %llu", tcp->u_arg[2], |
Roland McGrath | 2fe2a3e | 2004-10-07 19:09:16 +0000 | [diff] [blame] | 182 | LONG_LONG(tcp->u_arg[3], tcp->u_arg[4])); |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 183 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 184 | } |
| 185 | return 0; |
| 186 | } |
John Hughes | 5a826b8 | 2001-03-07 13:21:24 +0000 | [diff] [blame] | 187 | #endif /* SVR4 */ |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 188 | |
| 189 | #ifdef FREEBSD |
| 190 | #include <sys/types.h> |
| 191 | #include <sys/socket.h> |
| 192 | |
| 193 | int |
| 194 | sys_sendfile(tcp) |
| 195 | struct tcb *tcp; |
| 196 | { |
| 197 | if (entering(tcp)) { |
| 198 | tprintf("%ld, %ld, %llu, %lu", tcp->u_arg[0], tcp->u_arg[1], |
Roland McGrath | 2fe2a3e | 2004-10-07 19:09:16 +0000 | [diff] [blame] | 199 | LONG_LONG(tcp->u_arg[2], tcp->u_arg[3]), |
| 200 | tcp->u_arg[4]); |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 201 | } else { |
| 202 | off_t offset; |
| 203 | |
| 204 | if (!tcp->u_arg[5]) |
| 205 | tprintf(", NULL"); |
| 206 | else { |
| 207 | struct sf_hdtr hdtr; |
| 208 | |
| 209 | if (umove(tcp, tcp->u_arg[5], &hdtr) < 0) |
| 210 | tprintf(", %#lx", tcp->u_arg[5]); |
| 211 | else { |
| 212 | tprintf(", { "); |
| 213 | tprint_iov(tcp, hdtr.hdr_cnt, hdtr.headers); |
| 214 | tprintf(", %u, ", hdtr.hdr_cnt); |
| 215 | tprint_iov(tcp, hdtr.trl_cnt, hdtr.trailers); |
| 216 | tprintf(", %u }", hdtr.hdr_cnt); |
| 217 | } |
| 218 | } |
| 219 | if (!tcp->u_arg[6]) |
| 220 | tprintf(", NULL"); |
| 221 | else if (umove(tcp, tcp->u_arg[6], &offset) < 0) |
| 222 | tprintf(", %#lx", tcp->u_arg[6]); |
| 223 | else |
| 224 | tprintf(", [%llu]", offset); |
| 225 | tprintf(", %lu", tcp->u_arg[7]); |
| 226 | } |
| 227 | return 0; |
| 228 | } |
| 229 | #endif /* FREEBSD */ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 230 | |
| 231 | #ifdef LINUX |
Roland McGrath | c0f8bbd | 2003-08-21 09:58:00 +0000 | [diff] [blame] | 232 | |
| 233 | /* The SH4 ABI does allow long longs in odd-numbered registers, but |
| 234 | does not allow them to be split between registers and memory - and |
| 235 | there are only four argument registers for normal functions. As a |
| 236 | result pread takes an extra padding argument before the offset. This |
| 237 | was changed late in the 2.4 series (around 2.4.20). */ |
| 238 | #if defined(SH) |
| 239 | #define PREAD_OFFSET_ARG 4 |
| 240 | #else |
| 241 | #define PREAD_OFFSET_ARG 3 |
| 242 | #endif |
| 243 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 244 | int |
| 245 | sys_pread(tcp) |
| 246 | struct tcb *tcp; |
| 247 | { |
| 248 | if (entering(tcp)) { |
| 249 | tprintf("%ld, ", tcp->u_arg[0]); |
| 250 | } else { |
| 251 | if (syserror(tcp)) |
| 252 | tprintf("%#lx", tcp->u_arg[1]); |
| 253 | else |
| 254 | printstr(tcp, tcp->u_arg[1], tcp->u_rval); |
Roland McGrath | c0f8bbd | 2003-08-21 09:58:00 +0000 | [diff] [blame] | 255 | ALIGN64 (tcp, PREAD_OFFSET_ARG); /* PowerPC alignment restriction */ |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 256 | tprintf(", %lu, %llu", tcp->u_arg[2], |
Roland McGrath | c0f8bbd | 2003-08-21 09:58:00 +0000 | [diff] [blame] | 257 | *(unsigned long long *)&tcp->u_arg[PREAD_OFFSET_ARG]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 258 | } |
| 259 | return 0; |
| 260 | } |
| 261 | |
| 262 | int |
| 263 | sys_pwrite(tcp) |
| 264 | struct tcb *tcp; |
| 265 | { |
| 266 | if (entering(tcp)) { |
| 267 | tprintf("%ld, ", tcp->u_arg[0]); |
| 268 | printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); |
Roland McGrath | c0f8bbd | 2003-08-21 09:58:00 +0000 | [diff] [blame] | 269 | ALIGN64 (tcp, PREAD_OFFSET_ARG); /* PowerPC alignment restriction */ |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 270 | tprintf(", %lu, %llu", tcp->u_arg[2], |
Roland McGrath | c0f8bbd | 2003-08-21 09:58:00 +0000 | [diff] [blame] | 271 | *(unsigned long long *)&tcp->u_arg[PREAD_OFFSET_ARG]); |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 272 | } |
| 273 | return 0; |
| 274 | } |
| 275 | |
| 276 | int |
| 277 | sys_sendfile(tcp) |
| 278 | struct tcb *tcp; |
| 279 | { |
| 280 | if (entering(tcp)) { |
| 281 | off_t offset; |
| 282 | |
| 283 | tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]); |
| 284 | if (!tcp->u_arg[2]) |
| 285 | tprintf("NULL"); |
| 286 | else if (umove(tcp, tcp->u_arg[2], &offset) < 0) |
| 287 | tprintf("%#lx", tcp->u_arg[2]); |
| 288 | else |
| 289 | tprintf("[%lu]", offset); |
| 290 | tprintf(", %lu", tcp->u_arg[3]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 291 | } |
| 292 | return 0; |
| 293 | } |
| 294 | |
Roland McGrath | 186c5ac | 2002-12-15 23:58:23 +0000 | [diff] [blame] | 295 | int |
| 296 | sys_sendfile64(tcp) |
| 297 | struct tcb *tcp; |
| 298 | { |
| 299 | if (entering(tcp)) { |
| 300 | loff_t offset; |
| 301 | |
| 302 | tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]); |
| 303 | if (!tcp->u_arg[2]) |
| 304 | tprintf("NULL"); |
| 305 | else if (umove(tcp, tcp->u_arg[2], &offset) < 0) |
| 306 | tprintf("%#lx", tcp->u_arg[2]); |
| 307 | else |
| 308 | tprintf("[%llu]", (unsigned long long int) offset); |
| 309 | tprintf(", %lu", tcp->u_arg[3]); |
| 310 | } |
| 311 | return 0; |
| 312 | } |
| 313 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 314 | #endif /* LINUX */ |
| 315 | |
John Hughes | 70623be | 2001-03-08 13:59:00 +0000 | [diff] [blame] | 316 | #if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T |
John Hughes | bdf48f5 | 2001-03-06 15:08:09 +0000 | [diff] [blame] | 317 | int |
| 318 | sys_pread64(tcp) |
| 319 | struct tcb *tcp; |
| 320 | { |
| 321 | if (entering(tcp)) { |
| 322 | tprintf("%ld, ", tcp->u_arg[0]); |
| 323 | } else { |
John Hughes | 5a826b8 | 2001-03-07 13:21:24 +0000 | [diff] [blame] | 324 | ALIGN64 (tcp, 3); |
John Hughes | bdf48f5 | 2001-03-06 15:08:09 +0000 | [diff] [blame] | 325 | if (syserror(tcp)) |
| 326 | tprintf("%#lx", tcp->u_arg[1]); |
| 327 | else |
| 328 | printstr(tcp, tcp->u_arg[1], tcp->u_rval); |
John Hughes | 5a826b8 | 2001-03-07 13:21:24 +0000 | [diff] [blame] | 329 | tprintf(", %lu, %#llx", tcp->u_arg[2], |
John Hughes | 0c79e01 | 2001-03-08 14:40:06 +0000 | [diff] [blame] | 330 | LONG_LONG(tcp->u_arg[3], tcp->u_arg[4])); |
John Hughes | bdf48f5 | 2001-03-06 15:08:09 +0000 | [diff] [blame] | 331 | } |
| 332 | return 0; |
| 333 | } |
| 334 | |
| 335 | int |
| 336 | sys_pwrite64(tcp) |
| 337 | struct tcb *tcp; |
| 338 | { |
| 339 | if (entering(tcp)) { |
John Hughes | 5a826b8 | 2001-03-07 13:21:24 +0000 | [diff] [blame] | 340 | ALIGN64 (tcp, 3); |
John Hughes | bdf48f5 | 2001-03-06 15:08:09 +0000 | [diff] [blame] | 341 | tprintf("%ld, ", tcp->u_arg[0]); |
| 342 | printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); |
John Hughes | 5a826b8 | 2001-03-07 13:21:24 +0000 | [diff] [blame] | 343 | tprintf(", %lu, %#llx", tcp->u_arg[2], |
John Hughes | 0c79e01 | 2001-03-08 14:40:06 +0000 | [diff] [blame] | 344 | LONG_LONG(tcp->u_arg[3], tcp->u_arg[4])); |
John Hughes | bdf48f5 | 2001-03-06 15:08:09 +0000 | [diff] [blame] | 345 | } |
| 346 | return 0; |
| 347 | } |
| 348 | #endif |
Roland McGrath | 186c5ac | 2002-12-15 23:58:23 +0000 | [diff] [blame] | 349 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 350 | int |
| 351 | sys_ioctl(tcp) |
| 352 | struct tcb *tcp; |
| 353 | { |
Roland McGrath | ee36ce1 | 2004-09-04 03:53:10 +0000 | [diff] [blame] | 354 | const struct ioctlent *iop; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 355 | |
| 356 | if (entering(tcp)) { |
| 357 | tprintf("%ld, ", tcp->u_arg[0]); |
Roland McGrath | 2843a4e | 2003-11-14 02:54:03 +0000 | [diff] [blame] | 358 | iop = ioctl_lookup(tcp->u_arg[1]); |
| 359 | if (iop) { |
| 360 | tprintf("%s", iop->symbol); |
| 361 | while ((iop = ioctl_next_match(iop))) |
| 362 | tprintf(" or %s", iop->symbol); |
| 363 | } else |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 364 | tprintf("%#lx", tcp->u_arg[1]); |
| 365 | ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]); |
| 366 | } |
| 367 | else { |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 368 | int ret; |
| 369 | if (!(ret = ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]))) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 370 | tprintf(", %#lx", tcp->u_arg[2]); |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 371 | else |
| 372 | return ret - 1; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 373 | } |
| 374 | return 0; |
| 375 | } |