From eda39b870b7a8492713ff9ed649c9d4b7fb42968 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 16 Aug 2003 08:28:42 +0000 Subject: [PATCH] [__GLIBC__]: GNU libc's statvfs stats each mount point in /proc/mounts until it finds one with matching device number. This is unnecessary when the FILE argument *is* a mount point. No stat call is necessary in that case. So, disable the statvfs-testing code on systems with GNU libc. Reported by Andrei Gaponenko via Tim Waugh as RedHat bug# 84846. --- m4/fsusage.m4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/m4/fsusage.m4 b/m4/fsusage.m4 index 018563bdb9..a0ab1e15f3 100644 --- a/m4/fsusage.m4 +++ b/m4/fsusage.m4 @@ -1,4 +1,4 @@ -#serial 10 +#serial 11 # From fileutils/configure.in @@ -35,6 +35,11 @@ if test $ac_fsusage_space = no; then # SVR4 AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs, [AC_TRY_LINK([#include +#ifdef __GLIBC__ +Do not use statvfs on systems with GNU libc, because that function stats +all preceding entries in /proc/mounts, and that makes df hang if even +one of the corresponding file systems is hard-mounted, but not available. +#endif #include ], [struct statvfs fsd; statvfs (0, &fsd);], fu_cv_sys_stat_statvfs=yes, -- 2.30.2