From 6c1c092f079492d359437c76eb5319a0bf20f013 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 2 Mar 2012 02:10:52 +0100 Subject: s3: Test for statfs before statfs64 Autobuild-User: Volker Lendecke Autobuild-Date: Fri Mar 2 12:04:35 CET 2012 on sn-devel-104 --- source3/configure.in | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/source3/configure.in b/source3/configure.in index 6269b4c6d9..937867dc9a 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -5240,6 +5240,26 @@ fi AC_CHECKING(how to get filesystem space usage) space=no +# Perform only the link test since it seems there are no variants of the +# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs) +# because that got a false positive on SCO OSR5. Adding the declaration +# of a `struct statvfs' causes this test to fail (as it should) on such +# systems. That system is reported to work fine with STAT_STATFS4 which +# is what it gets when this test fails. +if test $space = no; then + # SVR4 + AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs, + [AC_TRY_LINK([#include +#include ], + [struct statvfs fsd; statvfs (0, &fsd);], + fu_cv_sys_stat_statvfs=yes, + fu_cv_sys_stat_statvfs=no)]) + if test $fu_cv_sys_stat_statvfs = yes; then + space=yes + AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available]) + fi +fi + # Test for statvfs64. if test $space = no; then # SVR4 @@ -5264,26 +5284,6 @@ if test $space = no; then fi fi -# Perform only the link test since it seems there are no variants of the -# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs) -# because that got a false positive on SCO OSR5. Adding the declaration -# of a `struct statvfs' causes this test to fail (as it should) on such -# systems. That system is reported to work fine with STAT_STATFS4 which -# is what it gets when this test fails. -if test $space = no; then - # SVR4 - AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs, - [AC_TRY_LINK([#include -#include ], - [struct statvfs fsd; statvfs (0, &fsd);], - fu_cv_sys_stat_statvfs=yes, - fu_cv_sys_stat_statvfs=no)]) - if test $fu_cv_sys_stat_statvfs = yes; then - space=yes - AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available]) - fi -fi - # smbd/statvfs.c assumes that statvfs.f_fsid is an integer. # This is not the case on ancient Linux systems. -- cgit