diff --git a/configure.ac b/configure.ac index eb128eec9..d7a4d7b78 100644 --- a/configure.ac +++ b/configure.ac @@ -1382,6 +1382,8 @@ AC_CHECK_FUNCS([ \ pwritev2 \ strlcat \ strlcpy \ + sync \ + syncfs \ ]) AC_SEARCH_LIBS(dlinfo, dl, AC_DEFINE(HAVE_DLINFO, 1, [Define if you have dlinfo])) diff --git a/ircd/fs.cc b/ircd/fs.cc index 0a8d6e0b2..06bf0b03a 100644 --- a/ircd/fs.cc +++ b/ircd/fs.cc @@ -700,10 +700,12 @@ ircd::fs::sync(const fd &fd, "fs::sync(fd:%d)", int(fd) }; - #ifdef __linux__ + #if defined(HAVE_SYNCFS) syscall(::syncfs, fd); - #else + #elif defined(HAVE_SYNC) syscall(::sync); + #else + #error "Missing sync(2) on this platform." #endif }