From 39a89fa0a214671ed696634862423a18ebfd90c9 Mon Sep 17 00:00:00 2001 From: OBATA Akio Date: Mon, 15 Apr 2019 18:02:32 +0900 Subject: Change and simplify `statvfs` conditions in FileSystemStats `getfsstat` v.s. `getvfsstat` condition is different than `statfs` v.s. `statvfs`, so split each condition and simplify. For `get(v)fsstat` side, changed to check and use `getmntinfo`, because it is better than `get(v)fsstat` with fixed buffer size, and easier than improve it with dynamic buffer allocation. Signed-off-by: OBATA Akio (cherry picked from commit d349995488a13687171a67efd981e986b3b703e5) --- ConfigureChecks.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ConfigureChecks.cmake') diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 1b48407..148884c 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -155,6 +155,20 @@ if ( BUILD_KSIM ) check_include_file( "sys/loadavg.h" HAVE_SYS_LOADAVG_H ) check_function_exists( getloadavg HAVE_GETLOADAVG ) + check_function_exists( statfs HAVE_STATFS ) + check_function_exists( statvfs HAVE_STATVFS ) + check_function_exists( getmntinfo HAVE_GETMNTINFO ) + if( HAVE_GETMNTINFO ) + check_cxx_source_compiles(" + #include + #include + int main(){ + struct statvfs *mntbufp; + int flags; + return getmntinfo(&mntbufp, flags); + }" + GETMNTINFO_USES_STATVFS ) + endif( HAVE_GETMNTINFO ) check_c_source_compiles( "#include -- cgit v1.2.1