diff --git a/configure.ac b/configure.ac index 414208da4..45948110c 100644 --- a/configure.ac +++ b/configure.ac @@ -1167,7 +1167,9 @@ AC_CHECK_FUNCS([ \ backtrace \ fadvise \ madvise \ + mlock \ mlock2 \ + mmap \ posix_fadvise \ posix_madvise \ preadv2 \ diff --git a/ircd/fs.cc b/ircd/fs.cc index 5fe291d6c..8938c9aa5 100644 --- a/ircd/fs.cc +++ b/ircd/fs.cc @@ -2061,10 +2061,14 @@ ircd::fs::map::map(const fd &fd, size?: fs::size(fd) }; + #ifdef HAVE_MMAP void *const &ptr { ::mmap(nullptr, map_size, prot(opts), flags(opts), int(fd), opts.offset) }; + #else + #error "Missing ::mmap(2) on this platform." + #endif if(unlikely(ptr == MAP_FAILED)) throw_system_error(errno);