[PATCH] Fix stat decoding for LP64 bionic.

enh enh at google.com
Wed Mar 12 17:41:42 UTC 2014


>From 29a8e0373319d05c4bd300e98a31442fcb2beff3 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <enh at google.com>
Date: Wed, 12 Mar 2014 10:31:04 -0700
Subject: [PATCH] Fix stat decoding for LP64 bionic.

In patch fb642bb6d63f7ffe2228bf48a6008bc8f56f67ff I fixed aarch64 but broke
x86_64. The workaround needed to be applied to all LP64 architectures, not
just aarch64. This patch fixes that and adds an explanatory comment.

Change-Id: I73d495c7c52a72c5d34a803e106244e187c23e32
Signed-off-by: Elliott Hughes <enh at google.com>
---
 file.c | 8 ++++++--
 1 file 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
-- 
1.9.0.279.gdc9e3eb
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-stat-decoding-for-LP64-bionic.patch
Type: application/octet-stream
Size: 1160 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20140312/423e758b/attachment.obj>


More information about the Strace-devel mailing list