From: Bruno Haible Date: Sun, 24 Jul 2011 10:17:59 +0000 (+0200) Subject: fsusage: Restore previous behaviour on AIX, Cygwin, Interix. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34a0e456e514ba572223248a746ea3aa529b3e1d;p=pspp fsusage: Restore previous behaviour on AIX, Cygwin, Interix. * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Enforce a 64-bit struct statvfs f_blocks field only on MacOS X. --- diff --git a/ChangeLog b/ChangeLog index aba4b49839..37dd892343 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-07-24 Bruno Haible + fsusage: Restore previous behaviour on AIX, Cygwin, Interix. + * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Enforce a 64-bit struct statvfs + f_blocks field only on MacOS X. + fsusage: Support large volumes on glibc/Hurd, HP-UX, Solaris, MacOS X. * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Require AC_SYS_LARGEFILE. * modules/fsusage (Depends-on): Add largefile. diff --git a/m4/fsusage.m4 b/m4/fsusage.m4 index d595c9baa9..c0a6256388 100644 --- a/m4/fsusage.m4 +++ b/m4/fsusage.m4 @@ -62,14 +62,19 @@ a system call. "Do not use Tru64's statvfs implementation" #endif -#include #include -/* Reject implementations, such as MacOS X 10.7, where f_blocks is a - 32-bit quantity; that commonly limits file systems to 4 TiB, a - ridiculously small limit these days. */ struct statvfs fsd; + +#if defined __APPLE__ && defined __MACH__ +#include +/* On MacOS X >= 10.5, f_blocks in 'struct statvfs' is a 32-bit quantity; + that commonly limits file systems to 4 TiB. Whereas f_blocks in + 'struct statfs' is a 64-bit type, thanks to the large-file support + that was enabled above. In this case, don't use statvfs(); use statfs() + instead. */ int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1]; +#endif ]], [[statvfs (0, &fsd);]])], [fu_cv_sys_stat_statvfs=yes],