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.
38 #ifdef HAVE_LONG_LONG_OFF_T
40 * Hacks for systems that have a long long off_t
43 #define sys_pread64 sys_pread
44 #define sys_pwrite64 sys_pwrite
52 tprintf("%ld, ", tcp->u_arg[0]);
55 tprintf("%#lx", tcp->u_arg[1]);
57 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
58 tprintf(", %lu", tcp->u_arg[2]);
68 tprintf("%ld, ", tcp->u_arg[0]);
69 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
70 tprintf(", %lu", tcp->u_arg[2]);
76 tprint_iov(tcp, len, addr)
90 if ((iov = (struct iovec *) malloc(len * sizeof *iov)) == NULL) {
91 fprintf(stderr, "No memory");
94 if (umoven(tcp, (int) addr,
95 len * sizeof *iov, (char *) iov) < 0) {
96 tprintf("%#lx", tcp->u_arg[1]);
99 for (i = 0; i < len; i++) {
103 printstr(tcp, (long) iov[i].iov_base,
105 tprintf(", %lu}", (unsigned long)iov[i].iov_len);
117 tprintf("%ld, ", tcp->u_arg[0]);
121 tcp->u_arg[1], tcp->u_arg[2]);
124 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
125 tprintf(", %lu", tcp->u_arg[2]);
135 tprintf("%ld, ", tcp->u_arg[0]);
136 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
137 tprintf(", %lu", tcp->u_arg[2]);
149 tprintf("%ld, ", tcp->u_arg[0]);
152 tprintf("%#lx", tcp->u_arg[1]);
154 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
156 /* off_t is signed int */
157 tprintf(", %lu, %ld", tcp->u_arg[2], tcp->u_arg[3]);
159 tprintf(", %lu, %llu", tcp->u_arg[2],
160 (((unsigned long long) tcp->u_arg[4]) << 32
172 tprintf("%ld, ", tcp->u_arg[0]);
173 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
175 /* off_t is signed int */
176 tprintf(", %lu, %ld", tcp->u_arg[2], tcp->u_arg[3]);
178 tprintf(", %lu, %llu", tcp->u_arg[2],
179 (((unsigned long long) tcp->u_arg[4]) << 32
188 #include <sys/types.h>
189 #include <sys/socket.h>
196 tprintf("%ld, %ld, %llu, %lu", tcp->u_arg[0], tcp->u_arg[1],
197 (((unsigned long long) tcp->u_arg[3]) << 32 |
198 tcp->u_arg[2]), tcp->u_arg[4]);
207 if (umove(tcp, tcp->u_arg[5], &hdtr) < 0)
208 tprintf(", %#lx", tcp->u_arg[5]);
211 tprint_iov(tcp, hdtr.hdr_cnt, hdtr.headers);
212 tprintf(", %u, ", hdtr.hdr_cnt);
213 tprint_iov(tcp, hdtr.trl_cnt, hdtr.trailers);
214 tprintf(", %u }", hdtr.hdr_cnt);
219 else if (umove(tcp, tcp->u_arg[6], &offset) < 0)
220 tprintf(", %#lx", tcp->u_arg[6]);
222 tprintf(", [%llu]", offset);
223 tprintf(", %lu", tcp->u_arg[7]);
235 tprintf("%ld, ", tcp->u_arg[0]);
238 tprintf("%#lx", tcp->u_arg[1]);
240 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
241 tprintf(", %lu, %llu", tcp->u_arg[2],
242 *(unsigned long long *)&tcp->u_arg[3]);
252 tprintf("%ld, ", tcp->u_arg[0]);
253 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
254 tprintf(", %lu, %llu", tcp->u_arg[2],
255 *(unsigned long long *)&tcp->u_arg[3]);
267 tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
270 else if (umove(tcp, tcp->u_arg[2], &offset) < 0)
271 tprintf("%#lx", tcp->u_arg[2]);
273 tprintf("[%lu]", offset);
274 tprintf(", %lu", tcp->u_arg[3]);
281 #if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
287 tprintf("%ld, ", tcp->u_arg[0]);
291 tprintf("%#lx", tcp->u_arg[1]);
293 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
294 tprintf(", %lu, %#llx", tcp->u_arg[2],
295 LONG_LONG(tcp->u_arg[3], tcp->u_arg[4]));
306 tprintf("%ld, ", tcp->u_arg[0]);
307 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
308 tprintf(", %lu, %#llx", tcp->u_arg[2],
309 LONG_LONG(tcp->u_arg[3], tcp->u_arg[4]));
322 tprintf("%ld, ", tcp->u_arg[0]);
323 symbol = ioctl_lookup(tcp->u_arg[1]);
325 tprintf("%s", symbol);
327 tprintf("%#lx", tcp->u_arg[1]);
328 ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
331 if (ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]) == 0)
332 tprintf(", %#lx", tcp->u_arg[2]);