[PATCH] x86_64/stat64: define struct stat64 as struct stat

Markos Chandras markos.chandras at gmail.com
Wed Oct 10 11:59:43 UTC 2012


From: Markos Chandras <markos.chandras at imgtec.com>

x86_64 does not define a struct stat64 in asm/stat.h. It uses
struct stat instead.

This fixes a compilation problem when LFS is used

file.c:1073:16: error: storage size of ‘statbuf’ isn’t known

Signed-off-by: Markos Chandras <markos.chandras at imgtec.com>
---
 file.c     |    5 +++++
 m4/stat.m4 |    3 +++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/file.c b/file.c
index 0cda7e1..038c311 100644
--- a/file.c
+++ b/file.c
@@ -1067,6 +1067,11 @@ struct stat64 {
 #endif
 
 #ifdef HAVE_STAT64
+
+#if defined(__x86_64__)
+#define stat64 stat
+#endif
+
 static void
 printstat64(struct tcb *tcp, long addr)
 {
diff --git a/m4/stat.m4 b/m4/stat.m4
index bf0e480..7fa7987 100644
--- a/m4/stat.m4
+++ b/m4/stat.m4
@@ -6,6 +6,9 @@ AC_CACHE_VAL(ac_cv_type_stat64,
 #include <sys/types.h>
 #include <linux/types.h>
 #include <asm/stat.h>
+#if defined(__x86_64__)
+#define stat64 stat
+#endif
 ]], [[struct stat64 st;]])],[ac_cv_type_stat64=yes],[ac_cv_type_stat64=no])])
 AC_MSG_RESULT($ac_cv_type_stat64)
 if test "$ac_cv_type_stat64" = yes
-- 
1.7.1






More information about the Strace-devel mailing list