]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add support for fallocate system call on 32 bit (x86/ppc32) linux
authorTom Hughes <tom@compton.nu>
Wed, 25 Nov 2009 11:51:05 +0000 (11:51 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 25 Nov 2009 11:51:05 +0000 (11:51 +0000)
systems based on patch from Dodji Seketeli. Part fix for #215973.

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

coregrind/m_syswrap/syswrap-linux.c
coregrind/m_syswrap/syswrap-ppc32-linux.c
coregrind/m_syswrap/syswrap-x86-linux.c

index 6416701610c63b3650d99c869a43d0ab7f59db4f..b71e777546bff11d7d50534b1ab0c20e876cf2c1 100644 (file)
@@ -1177,14 +1177,24 @@ POST(sys_eventfd2)
    }
 }
 
-// 64-bit version.
 PRE(sys_fallocate)
 {
    *flags |= SfMayBlock;
+#if VG_WORDSIZE == 4
+   PRINT("sys_fallocate ( %ld, %ld, %lld, %lld )",
+         ARG1, ARG2, MERGE64(ARG3,ARG4), MERGE64(ARG5,ARG6));
+   PRE_REG_READ6(long, "fallocate",
+                 int, fd, int, mode,
+                 unsigned, MERGE64_FIRST(offset), unsigned, MERGE64_SECOND(offset),
+                 unsigned, MERGE64_FIRST(len), unsigned, MERGE64_SECOND(len));
+#elif VG_WORDSIZE == 8
    PRINT("sys_fallocate ( %ld, %ld, %lld, %lld )",
          ARG1, ARG2, (Long)ARG3, (Long)ARG4);
    PRE_REG_READ4(long, "fallocate",
                  int, fd, int, mode, vki_loff_t, offset, vki_loff_t, len);
+#else
+#  error Unexpected word size
+#endif
    if (!ML_(fd_allowed)(ARG1, "fallocate", tid, False))
       SET_STATUS_Failure( VKI_EBADF );
 }
index 3e67540d7d7f787e62cf04c74372f18c8e3b314c..d0b2f9b706305c909fcf73b49159caa4d3008576 100644 (file)
@@ -1858,7 +1858,7 @@ const SyscallTableEntry ML_(syscall_table)[] = {
    LINXY(__NR_timerfd_create,    sys_timerfd_create),    // 306
    LINX_(__NR_eventfd,           sys_eventfd),           // 307
    LINX_(__NR_sync_file_range2,  sys_sync_file_range2),  // 308
-//   LINX_(__NR_fallocate,         sys_fallocate),         // 309
+   LINX_(__NR_fallocate,         sys_fallocate),         // 309
 //   LINXY(__NR_subpage_prot,       sys_ni_syscall),       // 310
    LINXY(__NR_timerfd_settime,   sys_timerfd_settime),  // 311
    LINXY(__NR_timerfd_gettime,   sys_timerfd_gettime),  // 312
index 2a72174a80a9a6a4a85bde9cfc7008119208fc71..1f91b5040958176efa2db6cc2c2b998919937659 100644 (file)
@@ -2244,7 +2244,7 @@ const SyscallTableEntry ML_(syscall_table)[] = {
    LINXY(__NR_signalfd,          sys_signalfd),         // 321
    LINXY(__NR_timerfd_create,    sys_timerfd_create),   // 322
    LINX_(__NR_eventfd,           sys_eventfd),          // 323
-   //LINX_(__NR_fallocate,         sys_fallocate),        // 324
+   LINX_(__NR_fallocate,         sys_fallocate),        // 324
 
    LINXY(__NR_timerfd_settime,   sys_timerfd_settime),  // 325
    LINXY(__NR_timerfd_gettime,   sys_timerfd_gettime),  // 326