summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2020-06-22 16:43:26 +0300
committerDmitry Antipov <dmantipov@yandex.ru>2020-06-22 17:16:26 +0300
commit9f0beedd556daabd2ef48e05ead3fdab68598d2a (patch)
tree5757646631283da880ba49304c0bf6ea68821e35 /configure.ac
parentc18782bc91bb028fe206996a7ef0075beabdf067 (diff)
storage/posix, libglusterfs: library function to sync filesystem
Convert an ad-hoc hack to a regular library function gf_syncfs(). Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Change-Id: I3ed93e9f28f22c273df1466ba4a458eacb8df395 Fixes: #1329
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index d24a7b5cee6..c2dc20260bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1037,6 +1037,19 @@ else
CFLAGS=${OLD_CFLAGS}
fi
+AC_CHECK_FUNC([syncfs], [have_syncfs=yes])
+if test "x${have_syncfs}" = "xyes"; then
+ AC_DEFINE(HAVE_SYNCFS, 1, [define if syncfs exists])
+else
+ OLD_CFLAGS=${CFLAGS}
+ CFLAGS="-D_GNU_SOURCE"
+ AC_CHECK_DECL([SYS_syncfs], , , [#include <sys/syscall.h>])
+ if test "x${ac_cv_have_decl_SYS_syncfs}" = "xyes"; then
+ AC_DEFINE(HAVE_SYNCFS_SYS, 1, [define if SYS_syncfs is available])
+ fi
+ CFLAGS=${OLD_CFLAGS}
+fi
+
BUILD_NANOSECOND_TIMESTAMPS=no
AC_CHECK_FUNC([utimensat], [have_utimensat=yes])
if test "x${have_utimensat}" = "xyes"; then