From: Paul Eggert Date: Fri, 22 Jul 2011 17:07:18 +0000 (-0700) Subject: fsusage: port to MacOS X 10.7 with 4 TiB file systems X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64f62ee592856b418fa3e23c584796beac537af4;p=pspp fsusage: port to MacOS X 10.7 with 4 TiB file systems * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Reject statvfs implementations that use only 32 bits to count blocks. On typical hosts with 1024-byte blocks, this fails with file systems as small as 4 TiB. Problem reported by Herb Wartens and this should also fix a similar problem reported by Tim Spriggs . --- diff --git a/ChangeLog b/ChangeLog index 793368b0ed..4a66446284 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2011-07-22 Paul Eggert + fsusage: port to MacOS X 10.7 with 4 TiB file systems + * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Reject statvfs + implementations that use only 32 bits to count blocks. + On typical hosts with 1024-byte blocks, this fails with file + systems as small as 4 TiB. Problem reported by Herb Wartens + and this should also fix a similar + problem reported by Tim Spriggs . + large-inode: New module * MODULES.html.sh: Add it. * modules/large-inode, m4/large-inode.m4: New files. diff --git a/m4/fsusage.m4 b/m4/fsusage.m4 index 3459e63b37..41c06bc9e8 100644 --- a/m4/fsusage.m4 +++ b/m4/fsusage.m4 @@ -40,7 +40,7 @@ ac_fsusage_space=no # systems. That system is reported to work fine with STAT_STATFS4 which # is what it gets when this test fails. if test $ac_fsusage_space = no; then - # glibc/{Hurd,kFreeBSD}, MacOS X >= 10.4, FreeBSD >= 5.0, NetBSD >= 3.0, + # glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0, # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS. AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include @@ -56,8 +56,16 @@ a system call. "Do not use Tru64's statvfs implementation" #endif -#include ]], - [[struct statvfs fsd; statvfs (0, &fsd);]])], +#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; +int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1]; +]], + [[statvfs (0, &fsd);]])], [fu_cv_sys_stat_statvfs=yes], [fu_cv_sys_stat_statvfs=no])]) if test $fu_cv_sys_stat_statvfs = yes; then @@ -94,8 +102,8 @@ if test $ac_fsusage_space = no; then fi if test $ac_fsusage_space = no; then - # glibc/Linux, MacOS X < 10.4, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4. - # (glibc/{Hurd,kFreeBSD}, MacOS X >= 10.4, FreeBSD >= 5.0, NetBSD >= 3.0, + # glibc/Linux, MacOS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4. + # (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0, # OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.) # (On IRIX you need to include , not only and # .)