0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-18 10:53:48 +02:00

configure: Add function check for mlock(2), mmap(2).

This commit is contained in:
Jason Volk 2021-03-17 13:09:40 -07:00
parent 047eb1a384
commit c0072f732c
2 changed files with 6 additions and 0 deletions

View file

@ -1167,7 +1167,9 @@ AC_CHECK_FUNCS([ \
backtrace \
fadvise \
madvise \
mlock \
mlock2 \
mmap \
posix_fadvise \
posix_madvise \
preadv2 \

View file

@ -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);