]> granicus.if.org Git - strace/commitdiff
Remove unused sys_pread64 and sys_pwrite64 parsers on Linux
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 4 Feb 2012 15:17:43 +0000 (15:17 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 4 Feb 2012 15:17:43 +0000 (15:17 +0000)
* 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.

io.c
linux/mips/syscallent.h
linux/syscall.h
syscall.c

diff --git a/io.c b/io.c
index acc5bb5b4c93994283401ff54596d3a3da2adab9..c3075aa8ac3162b18f50d3bf8147e426bd829918 100644 (file)
--- a/io.c
+++ b/io.c
 #include <sys/uio.h>
 #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)
 {
index b67fe6be463b4152f6efcd7b5d9687cfaad93aab..ee28d06683168b5723247ed1689975334682b31f 100644 (file)
        { 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 */
        { 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 */
index fda85ed6cf35d95e6873203784e6af32ce4bf4d2..504b26f86e4d7f0fb78f41413e0c854d440d1f0e 100644 (file)
@@ -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();
index 2575317511bc66f05a7e649e48976d8a4b4a799a..eaf0f45bc2593358aad479064ecd2169551651da 100644 (file)
--- 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]);