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>
5 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
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.
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.
40 #ifdef HAVE_LONG_LONG_OFF_T
42 * Hacks for systems that have a long long off_t
45 #define sys_pread64 sys_pread
46 #define sys_pwrite64 sys_pwrite
54 tprintf("%ld, ", tcp->u_arg[0]);
57 tprintf("%#lx", tcp->u_arg[1]);
59 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
60 tprintf(", %lu", tcp->u_arg[2]);
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]);
79 tprint_iov(tcp, len, addr)
93 if ((iov = (struct iovec *) malloc(len * sizeof *iov)) == NULL) {
94 fprintf(stderr, "No memory");
98 len * sizeof *iov, (char *) iov) < 0) {
99 tprintf("%#lx", tcp->u_arg[1]);
102 for (i = 0; i < len; i++) {
106 printstr(tcp, (long) iov[i].iov_base,
108 tprintf(", %lu}", (unsigned long)iov[i].iov_len);
120 tprintf("%ld, ", tcp->u_arg[0]);
124 tcp->u_arg[1], tcp->u_arg[2]);
127 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
128 tprintf(", %lu", tcp->u_arg[2]);
138 tprintf("%ld, ", tcp->u_arg[0]);
139 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
140 tprintf(", %lu", tcp->u_arg[2]);
153 tprintf("%ld, ", tcp->u_arg[0]);
156 tprintf("%#lx", tcp->u_arg[1]);
158 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
160 /* off_t is signed int */
161 tprintf(", %lu, %ld", tcp->u_arg[2], tcp->u_arg[3]);
163 tprintf(", %lu, %llu", tcp->u_arg[2],
164 (((unsigned long long) tcp->u_arg[4]) << 32
165 | (unsigned) tcp->u_arg[3]));
176 tprintf("%ld, ", tcp->u_arg[0]);
177 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
179 /* off_t is signed int */
180 tprintf(", %lu, %ld", tcp->u_arg[2], tcp->u_arg[3]);
182 tprintf(", %lu, %llu", tcp->u_arg[2],
183 (((unsigned long long) tcp->u_arg[4]) << 32
184 | (unsigned) tcp->u_arg[3]));
192 #include <sys/types.h>
193 #include <sys/socket.h>
200 tprintf("%ld, %ld, %llu, %lu", tcp->u_arg[0], tcp->u_arg[1],
201 (((unsigned long long) tcp->u_arg[3]) << 32 |
202 (unsigned) tcp->u_arg[2]), tcp->u_arg[4]);
211 if (umove(tcp, tcp->u_arg[5], &hdtr) < 0)
212 tprintf(", %#lx", tcp->u_arg[5]);
215 tprint_iov(tcp, hdtr.hdr_cnt, hdtr.headers);
216 tprintf(", %u, ", hdtr.hdr_cnt);
217 tprint_iov(tcp, hdtr.trl_cnt, hdtr.trailers);
218 tprintf(", %u }", hdtr.hdr_cnt);
223 else if (umove(tcp, tcp->u_arg[6], &offset) < 0)
224 tprintf(", %#lx", tcp->u_arg[6]);
226 tprintf(", [%llu]", offset);
227 tprintf(", %lu", tcp->u_arg[7]);
235 /* The SH4 ABI does allow long longs in odd-numbered registers, but
236 does not allow them to be split between registers and memory - and
237 there are only four argument registers for normal functions. As a
238 result pread takes an extra padding argument before the offset. This
239 was changed late in the 2.4 series (around 2.4.20). */
241 #define PREAD_OFFSET_ARG 4
243 #define PREAD_OFFSET_ARG 3
251 tprintf("%ld, ", tcp->u_arg[0]);
254 tprintf("%#lx", tcp->u_arg[1]);
256 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
257 ALIGN64 (tcp, PREAD_OFFSET_ARG); /* PowerPC alignment restriction */
258 tprintf(", %lu, %llu", tcp->u_arg[2],
259 *(unsigned long long *)&tcp->u_arg[PREAD_OFFSET_ARG]);
269 tprintf("%ld, ", tcp->u_arg[0]);
270 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
271 ALIGN64 (tcp, PREAD_OFFSET_ARG); /* PowerPC alignment restriction */
272 tprintf(", %lu, %llu", tcp->u_arg[2],
273 *(unsigned long long *)&tcp->u_arg[PREAD_OFFSET_ARG]);
285 tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
288 else if (umove(tcp, tcp->u_arg[2], &offset) < 0)
289 tprintf("%#lx", tcp->u_arg[2]);
291 tprintf("[%lu]", offset);
292 tprintf(", %lu", tcp->u_arg[3]);
304 tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
307 else if (umove(tcp, tcp->u_arg[2], &offset) < 0)
308 tprintf("%#lx", tcp->u_arg[2]);
310 tprintf("[%llu]", (unsigned long long int) offset);
311 tprintf(", %lu", tcp->u_arg[3]);
318 #if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
324 tprintf("%ld, ", tcp->u_arg[0]);
328 tprintf("%#lx", tcp->u_arg[1]);
330 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
331 tprintf(", %lu, %#llx", tcp->u_arg[2],
332 LONG_LONG(tcp->u_arg[3], tcp->u_arg[4]));
343 tprintf("%ld, ", tcp->u_arg[0]);
344 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
345 tprintf(", %lu, %#llx", tcp->u_arg[2],
346 LONG_LONG(tcp->u_arg[3], tcp->u_arg[4]));
356 struct ioctlent *iop;
359 tprintf("%ld, ", tcp->u_arg[0]);
360 iop = ioctl_lookup(tcp->u_arg[1]);
362 tprintf("%s", iop->symbol);
363 while ((iop = ioctl_next_match(iop)))
364 tprintf(" or %s", iop->symbol);
366 tprintf("%#lx", tcp->u_arg[1]);
367 ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
371 if (!(ret = ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2])))
372 tprintf(", %#lx", tcp->u_arg[2]);