]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips64: fix fadvise64 syscall wrappers
authorPetar Jovanovic <mips32r2@gmail.com>
Tue, 29 Nov 2016 14:57:51 +0000 (14:57 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Tue, 29 Nov 2016 14:57:51 +0000 (14:57 +0000)
Use platform specific pre-wrapper for fadvise64 system call and respect
size of parameters, instead of using generic wrapper written for 32bit
architectures.

Issue reported by Marcin Juszkiewicz.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16163

coregrind/m_syswrap/syswrap-mips64-linux.c

index 72d6ed0c90433c215b40a3dce0f09a734147a0eb..27d19bc7d98490a3d81ea547622d4b0852b08a3f 100644 (file)
@@ -317,6 +317,7 @@ DECL_TEMPLATE (mips_linux, sys_ptrace);
 DECL_TEMPLATE (mips_linux, sys_mmap);
 DECL_TEMPLATE (mips_linux, sys_rt_sigreturn);
 DECL_TEMPLATE (mips_linux, sys_pipe);
+DECL_TEMPLATE (mips_linux, sys_fadvise64);
 
 PRE(sys_tee)
 {
@@ -667,6 +668,13 @@ POST(sys_prctl)
    WRAPPER_POST_NAME(linux, sys_prctl)(tid, arrghs, status);
 }
 
+PRE(sys_fadvise64)
+{
+   PRINT("sys_fadvise64 ( %ld, %ld, %lu, %ld )", SARG1, SARG2, ARG3, SARG4);
+   PRE_REG_READ4(long, "fadvise64",
+                 int, fd, vki_loff_t, offset, vki_loff_t, len, int, advice);
+}
+
 #undef PRE
 #undef POST
 
@@ -898,7 +906,7 @@ static SyscallTableEntry syscall_main_table[] = {
    /* LINXY(__NR_fcntl64,sys_fcntl64), */
    LINX_ (__NR_set_tid_address, sys_set_tid_address),
    LINX_ (__NR_semtimedop, sys_semtimedop),
-   LINX_ (__NR_fadvise64, sys_fadvise64),
+   PLAX_ (__NR_fadvise64, sys_fadvise64),
    LINXY (__NR_timer_create, sys_timer_create),
    LINXY (__NR_timer_settime, sys_timer_settime),
    LINXY (__NR_timer_gettime, sys_timer_gettime),