[PATCH 2/7] Define old stat functions only if needed

H.J. Lu hongjiu.lu at intel.com
Fri Feb 3 18:10:30 UTC 2012


Hi,

When HAVE_LONG_LONG_OFF_T is defined, those old stat functions aren't used
and strace won't link since they use realprintstat which isn't defined
when HAVE_LONG_LONG_OFF_T is defined.

H.J.
---
2012-02-02  H.J. Lu  <hongjiu.lu at intel.com>

	* file.c (convertoldstat): Define only if HAVE_LONG_LONG_OFF_T
	isn't defined.
	(sys_oldstat): Likewise.
	(sys_oldfstat): Likewise.
	(sys_oldlstat): Likewise.

diff --git a/file.c b/file.c
index 87e0743..db024ef 100644
--- a/file.c
+++ b/file.c
@@ -1229,7 +1229,8 @@ printstat64(struct tcb *tcp, long addr)
 }
 #endif /* HAVE_STAT64 */
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
+#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
+    && !defined(HAVE_LONG_LONG_OFF_T)
 static void
 convertoldstat(const struct __old_kernel_stat *oldbuf, struct stat *newbuf)
 {
@@ -1346,7 +1347,8 @@ sys_newfstatat(struct tcb *tcp)
 }
 #endif
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
+#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
+    && !defined(HAVE_LONG_LONG_OFF_T)
 int
 sys_oldstat(struct tcb *tcp)
 {
@@ -1390,7 +1392,8 @@ sys_fstat64(struct tcb *tcp)
 #endif
 }
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
+#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
+    && !defined(HAVE_LONG_LONG_OFF_T)
 int
 sys_oldfstat(struct tcb *tcp)
 {
@@ -1434,7 +1437,8 @@ sys_lstat64(struct tcb *tcp)
 #endif
 }
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
+#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
+    && !defined(HAVE_LONG_LONG_OFF_T)
 int
 sys_oldlstat(struct tcb *tcp)
 {
-- 
1.7.6.5





More information about the Strace-devel mailing list