summaryrefslogtreecommitdiff
path: root/mem.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2016-06-17 16:12:13 +0000
committerDmitry V. Levin <ldv@altlinux.org>2016-06-17 16:12:13 +0000
commitb0c51131a38355dfaaed5b13b887f333cb20dfa7 (patch)
tree268c44f433febbaf431be5dcc2b7f37e69626003 /mem.c
parentd4bdff69fcedb2e54c7fb251a0384a61776fc88b (diff)
downloadstrace-b0c51131a38355dfaaed5b13b887f333cb20dfa7.tar.gz
Introduce HAVE_STRUCT_TCB_EXT_ARG macro
Check for "if HAVE_STRUCT_TCB_EXT_ARG" instead of "if defined LINUX_MIPSN32 || defined X32". * defs.h (HAVE_STRUCT_TCB_EXT_ARG): Define for LINUX_MIPSN32 || X32. (struct tcb): Check it instead of LINUX_MIPSN32 || X32. (RVAL_LUDECIMAL): Likewise. * io.c (print_lld_from_low_high_val): Likewise. * lseek.c (SYS_FUNC(lseek)): Likewise. * mem.c (SYS_FUNC(mmap)): Likewise. * syscall.c (trace_syscall_exiting): Likewise. * util.c (getllval): Likewise.
Diffstat (limited to 'mem.c')
-rw-r--r--mem.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mem.c b/mem.c
index b2c7abbc7..affc9355c 100644
--- a/mem.c
+++ b/mem.c
@@ -135,10 +135,11 @@ SYS_FUNC(old_mmap_pgoff)
/* Params are passed directly, offset is in bytes */
SYS_FUNC(mmap)
{
- unsigned long long offset = (unsigned long) tcp->u_arg[5];
-#if defined(LINUX_MIPSN32) || defined(X32)
- /* Try test/x32_mmap.c */
- offset = tcp->ext_arg[5];
+ unsigned long long offset =
+#if HAVE_STRUCT_TCB_EXT_ARG
+ tcp->ext_arg[5]; /* try test/x32_mmap.c */
+#else
+ (unsigned long) tcp->u_arg[5];
#endif
/* Example of kernel-side handling of this variety of mmap:
* arch/x86/kernel/sys_x86_64.c::SYSCALL_DEFINE6(mmap, ...) calls