From 10201c11eb406f0d111f0c88c92887ee67562e19 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 4 Sep 2022 21:14:17 -0700 Subject: [PATCH] ircd::fs: Add autoconfs for sync(2) etc. --- configure.ac | 2 ++ ircd/fs.cc | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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 }