changeset 12219:cbf8d59f676a

stat: fix compilation on AIX AC_SYS_LARGEFILE turns on large-file support, but in that mode, AIX provides only struct stat64, and not struct stat. * lib/sys_stat.in.h (stat): Work with fact that large files on AIX only see struct stat64. Signed-off-by: Eric Blake <ebb9@byu.net>
author Michael Haubenwallner <michael.haubenwallner@salomon.at>
date Fri, 30 Oct 2009 17:00:03 -0600
parents 751d5b272c72
children 1785ef4dfcdf
files ChangeLog lib/sys_stat.in.h
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Oct 30 06:48:14 2009 -0600
+++ b/ChangeLog	Fri Oct 30 17:00:03 2009 -0600
@@ -1,3 +1,9 @@
+2009-10-30  Michael Haubenwallner  <michael.haubenwallner@salomon.at>
+
+	stat: fix compilation on AIX
+	* lib/sys_stat.in.h (stat): Work with fact that large files on AIX
+	only see struct stat64.
+
 2009-10-30  Eric Blake  <ebb9@byu.net>
 
 	exclude: make more robust
--- a/lib/sys_stat.in.h	Fri Oct 30 06:48:14 2009 -0600
+++ b/lib/sys_stat.in.h	Fri Oct 30 17:00:03 2009 -0600
@@ -456,7 +456,15 @@
    struct stat.  This means that rpl_stat will not be used if the user
    does (stat)(a,b).  Oh well.  */
 #  undef stat
-#  define stat(name, st) rpl_stat (name, st)
+#  ifdef _LARGE_FILES
+    /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
+       so we have to replace stat64() instead of stat(). */
+#   define stat stat64
+#   undef stat64
+#   define stat64(name, st) rpl_stat (name, st)
+#  else /* !_LARGE_FILES */
+#   define stat(name, st) rpl_stat (name, st)
+#  endif /* !_LARGE_FILES */
 extern int stat (const char *name, struct stat *buf);
 # endif
 #elif defined GNULIB_POSIXCHECK