From: Michael Haubenwallner Date: Fri, 30 Oct 2009 23:00:03 +0000 (-0600) Subject: stat: fix compilation on AIX X-Git-Tag: v0.1~5268 X-Git-Url: http://erislabs.net/gitweb/?p=gnulib.git;a=commitdiff_plain;h=298d8b4a29e66da0b046b64b822f97d1c8fef74b 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 --- diff --git a/ChangeLog b/ChangeLog index c146bcb53..6cb34dcf3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-30 Michael Haubenwallner + + 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 exclude: make more robust diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index e7cb5eef5..1e46da82a 100644 --- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -456,7 +456,15 @@ int mknodat (int fd, char const *file, mode_t mode, dev_t dev); 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