X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=io.c;h=bc5e110dd1765fcc63d561d014e94e52203262c9;hb=6ca2610cee82e0bc80331093b7a713f6fc593eec;hp=acc5bb5b4c93994283401ff54596d3a3da2adab9;hpb=d99e48c0f33f5230a743cd91a986edba176db2f8;p=strace diff --git a/io.c b/io.c index acc5bb5b..bc5e110d 100644 --- a/io.c +++ b/io.c @@ -37,15 +37,6 @@ #include #endif -#ifdef HAVE_LONG_LONG_OFF_T -/* - * Hacks for systems that have a long long off_t - */ - -#define sys_pread64 sys_pread -#define sys_pwrite64 sys_pwrite -#endif - int sys_read(struct tcb *tcp) { @@ -218,6 +209,39 @@ sys_pwrite(struct tcb *tcp) } return 0; } + +#if _LFS64_LARGEFILE +int +sys_pread64(struct tcb *tcp) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + } else { + if (syserror(tcp)) + tprintf("%#lx", tcp->u_arg[1]); + else + printstr(tcp, tcp->u_arg[1], tcp->u_rval); + tprintf(", %lu, ", tcp->u_arg[2]); + printllval(tcp, "%#llx", 3); + } + return 0; +} + +int +sys_pwrite64(struct tcb *tcp) +{ + if (entering(tcp)) { + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); + tprintf(", %lu, ", tcp->u_arg[2]); + printllval(tcp, "%#llx", 3); + } + return 0; +} +#endif /* _LFS64_LARGEFILE */ + #endif /* SVR4 */ #ifdef FREEBSD @@ -355,7 +379,11 @@ sys_sendfile(struct tcb *tcp) else if (umove(tcp, tcp->u_arg[2], &offset) < 0) tprintf("%#lx", tcp->u_arg[2]); else +#ifdef HAVE_LONG_LONG_OFF_T + tprintf("[%llu]", offset); +#else tprintf("[%lu]", offset); +#endif tprintf(", %lu", tcp->u_arg[3]); } return 0; @@ -463,38 +491,6 @@ sys_vmsplice(struct tcb *tcp) } #endif /* LINUX */ -#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T -int -sys_pread64(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - } else { - if (syserror(tcp)) - tprintf("%#lx", tcp->u_arg[1]); - else - printstr(tcp, tcp->u_arg[1], tcp->u_rval); - tprintf(", %lu, ", tcp->u_arg[2]); - printllval(tcp, "%#llx", 3); - } - return 0; -} - -int -sys_pwrite64(struct tcb *tcp) -{ - if (entering(tcp)) { - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %lu, ", tcp->u_arg[2]); - printllval(tcp, "%#llx", 3); - } - return 0; -} -#endif - int sys_ioctl(struct tcb *tcp) {