summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2020-02-27 13:10:29 +0100
committerAliaksey Kandratsenka <alkondratenko@gmail.com>2020-03-08 18:13:40 -0700
commite40c7f231ad89e1ee8bf37a1d6680880c519c901 (patch)
treef4ac9cf7a9388b17e722995328269800ba87e256
parentb7607ee7d4ab35504a54588e5912a8e850686db2 (diff)
downloadgperftools-e40c7f231ad89e1ee8bf37a1d6680880c519c901.tar.gz
Fix mmap syscall on s390
mmap arguments must be passed in an array on s390. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
-rw-r--r--src/malloc_hook_mmap_linux.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/malloc_hook_mmap_linux.h b/src/malloc_hook_mmap_linux.h
index 34de715..e2efb05 100644
--- a/src/malloc_hook_mmap_linux.h
+++ b/src/malloc_hook_mmap_linux.h
@@ -61,7 +61,13 @@
static inline void* do_mmap64(void *start, size_t length,
int prot, int flags,
int fd, off64_t offset) __THROW {
+#if defined(__s390__)
+ long args[6] = { (long)start, (long)length, (long)prot, (long)flags,
+ (long)fd, (long)offset };
+ return (void*)syscall(SYS_mmap, args);
+#else
return (void*)syscall(SYS_mmap, start, length, prot, flags, fd, offset);
+#endif
}
#define MALLOC_HOOK_HAVE_DO_MMAP64 1