# HG changeset patch # User Bruno Haible # Date 1311502679 -7200 # Node ID 80fc7c769d16580e568cfcd7c66b7162ee8a159e # Parent 103270df56db96ba9653f7912bdeec70f51f9143 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 --- 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 --- a/m4/fsusage.m4 +++ b/m4/fsusage.m4 @@ -62,14 +62,19 @@ "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],