Use stat64 instead of stat when it is available. Fixes bug #134727.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6084 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c
index f84a1c2..4afe9cf 100644
--- a/coregrind/m_libcfile.c
+++ b/coregrind/m_libcfile.c
@@ -234,10 +234,14 @@
/* returns: 0 = success, non-0 is failure */
Int VG_(check_executable)(HChar* f)
{
+#ifdef __NR_stat64
+ struct vki_stat64 st;
+ SysRes res = VG_(do_syscall2)(__NR_stat64, (UWord)f, (UWord)&st);
+#else
struct vki_stat st;
- SysRes res;
+ SysRes res = VG_(do_syscall2)(__NR_stat, (UWord)f, (UWord)&st);
+#endif
- res = VG_(stat)(f, &st);
if (res.isError) {
return res.val;
}