blob: bf5baa2968ed9b97b321e5370903932a7e3e6108 [file] [log] [blame]
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001/*
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 Akkerman4dc8a2a1999-12-23 14:20:14 +00005 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00006 * 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.
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000029 */
30
31#include "defs.h"
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000032#include <fcntl.h>
Denys Vlasenkoe0bc2222012-04-28 14:26:18 +020033#include <limits.h>
John Hughes1d08dcf2001-07-10 13:48:44 +000034#if HAVE_SYS_UIO_H
Denys Vlasenkoa6d91de2012-03-16 12:02:22 +010035# include <sys/uio.h>
John Hughes1d08dcf2001-07-10 13:48:44 +000036#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000037
38int
Dmitry V. Levin31382132011-03-04 05:08:02 +030039sys_read(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000040{
41 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +030042 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +020043 tprints(", ");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000044 } else {
45 if (syserror(tcp))
46 tprintf("%#lx", tcp->u_arg[1]);
47 else
48 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
49 tprintf(", %lu", tcp->u_arg[2]);
50 }
51 return 0;
52}
53
54int
Dmitry V. Levin31382132011-03-04 05:08:02 +030055sys_write(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000056{
57 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +030058 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +020059 tprints(", ");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000060 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
61 tprintf(", %lu", tcp->u_arg[2]);
62 }
63 return 0;
64}
65
John Hughes1d08dcf2001-07-10 13:48:44 +000066#if HAVE_SYS_UIO_H
Denys Vlasenkoe0bc2222012-04-28 14:26:18 +020067/*
68 * data_size limits the cumulative size of printed data.
69 * Example: recvmsg returing a short read.
70 */
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000071void
Denys Vlasenkoe0bc2222012-04-28 14:26:18 +020072tprint_iov_upto(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_iov, unsigned long data_size)
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000073{
Denys Vlasenko84703742012-02-25 02:38:52 +010074#if SUPPORTED_PERSONALITIES > 1
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000075 union {
76 struct { u_int32_t base; u_int32_t len; } iov32;
77 struct { u_int64_t base; u_int64_t len; } iov64;
78 } iov;
79#define sizeof_iov \
Denys Vlasenko9fd4f962012-03-19 09:36:42 +010080 (current_wordsize == 4 ? sizeof(iov.iov32) : sizeof(iov.iov64))
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000081#define iov_iov_base \
Denys Vlasenko9fd4f962012-03-19 09:36:42 +010082 (current_wordsize == 4 ? (uint64_t) iov.iov32.base : iov.iov64.base)
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000083#define iov_iov_len \
Denys Vlasenko9fd4f962012-03-19 09:36:42 +010084 (current_wordsize == 4 ? (uint64_t) iov.iov32.len : iov.iov64.len)
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000085#else
Roland McGrathaa524c82005-06-01 19:22:06 +000086 struct iovec iov;
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000087#define sizeof_iov sizeof(iov)
88#define iov_iov_base iov.iov_base
89#define iov_iov_len iov.iov_len
90#endif
Roland McGrathaa524c82005-06-01 19:22:06 +000091 unsigned long size, cur, end, abbrev_end;
92 int failed = 0;
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000093
94 if (!len) {
Denys Vlasenko60fe8c12011-09-01 10:00:28 +020095 tprints("[]");
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +000096 return;
97 }
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +000098 size = len * sizeof_iov;
Roland McGrathaa524c82005-06-01 19:22:06 +000099 end = addr + size;
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +0000100 if (!verbose(tcp) || size / sizeof_iov != len || end < addr) {
Roland McGrathaa524c82005-06-01 19:22:06 +0000101 tprintf("%#lx", addr);
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000102 return;
103 }
Roland McGrathaa524c82005-06-01 19:22:06 +0000104 if (abbrev(tcp)) {
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +0000105 abbrev_end = addr + max_strlen * sizeof_iov;
Roland McGrathaa524c82005-06-01 19:22:06 +0000106 if (abbrev_end < addr)
107 abbrev_end = end;
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000108 } else {
Roland McGrathaa524c82005-06-01 19:22:06 +0000109 abbrev_end = end;
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000110 }
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200111 tprints("[");
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +0000112 for (cur = addr; cur < end; cur += sizeof_iov) {
Roland McGrathaa524c82005-06-01 19:22:06 +0000113 if (cur > addr)
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200114 tprints(", ");
Roland McGrathaa524c82005-06-01 19:22:06 +0000115 if (cur >= abbrev_end) {
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200116 tprints("...");
Roland McGrathaa524c82005-06-01 19:22:06 +0000117 break;
118 }
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +0000119 if (umoven(tcp, cur, sizeof_iov, (char *) &iov) < 0) {
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200120 tprints("?");
Roland McGrathaa524c82005-06-01 19:22:06 +0000121 failed = 1;
122 break;
123 }
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200124 tprints("{");
Denys Vlasenkoe0bc2222012-04-28 14:26:18 +0200125 if (decode_iov) {
126 unsigned long len = iov_iov_len;
127 if (len > data_size)
128 len = data_size;
129 data_size -= len;
130 printstr(tcp, (long) iov_iov_base, len);
131 } else
Dmitry V. Levin88849682011-06-13 22:58:44 +0000132 tprintf("%#lx", (long) iov_iov_base);
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +0000133 tprintf(", %lu}", (unsigned long)iov_iov_len);
Roland McGrathaa524c82005-06-01 19:22:06 +0000134 }
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200135 tprints("]");
Roland McGrathaa524c82005-06-01 19:22:06 +0000136 if (failed)
137 tprintf(" %#lx", addr);
Dmitry V. Levin4ebb4e32006-12-13 17:08:08 +0000138#undef sizeof_iov
139#undef iov_iov_base
140#undef iov_iov_len
Wichert Akkermanbf79f2e2000-09-01 21:03:06 +0000141}
142
Denys Vlasenkoe0bc2222012-04-28 14:26:18 +0200143void
144tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_iov)
145{
146 tprint_iov_upto(tcp, len, addr, decode_iov, ULONG_MAX);
147}
148
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000149int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300150sys_readv(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000151{
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000152 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300153 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200154 tprints(", ");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000155 } else {
156 if (syserror(tcp)) {
157 tprintf("%#lx, %lu",
158 tcp->u_arg[1], tcp->u_arg[2]);
159 return 0;
160 }
Dmitry V. Levin88849682011-06-13 22:58:44 +0000161 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000162 tprintf(", %lu", tcp->u_arg[2]);
163 }
164 return 0;
165}
166
167int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300168sys_writev(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000169{
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000170 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300171 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200172 tprints(", ");
Dmitry V. Levin88849682011-06-13 22:58:44 +0000173 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000174 tprintf(", %lu", tcp->u_arg[2]);
175 }
176 return 0;
177}
John Hughes1d08dcf2001-07-10 13:48:44 +0000178#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000179
Roland McGrathc0f8bbd2003-08-21 09:58:00 +0000180/* The SH4 ABI does allow long longs in odd-numbered registers, but
181 does not allow them to be split between registers and memory - and
182 there are only four argument registers for normal functions. As a
183 result pread takes an extra padding argument before the offset. This
184 was changed late in the 2.4 series (around 2.4.20). */
185#if defined(SH)
186#define PREAD_OFFSET_ARG 4
187#else
188#define PREAD_OFFSET_ARG 3
189#endif
190
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000191int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300192sys_pread(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000193{
194 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300195 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200196 tprints(", ");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000197 } else {
198 if (syserror(tcp))
199 tprintf("%#lx", tcp->u_arg[1]);
200 else
201 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
Andreas Schwabb5600fc2009-11-04 17:08:34 +0100202 tprintf(", %lu, ", tcp->u_arg[2]);
203 printllval(tcp, "%llu", PREAD_OFFSET_ARG);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000204 }
205 return 0;
206}
207
208int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300209sys_pwrite(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000210{
211 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300212 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200213 tprints(", ");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000214 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
Andreas Schwabb5600fc2009-11-04 17:08:34 +0100215 tprintf(", %lu, ", tcp->u_arg[2]);
216 printllval(tcp, "%llu", PREAD_OFFSET_ARG);
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000217 }
218 return 0;
219}
220
Damir Shayhutdinov3087dd62011-05-12 16:57:40 +0400221#if HAVE_SYS_UIO_H
222int
223sys_preadv(struct tcb *tcp)
224{
225 if (entering(tcp)) {
226 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200227 tprints(", ");
Damir Shayhutdinov3087dd62011-05-12 16:57:40 +0400228 } else {
229 if (syserror(tcp)) {
230 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
231 return 0;
232 }
Dmitry V. Levin88849682011-06-13 22:58:44 +0000233 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
Damir Shayhutdinov3087dd62011-05-12 16:57:40 +0400234 tprintf(", %lu, ", tcp->u_arg[2]);
235 printllval(tcp, "%llu", PREAD_OFFSET_ARG);
236 }
237 return 0;
238}
239
240int
241sys_pwritev(struct tcb *tcp)
242{
243 if (entering(tcp)) {
244 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200245 tprints(", ");
Dmitry V. Levin88849682011-06-13 22:58:44 +0000246 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
Damir Shayhutdinov3087dd62011-05-12 16:57:40 +0400247 tprintf(", %lu, ", tcp->u_arg[2]);
248 printllval(tcp, "%llu", PREAD_OFFSET_ARG);
249 }
250 return 0;
251}
252#endif /* HAVE_SYS_UIO_H */
253
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000254int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300255sys_sendfile(struct tcb *tcp)
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000256{
257 if (entering(tcp)) {
258 off_t offset;
259
Dmitry V. Levin31382132011-03-04 05:08:02 +0300260 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200261 tprints(", ");
Dmitry V. Levin31382132011-03-04 05:08:02 +0300262 printfd(tcp, tcp->u_arg[1]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200263 tprints(", ");
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000264 if (!tcp->u_arg[2])
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200265 tprints("NULL");
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000266 else if (umove(tcp, tcp->u_arg[2], &offset) < 0)
267 tprintf("%#lx", tcp->u_arg[2]);
268 else
H.J. Lu6ca26102012-02-03 10:12:10 -0800269#ifdef HAVE_LONG_LONG_OFF_T
270 tprintf("[%llu]", offset);
271#else
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000272 tprintf("[%lu]", offset);
H.J. Lu6ca26102012-02-03 10:12:10 -0800273#endif
Wichert Akkerman2e2553a1999-05-09 00:29:58 +0000274 tprintf(", %lu", tcp->u_arg[3]);
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000275 }
276 return 0;
277}
278
Mike Frysinger0cbed352012-04-04 22:22:01 -0400279void
Dmitry V. Levind99e48c2011-10-11 17:07:05 +0000280print_loff_t(struct tcb *tcp, long addr)
281{
282 loff_t offset;
283
284 if (!addr)
285 tprints("NULL");
286 else if (umove(tcp, addr, &offset) < 0)
287 tprintf("%#lx", addr);
288 else
289 tprintf("[%llu]", (unsigned long long int) offset);
290}
291
Roland McGrath186c5ac2002-12-15 23:58:23 +0000292int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300293sys_sendfile64(struct tcb *tcp)
Roland McGrath186c5ac2002-12-15 23:58:23 +0000294{
295 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300296 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200297 tprints(", ");
Dmitry V. Levin31382132011-03-04 05:08:02 +0300298 printfd(tcp, tcp->u_arg[1]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200299 tprints(", ");
Dmitry V. Levind99e48c2011-10-11 17:07:05 +0000300 print_loff_t(tcp, tcp->u_arg[2]);
Roland McGrath186c5ac2002-12-15 23:58:23 +0000301 tprintf(", %lu", tcp->u_arg[3]);
302 }
303 return 0;
304}
305
Dmitry V. Levind99e48c2011-10-11 17:07:05 +0000306static const struct xlat splice_flags[] = {
307#ifdef SPLICE_F_MOVE
308 { SPLICE_F_MOVE, "SPLICE_F_MOVE" },
309#endif
310#ifdef SPLICE_F_NONBLOCK
311 { SPLICE_F_NONBLOCK, "SPLICE_F_NONBLOCK" },
312#endif
313#ifdef SPLICE_F_MORE
314 { SPLICE_F_MORE, "SPLICE_F_MORE" },
315#endif
316#ifdef SPLICE_F_GIFT
317 { SPLICE_F_GIFT, "SPLICE_F_GIFT" },
318#endif
319 { 0, NULL },
320};
321
322int
323sys_tee(struct tcb *tcp)
324{
325 if (entering(tcp)) {
326 /* int fd_in */
327 printfd(tcp, tcp->u_arg[0]);
328 tprints(", ");
329 /* int fd_out */
330 printfd(tcp, tcp->u_arg[1]);
331 tprints(", ");
332 /* size_t len */
333 tprintf("%lu, ", tcp->u_arg[2]);
334 /* unsigned int flags */
335 printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???");
336 }
337 return 0;
338}
339
340int
341sys_splice(struct tcb *tcp)
342{
343 if (entering(tcp)) {
344 /* int fd_in */
345 printfd(tcp, tcp->u_arg[0]);
346 tprints(", ");
347 /* loff_t *off_in */
348 print_loff_t(tcp, tcp->u_arg[1]);
349 tprints(", ");
350 /* int fd_out */
351 printfd(tcp, tcp->u_arg[2]);
352 tprints(", ");
353 /* loff_t *off_out */
354 print_loff_t(tcp, tcp->u_arg[3]);
355 tprints(", ");
356 /* size_t len */
357 tprintf("%lu, ", tcp->u_arg[4]);
358 /* unsigned int flags */
359 printflags(splice_flags, tcp->u_arg[5], "SPLICE_F_???");
360 }
361 return 0;
362}
363
364int
365sys_vmsplice(struct tcb *tcp)
366{
367 if (entering(tcp)) {
368 /* int fd */
369 printfd(tcp, tcp->u_arg[0]);
370 tprints(", ");
371 /* const struct iovec *iov, unsigned long nr_segs */
372 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
Dmitry V. Levin0bfd7442012-03-10 14:03:25 +0000373 tprintf(", %lu, ", tcp->u_arg[2]);
Dmitry V. Levind99e48c2011-10-11 17:07:05 +0000374 /* unsigned int flags */
375 printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???");
376 }
377 return 0;
378}
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000379
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000380int
Dmitry V. Levin31382132011-03-04 05:08:02 +0300381sys_ioctl(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000382{
Roland McGrathee36ce12004-09-04 03:53:10 +0000383 const struct ioctlent *iop;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000384
385 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300386 printfd(tcp, tcp->u_arg[0]);
Denys Vlasenko60fe8c12011-09-01 10:00:28 +0200387 tprints(", ");
Roland McGrath2843a4e2003-11-14 02:54:03 +0000388 iop = ioctl_lookup(tcp->u_arg[1]);
389 if (iop) {
Denys Vlasenko5940e652011-09-01 09:55:05 +0200390 tprints(iop->symbol);
Roland McGrath2843a4e2003-11-14 02:54:03 +0000391 while ((iop = ioctl_next_match(iop)))
392 tprintf(" or %s", iop->symbol);
393 } else
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000394 tprintf("%#lx", tcp->u_arg[1]);
395 ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
396 }
397 else {
Denys Vlasenko5d645812011-08-20 12:48:18 +0200398 int ret = ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
399 if (!ret)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000400 tprintf(", %#lx", tcp->u_arg[2]);
John Hughes38ae88d2002-05-23 11:48:58 +0000401 else
402 return ret - 1;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000403 }
404 return 0;
405}