aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac1
-rw-r--r--src/libutil/util.hh4
2 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 46036113b..f6d983fda 100644
--- a/configure.ac
+++ b/configure.ac
@@ -262,6 +262,7 @@ AC_CHECK_FUNCS([setresuid setreuid lchown])
# Nice to have, but not essential.
AC_CHECK_FUNCS([strsignal])
AC_CHECK_FUNCS([posix_fallocate])
+AC_CHECK_FUNCS([fdatasync])
# This is needed if ATerm or bzip2 are static libraries,
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 837382433..90132da73 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -12,6 +12,10 @@
#include <cstdio>
+#ifndef HAVE_FDATASYNC
+#define fdatasync fsync
+#endif
+
namespace nix {