From: Dmitry V. Levin Date: Sat, 4 Feb 2012 15:17:43 +0000 (+0000) Subject: Remove unused sys_pread64 and sys_pwrite64 parsers on Linux X-Git-Tag: v4.7~179 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=309edeb2e1907d662330ec1b14290ab609e4d112;p=strace Remove unused sys_pread64 and sys_pwrite64 parsers on Linux * io.c [HAVE_LONG_LONG_OFF_T]: Remove sys_pread64 and sys_pwrite64 aliases. (sys_pread64, sys_pwrite64): Define these functions only on [SVR4 && _LFS64_LARGEFILE] platform. * linux/mips/syscallent.h: Use sys_pread and sys_pwrite to handle appropriate syscalls. * linux/syscall.h (sys_pread64, sys_pwrite64): Remove. * syscall.c (dumpio): Check sys_pread64 and sys_pwrite64 only on [SVR4 && _LFS64_LARGEFILE] platform. --- diff --git a/io.c b/io.c index acc5bb5b..c3075aa8 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 @@ -463,38 +487,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) { diff --git a/linux/mips/syscallent.h b/linux/mips/syscallent.h index b67fe6be..ee28d066 100644 --- a/linux/mips/syscallent.h +++ b/linux/mips/syscallent.h @@ -5367,7 +5367,7 @@ { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 5013 */ { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 5014 */ { 3, 0, sys_ioctl, "ioctl" }, /* 5015 */ - { 6, TF, sys_pread64, "pread" }, /* 5016 */ + { 6, TF, sys_pread, "pread" }, /* 5016 */ { 6, TF, sys_pwrite64, "pwrite" }, /* 5017 */ { 3, 0, sys_readv, "readv" }, /* 5018 */ { 3, 0, sys_writev, "writev" }, /* 5019 */ @@ -6676,8 +6676,8 @@ { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 6013 */ { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 6014 */ { 3, 0, sys_ioctl, "ioctl" }, /* 6015 */ - { 6, TF, sys_pread64, "pread" }, /* 6016 */ - { 6, TF, sys_pwrite64, "pwrite" }, /* 6017 */ + { 6, TD, sys_pread, "pread" }, /* 6016 */ + { 6, TD, sys_pwrite, "pwrite" }, /* 6017 */ { 3, 0, sys_readv, "readv" }, /* 6018 */ { 3, 0, sys_writev, "writev" }, /* 6019 */ { 2, TF, sys_access, "access" }, /* 6020 */ diff --git a/linux/syscall.h b/linux/syscall.h index fda85ed6..504b26f8 100644 --- a/linux/syscall.h +++ b/linux/syscall.h @@ -174,14 +174,12 @@ int sys_poll(); int sys_ppoll(); int sys_prctl(); int sys_pread(); -int sys_pread64(); int sys_preadv(); int sys_pselect6(); int sys_ptrace(); int sys_process_vm_readv(); int sys_putpmsg(); int sys_pwrite(); -int sys_pwrite64(); int sys_pwritev(); int sys_query_module(); int sys_quotactl(); diff --git a/syscall.c b/syscall.c index 25753175..eaf0f45b 100644 --- a/syscall.c +++ b/syscall.c @@ -2303,7 +2303,11 @@ dumpio(struct tcb *tcp) if (qual_flags[tcp->u_arg[0]] & QUAL_READ) { if (sysent[tcp->scno].sys_func == sys_read || sysent[tcp->scno].sys_func == sys_pread || +#ifdef SVR4 +#if _LFS64_LARGEFILE sysent[tcp->scno].sys_func == sys_pread64 || +#endif +#endif sysent[tcp->scno].sys_func == sys_recv || sysent[tcp->scno].sys_func == sys_recvfrom) dumpstr(tcp, tcp->u_arg[1], tcp->u_rval); @@ -2314,7 +2318,11 @@ dumpio(struct tcb *tcp) if (qual_flags[tcp->u_arg[0]] & QUAL_WRITE) { if (sysent[tcp->scno].sys_func == sys_write || sysent[tcp->scno].sys_func == sys_pwrite || +#ifdef SVR4 +#if _LFS64_LARGEFILE sysent[tcp->scno].sys_func == sys_pwrite64 || +#endif +#endif sysent[tcp->scno].sys_func == sys_send || sysent[tcp->scno].sys_func == sys_sendto) dumpstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);