summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-03-12 10:31:04 -0700
committerDmitry V. Levin <ldv@altlinux.org>2014-03-12 21:29:12 +0000
commita07cfcc133f4adf5116a32b199c4230e022475da (patch)
treecb531190f898cbc6d50a13a771d3c363d4f6a9ce
parent2394a3d0e5ee5684a42b36218ada2dcf3b4e705f (diff)
downloadstrace-a07cfcc133f4adf5116a32b199c4230e022475da.tar.gz
strace-a07cfcc133f4adf5116a32b199c4230e022475da.tar.bz2
strace-a07cfcc133f4adf5116a32b199c4230e022475da.tar.xz
Fix stat decoding for LP64 bionic
Patch fb642bb6d63f7ffe2228bf48a6008bc8f56f67ff fixed building with HAVE_STAT64 for aarch64 with uapi kernel headers but not x86_64. The workaround needed to be applied to all LP64 architectures, not just aarch64. This patch fixes that and adds an explanatory comment. Signed-off-by: Elliott Hughes <enh@google.com>
-rw-r--r--file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/file.c b/file.c
index 7e0773d..03fbfaa 100644
--- a/file.c
+++ b/file.c
@@ -181,9 +181,13 @@ struct __old_kernel_stat {
#undef st_mtime
#undef st_ctime
-#ifdef AARCH64
+#if defined(__BIONIC__) && defined(__LP64__)
+/* Bionic's "libc" struct stat and struct stat64 are identical.
+ * LP64 bionic doesn't have a "kernel" stat64, so for LP64 we need to use the
+ * kernel stat.
+ */
#define stat64 stat
-#endif /* AARCH64 */
+#endif /* defined(__BIONIC__) && defined(__LP64__) */
#include <fcntl.h>
#ifdef HAVE_SYS_VFS_H