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:
parent
047eb1a384
commit
c0072f732c
|
@ -1167,7 +1167,9 @@ AC_CHECK_FUNCS([ \
|
|||
backtrace \
|
||||
fadvise \
|
||||
madvise \
|
||||
mlock \
|
||||
mlock2 \
|
||||
mmap \
|
||||
posix_fadvise \
|
||||
posix_madvise \
|
||||
preadv2 \
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue