X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffsusage.c;h=0657555f44d17805e7c90d8e4d6d5ae41296522a;hb=23eecb48e39afd0d267d64d40ba6bf97aa865e13;hp=e273889e3f1013bc81bd0c3777f81d61c24cb5cb;hpb=defe57376249c1385b2874b43307e4c686a1d38c;p=gnulib.git diff --git a/lib/fsusage.c b/lib/fsusage.c index e273889e3..0657555f4 100644 --- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -1,6 +1,6 @@ /* fsusage.c -- return space usage of mounted file systems - Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2012 Free Software + Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -31,6 +31,15 @@ # include # include # include +#if HAVE_SYS_PARAM_H +# include +#endif +#if HAVE_SYS_MOUNT_H +# include +#endif +#if HAVE_SYS_VFS_H +# include +#endif # if HAVE_SYS_FS_S5PARAM_H /* Fujitsu UXP/V */ # include # endif @@ -46,18 +55,6 @@ # include "full-read.h" #endif -/* These files are needed for 2.6 < glibc/Linux < 2.6.36, even though - it has statvfs, because they are used by the fallback. */ -#if HAVE_SYS_PARAM_H -# include -#endif -#if HAVE_SYS_MOUNT_H -# include -#endif -#if HAVE_SYS_VFS_H -# include -#endif - /* The results of open() in this file are not used with fchdir, therefore save some unnecessary work in fchdir.c. */ #undef open @@ -93,6 +90,8 @@ preceding entries in /proc/mounts; that makes df hang if even one of the corresponding file systems is hard-mounted but not available. */ # if ! (__linux__ && (__GLIBC__ || __UCLIBC__)) +/* The FRSIZE fallback is not required in this case. */ +# undef STAT_STATFS2_FRSIZE static int statvfs_works (void) { return 1; } # else # include /* for strverscmp */ @@ -287,8 +286,9 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp) #endif -#if (defined STAT_STATVFS64 \ - || (!defined STAT_STATFS2_FS_DATA && !defined STAT_READ_FILSYS)) +#if (defined STAT_STATVFS64 || defined STAT_STATFS3_OSF1 \ + || defined STAT_STATFS2_FRSIZE || defined STAT_STATFS2_BSIZE \ + || defined STAT_STATFS2_FSIZE || defined STAT_STATFS4) fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.f_blocks); fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.f_bfree);