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. |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 29 | */ |
| 30 | |
| 31 | #include "defs.h" |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 32 | #include <fcntl.h> |
Dmitry V. Levin | b2fa2be | 2014-11-21 20:46:16 +0000 | [diff] [blame] | 33 | #include <sys/uio.h> |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 34 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 35 | SYS_FUNC(read) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 36 | { |
| 37 | if (entering(tcp)) { |
Dmitry V. Levin | 3138213 | 2011-03-04 05:08:02 +0300 | [diff] [blame] | 38 | printfd(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 39 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 40 | } else { |
| 41 | if (syserror(tcp)) |
Dmitry V. Levin | 43b5a1f | 2015-07-20 11:06:54 +0000 | [diff] [blame] | 42 | printaddr(tcp->u_arg[1]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 43 | else |
| 44 | printstr(tcp, tcp->u_arg[1], tcp->u_rval); |
| 45 | tprintf(", %lu", tcp->u_arg[2]); |
| 46 | } |
| 47 | return 0; |
| 48 | } |
| 49 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 50 | SYS_FUNC(write) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 51 | { |
Dmitry V. Levin | 1f255fd | 2015-07-20 11:19:30 +0000 | [diff] [blame^] | 52 | printfd(tcp, tcp->u_arg[0]); |
| 53 | tprints(", "); |
| 54 | printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); |
| 55 | tprintf(", %lu", tcp->u_arg[2]); |
| 56 | |
| 57 | return RVAL_DECODED; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 58 | } |
| 59 | |
Denys Vlasenko | e0bc222 | 2012-04-28 14:26:18 +0200 | [diff] [blame] | 60 | /* |
| 61 | * data_size limits the cumulative size of printed data. |
| 62 | * Example: recvmsg returing a short read. |
| 63 | */ |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 64 | void |
Denys Vlasenko | e0bc222 | 2012-04-28 14:26:18 +0200 | [diff] [blame] | 65 | tprint_iov_upto(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_iov, unsigned long data_size) |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 66 | { |
Denys Vlasenko | 8470374 | 2012-02-25 02:38:52 +0100 | [diff] [blame] | 67 | #if SUPPORTED_PERSONALITIES > 1 |
Dmitry V. Levin | 4ebb4e3 | 2006-12-13 17:08:08 +0000 | [diff] [blame] | 68 | union { |
| 69 | struct { u_int32_t base; u_int32_t len; } iov32; |
| 70 | struct { u_int64_t base; u_int64_t len; } iov64; |
| 71 | } iov; |
| 72 | #define sizeof_iov \ |
Denys Vlasenko | 9fd4f96 | 2012-03-19 09:36:42 +0100 | [diff] [blame] | 73 | (current_wordsize == 4 ? sizeof(iov.iov32) : sizeof(iov.iov64)) |
Dmitry V. Levin | 4ebb4e3 | 2006-12-13 17:08:08 +0000 | [diff] [blame] | 74 | #define iov_iov_base \ |
Denys Vlasenko | 9fd4f96 | 2012-03-19 09:36:42 +0100 | [diff] [blame] | 75 | (current_wordsize == 4 ? (uint64_t) iov.iov32.base : iov.iov64.base) |
Dmitry V. Levin | 4ebb4e3 | 2006-12-13 17:08:08 +0000 | [diff] [blame] | 76 | #define iov_iov_len \ |
Denys Vlasenko | 9fd4f96 | 2012-03-19 09:36:42 +0100 | [diff] [blame] | 77 | (current_wordsize == 4 ? (uint64_t) iov.iov32.len : iov.iov64.len) |
Dmitry V. Levin | 4ebb4e3 | 2006-12-13 17:08:08 +0000 | [diff] [blame] | 78 | #else |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 79 | struct iovec iov; |
Dmitry V. Levin | 4ebb4e3 | 2006-12-13 17:08:08 +0000 | [diff] [blame] | 80 | #define sizeof_iov sizeof(iov) |
| 81 | #define iov_iov_base iov.iov_base |
| 82 | #define iov_iov_len iov.iov_len |
| 83 | #endif |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 84 | unsigned long size, cur, end, abbrev_end; |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 85 | |
| 86 | if (!len) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 87 | tprints("[]"); |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 88 | return; |
| 89 | } |
Dmitry V. Levin | 4ebb4e3 | 2006-12-13 17:08:08 +0000 | [diff] [blame] | 90 | size = len * sizeof_iov; |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 91 | end = addr + size; |
Dmitry V. Levin | 43b5a1f | 2015-07-20 11:06:54 +0000 | [diff] [blame] | 92 | if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) || |
| 93 | !addr || size / sizeof_iov != len || end < addr) { |
| 94 | printaddr(addr); |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 95 | return; |
| 96 | } |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 97 | if (abbrev(tcp)) { |
Dmitry V. Levin | 4ebb4e3 | 2006-12-13 17:08:08 +0000 | [diff] [blame] | 98 | abbrev_end = addr + max_strlen * sizeof_iov; |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 99 | if (abbrev_end < addr) |
| 100 | abbrev_end = end; |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 101 | } else { |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 102 | abbrev_end = end; |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 103 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 104 | tprints("["); |
Dmitry V. Levin | 4ebb4e3 | 2006-12-13 17:08:08 +0000 | [diff] [blame] | 105 | for (cur = addr; cur < end; cur += sizeof_iov) { |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 106 | if (cur > addr) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 107 | tprints(", "); |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 108 | if (cur >= abbrev_end) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 109 | tprints("..."); |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 110 | break; |
| 111 | } |
Dmitry V. Levin | 43b5a1f | 2015-07-20 11:06:54 +0000 | [diff] [blame] | 112 | if (umoven_or_printaddr(tcp, cur, sizeof_iov, &iov)) |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 113 | break; |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 114 | tprints("{"); |
Denys Vlasenko | e0bc222 | 2012-04-28 14:26:18 +0200 | [diff] [blame] | 115 | if (decode_iov) { |
| 116 | unsigned long len = iov_iov_len; |
| 117 | if (len > data_size) |
| 118 | len = data_size; |
| 119 | data_size -= len; |
| 120 | printstr(tcp, (long) iov_iov_base, len); |
| 121 | } else |
Dmitry V. Levin | 43b5a1f | 2015-07-20 11:06:54 +0000 | [diff] [blame] | 122 | printaddr((long) iov_iov_base); |
Dmitry V. Levin | 4ebb4e3 | 2006-12-13 17:08:08 +0000 | [diff] [blame] | 123 | tprintf(", %lu}", (unsigned long)iov_iov_len); |
Roland McGrath | aa524c8 | 2005-06-01 19:22:06 +0000 | [diff] [blame] | 124 | } |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 125 | tprints("]"); |
Dmitry V. Levin | 4ebb4e3 | 2006-12-13 17:08:08 +0000 | [diff] [blame] | 126 | #undef sizeof_iov |
| 127 | #undef iov_iov_base |
| 128 | #undef iov_iov_len |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 129 | } |
| 130 | |
Denys Vlasenko | e0bc222 | 2012-04-28 14:26:18 +0200 | [diff] [blame] | 131 | void |
| 132 | tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_iov) |
| 133 | { |
Dmitry V. Levin | 043b5f8 | 2012-05-01 20:30:02 +0000 | [diff] [blame] | 134 | tprint_iov_upto(tcp, len, addr, decode_iov, (unsigned long) -1L); |
Denys Vlasenko | e0bc222 | 2012-04-28 14:26:18 +0200 | [diff] [blame] | 135 | } |
| 136 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 137 | SYS_FUNC(readv) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 138 | { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 139 | if (entering(tcp)) { |
Dmitry V. Levin | 3138213 | 2011-03-04 05:08:02 +0300 | [diff] [blame] | 140 | printfd(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 141 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 142 | } else { |
Dmitry V. Levin | 8884968 | 2011-06-13 22:58:44 +0000 | [diff] [blame] | 143 | tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 144 | tprintf(", %lu", tcp->u_arg[2]); |
| 145 | } |
| 146 | return 0; |
| 147 | } |
| 148 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 149 | SYS_FUNC(writev) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 150 | { |
Dmitry V. Levin | 1f255fd | 2015-07-20 11:19:30 +0000 | [diff] [blame^] | 151 | printfd(tcp, tcp->u_arg[0]); |
| 152 | tprints(", "); |
| 153 | tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); |
| 154 | tprintf(", %lu", tcp->u_arg[2]); |
| 155 | |
| 156 | return RVAL_DECODED; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 157 | } |
| 158 | |
Roland McGrath | c0f8bbd | 2003-08-21 09:58:00 +0000 | [diff] [blame] | 159 | /* The SH4 ABI does allow long longs in odd-numbered registers, but |
| 160 | does not allow them to be split between registers and memory - and |
| 161 | there are only four argument registers for normal functions. As a |
| 162 | result pread takes an extra padding argument before the offset. This |
| 163 | was changed late in the 2.4 series (around 2.4.20). */ |
| 164 | #if defined(SH) |
| 165 | #define PREAD_OFFSET_ARG 4 |
| 166 | #else |
| 167 | #define PREAD_OFFSET_ARG 3 |
| 168 | #endif |
| 169 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 170 | SYS_FUNC(pread) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 171 | { |
| 172 | if (entering(tcp)) { |
Dmitry V. Levin | 3138213 | 2011-03-04 05:08:02 +0300 | [diff] [blame] | 173 | printfd(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 174 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 175 | } else { |
| 176 | if (syserror(tcp)) |
Dmitry V. Levin | 43b5a1f | 2015-07-20 11:06:54 +0000 | [diff] [blame] | 177 | printaddr(tcp->u_arg[1]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 178 | else |
| 179 | printstr(tcp, tcp->u_arg[1], tcp->u_rval); |
Andreas Schwab | b5600fc | 2009-11-04 17:08:34 +0100 | [diff] [blame] | 180 | tprintf(", %lu, ", tcp->u_arg[2]); |
Dmitry V. Levin | 3c49b02 | 2014-08-07 00:07:28 +0000 | [diff] [blame] | 181 | printllval(tcp, "%llu", PREAD_OFFSET_ARG); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 182 | } |
| 183 | return 0; |
| 184 | } |
| 185 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 186 | SYS_FUNC(pwrite) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 187 | { |
Dmitry V. Levin | 1f255fd | 2015-07-20 11:19:30 +0000 | [diff] [blame^] | 188 | printfd(tcp, tcp->u_arg[0]); |
| 189 | tprints(", "); |
| 190 | printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); |
| 191 | tprintf(", %lu, ", tcp->u_arg[2]); |
| 192 | printllval(tcp, "%llu", PREAD_OFFSET_ARG); |
| 193 | |
| 194 | return RVAL_DECODED; |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 195 | } |
| 196 | |
Dmitry V. Levin | 3c49b02 | 2014-08-07 00:07:28 +0000 | [diff] [blame] | 197 | static void |
| 198 | print_llu_from_low_high_val(struct tcb *tcp, int arg) |
| 199 | { |
| 200 | #if SIZEOF_LONG == SIZEOF_LONG_LONG |
Dmitry V. Levin | 5de5a7a | 2015-01-23 20:04:37 +0000 | [diff] [blame] | 201 | # if SUPPORTED_PERSONALITIES > 1 |
| 202 | if (current_wordsize == sizeof(long)) |
| 203 | # endif |
| 204 | tprintf("%lu", (unsigned long) tcp->u_arg[arg]); |
| 205 | # if SUPPORTED_PERSONALITIES > 1 |
| 206 | else |
| 207 | tprintf("%lu", |
| 208 | ((unsigned long) tcp->u_arg[arg + 1] << current_wordsize * 8) |
| 209 | | (unsigned long) tcp->u_arg[arg]); |
| 210 | # endif |
Dmitry V. Levin | 3c49b02 | 2014-08-07 00:07:28 +0000 | [diff] [blame] | 211 | #else |
| 212 | # ifdef X32 |
| 213 | if (current_personality == 0) |
| 214 | tprintf("%llu", (unsigned long long) tcp->ext_arg[arg]); |
| 215 | else |
| 216 | # endif |
| 217 | tprintf("%llu", |
Dmitry V. Levin | 20b84a6 | 2014-08-07 11:42:46 +0000 | [diff] [blame] | 218 | ((unsigned long long) (unsigned long) tcp->u_arg[arg + 1] << sizeof(long) * 8) |
| 219 | | (unsigned long long) (unsigned long) tcp->u_arg[arg]); |
Dmitry V. Levin | 3c49b02 | 2014-08-07 00:07:28 +0000 | [diff] [blame] | 220 | #endif |
| 221 | } |
| 222 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 223 | SYS_FUNC(preadv) |
Damir Shayhutdinov | 3087dd6 | 2011-05-12 16:57:40 +0400 | [diff] [blame] | 224 | { |
| 225 | if (entering(tcp)) { |
| 226 | printfd(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 227 | tprints(", "); |
Damir Shayhutdinov | 3087dd6 | 2011-05-12 16:57:40 +0400 | [diff] [blame] | 228 | } else { |
Dmitry V. Levin | 8884968 | 2011-06-13 22:58:44 +0000 | [diff] [blame] | 229 | tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); |
Damir Shayhutdinov | 3087dd6 | 2011-05-12 16:57:40 +0400 | [diff] [blame] | 230 | tprintf(", %lu, ", tcp->u_arg[2]); |
Dmitry V. Levin | 3c49b02 | 2014-08-07 00:07:28 +0000 | [diff] [blame] | 231 | print_llu_from_low_high_val(tcp, 3); |
Damir Shayhutdinov | 3087dd6 | 2011-05-12 16:57:40 +0400 | [diff] [blame] | 232 | } |
| 233 | return 0; |
| 234 | } |
| 235 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 236 | SYS_FUNC(pwritev) |
Damir Shayhutdinov | 3087dd6 | 2011-05-12 16:57:40 +0400 | [diff] [blame] | 237 | { |
Dmitry V. Levin | 1f255fd | 2015-07-20 11:19:30 +0000 | [diff] [blame^] | 238 | printfd(tcp, tcp->u_arg[0]); |
| 239 | tprints(", "); |
| 240 | tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); |
| 241 | tprintf(", %lu, ", tcp->u_arg[2]); |
| 242 | print_llu_from_low_high_val(tcp, 3); |
| 243 | |
| 244 | return RVAL_DECODED; |
Damir Shayhutdinov | 3087dd6 | 2011-05-12 16:57:40 +0400 | [diff] [blame] | 245 | } |
Damir Shayhutdinov | 3087dd6 | 2011-05-12 16:57:40 +0400 | [diff] [blame] | 246 | |
Dmitry V. Levin | 2c42f32 | 2013-03-20 09:48:44 +0000 | [diff] [blame] | 247 | static void |
| 248 | print_off_t(struct tcb *tcp, long addr) |
| 249 | { |
Dmitry V. Levin | 43b5a1f | 2015-07-20 11:06:54 +0000 | [diff] [blame] | 250 | if (current_wordsize == sizeof(int)) |
| 251 | printnum_int(tcp, addr, "%u"); |
Dmitry V. Levin | 2c42f32 | 2013-03-20 09:48:44 +0000 | [diff] [blame] | 252 | else |
Dmitry V. Levin | 43b5a1f | 2015-07-20 11:06:54 +0000 | [diff] [blame] | 253 | printnum_long(tcp, addr, "%lu"); |
Dmitry V. Levin | 2c42f32 | 2013-03-20 09:48:44 +0000 | [diff] [blame] | 254 | } |
| 255 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 256 | SYS_FUNC(sendfile) |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 257 | { |
Dmitry V. Levin | 1f255fd | 2015-07-20 11:19:30 +0000 | [diff] [blame^] | 258 | printfd(tcp, tcp->u_arg[0]); |
| 259 | tprints(", "); |
| 260 | printfd(tcp, tcp->u_arg[1]); |
| 261 | tprints(", "); |
| 262 | print_off_t(tcp, tcp->u_arg[2]); |
| 263 | tprintf(", %lu", tcp->u_arg[3]); |
| 264 | |
| 265 | return RVAL_DECODED; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 266 | } |
| 267 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 268 | SYS_FUNC(sendfile64) |
Roland McGrath | 186c5ac | 2002-12-15 23:58:23 +0000 | [diff] [blame] | 269 | { |
Dmitry V. Levin | 1f255fd | 2015-07-20 11:19:30 +0000 | [diff] [blame^] | 270 | printfd(tcp, tcp->u_arg[0]); |
| 271 | tprints(", "); |
| 272 | printfd(tcp, tcp->u_arg[1]); |
| 273 | tprints(", "); |
| 274 | printnum_int64(tcp, tcp->u_arg[2], "%" PRIu64); |
| 275 | tprintf(", %lu", tcp->u_arg[3]); |
| 276 | |
| 277 | return RVAL_DECODED; |
Roland McGrath | 186c5ac | 2002-12-15 23:58:23 +0000 | [diff] [blame] | 278 | } |
| 279 | |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 280 | #include "xlat/splice_flags.h" |
Dmitry V. Levin | d99e48c | 2011-10-11 17:07:05 +0000 | [diff] [blame] | 281 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 282 | SYS_FUNC(tee) |
Dmitry V. Levin | d99e48c | 2011-10-11 17:07:05 +0000 | [diff] [blame] | 283 | { |
Dmitry V. Levin | 1f255fd | 2015-07-20 11:19:30 +0000 | [diff] [blame^] | 284 | /* int fd_in */ |
| 285 | printfd(tcp, tcp->u_arg[0]); |
| 286 | tprints(", "); |
| 287 | /* int fd_out */ |
| 288 | printfd(tcp, tcp->u_arg[1]); |
| 289 | tprints(", "); |
| 290 | /* size_t len */ |
| 291 | tprintf("%lu, ", tcp->u_arg[2]); |
| 292 | /* unsigned int flags */ |
| 293 | printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???"); |
| 294 | |
| 295 | return RVAL_DECODED; |
Dmitry V. Levin | d99e48c | 2011-10-11 17:07:05 +0000 | [diff] [blame] | 296 | } |
| 297 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 298 | SYS_FUNC(splice) |
Dmitry V. Levin | d99e48c | 2011-10-11 17:07:05 +0000 | [diff] [blame] | 299 | { |
Dmitry V. Levin | 1f255fd | 2015-07-20 11:19:30 +0000 | [diff] [blame^] | 300 | /* int fd_in */ |
| 301 | printfd(tcp, tcp->u_arg[0]); |
| 302 | tprints(", "); |
| 303 | /* loff_t *off_in */ |
| 304 | printnum_int64(tcp, tcp->u_arg[1], "%" PRIu64); |
| 305 | tprints(", "); |
| 306 | /* int fd_out */ |
| 307 | printfd(tcp, tcp->u_arg[2]); |
| 308 | tprints(", "); |
| 309 | /* loff_t *off_out */ |
| 310 | printnum_int64(tcp, tcp->u_arg[3], "%" PRIu64); |
| 311 | tprints(", "); |
| 312 | /* size_t len */ |
| 313 | tprintf("%lu, ", tcp->u_arg[4]); |
| 314 | /* unsigned int flags */ |
| 315 | printflags(splice_flags, tcp->u_arg[5], "SPLICE_F_???"); |
| 316 | |
| 317 | return RVAL_DECODED; |
Dmitry V. Levin | d99e48c | 2011-10-11 17:07:05 +0000 | [diff] [blame] | 318 | } |
| 319 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 320 | SYS_FUNC(vmsplice) |
Dmitry V. Levin | d99e48c | 2011-10-11 17:07:05 +0000 | [diff] [blame] | 321 | { |
Dmitry V. Levin | 1f255fd | 2015-07-20 11:19:30 +0000 | [diff] [blame^] | 322 | /* int fd */ |
| 323 | printfd(tcp, tcp->u_arg[0]); |
| 324 | tprints(", "); |
| 325 | /* const struct iovec *iov, unsigned long nr_segs */ |
| 326 | tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1); |
| 327 | tprintf(", %lu, ", tcp->u_arg[2]); |
| 328 | /* unsigned int flags */ |
| 329 | printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???"); |
| 330 | |
| 331 | return RVAL_DECODED; |
Dmitry V. Levin | d99e48c | 2011-10-11 17:07:05 +0000 | [diff] [blame] | 332 | } |