summaryrefslogtreecommitdiff
path: root/mem.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2013-02-18 15:47:57 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2013-02-18 15:47:57 +0100
commit8435d672ebbc318648a54beef1d491f1ce0531a3 (patch)
tree0caa9cca9629c46f3bdb6ccdf0cbe31662b06253 /mem.c
parent8dedb0dc9636f64d6d1865a55d06a6fb6c4a04a9 (diff)
downloadstrace-8435d672ebbc318648a54beef1d491f1ce0531a3.tar.gz
strace-8435d672ebbc318648a54beef1d491f1ce0531a3.tar.bz2
strace-8435d672ebbc318648a54beef1d491f1ce0531a3.tar.xz
Remove code which supports systems with long long off_t.
While looking at mmap mess, did experimenting in order to figure out what gets used when. Tried building armv4tl, armv5l, armv6l, mips, mipsel, i686, x86_64 and none of they have long long off_t, which isn't suprprising: we aren't using glibc defines which enable that. Moreover, we SHOULD NOT use off_t in syscall decode! Its size depends on libc, not on arch! I.e. it is essentially unpredictable and can even in theory vary on the same arch with different libc. We should use longs or long longs, in a way which matches architectural ABI for the given syscall. There are usually *at most* two permutations, no need to add yet another variable (sizeof(off_t)) to the mix. This change removes almost all HAVE_LONG_LONG_OFF_T conditionals, which will reveal further possible simplifications. * mem.c: Remove code conditional on HAVE_LONG_LONG_OFF_T. As a result, never remap sys_mmap64 to sys_mmap. (print_mmap): Compile unconditionally. (sys_old_mmap): Compile unconditionally. (sys_mmap): Compile unconditionally. * io.c (sys_sendfile): Add a FIXME comment. * file.c: Remove code conditional on HAVE_LONG_LONG_OFF_T. As a result, never remap sys_*stat64 to sys_*stat etc. (sys_truncate): Compile unconditionally. (realprintstat): Likewise. (sys_stat): Likewise. (sys_fstat): Likewise. (sys_lstat): Likewise. * desc.c (printflock): Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'mem.c')
-rw-r--r--mem.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/mem.c b/mem.c
index 389e098..653429b 100644
--- a/mem.c
+++ b/mem.c
@@ -202,7 +202,6 @@ addtileflags(long flags)
}
#endif
-#if !HAVE_LONG_LONG_OFF_T
static int
print_mmap(struct tcb *tcp, long *u_arg, unsigned long long offset)
{
@@ -300,20 +299,13 @@ sys_mmap(struct tcb *tcp)
#endif
return print_mmap(tcp, tcp->u_arg, offset);
}
-#endif /* !HAVE_LONG_LONG_OFF_T */
-#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
+#if _LFS64_LARGEFILE
/* TODO: comment which arches use this routine.
* For one, does ALPHA on Linux use this??
* From code it seems that it might use 7 or 8 registers,
* which is strange - Linux syscalls can pass maximum of 6 parameters!
*/
-# ifdef HAVE_LONG_LONG_OFF_T
-/* For systems that have a long long off_t,
- * sys_mmap in syscall tables is handled by sys_mmap64:
- */
-# define sys_mmap64 sys_mmap
-# endif
int
sys_mmap64(struct tcb *tcp)
{
@@ -359,7 +351,7 @@ sys_mmap64(struct tcb *tcp)
}
return RVAL_HEX;
}
-#endif /* _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T */
+#endif
int
sys_munmap(struct tcb *tcp)