0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-14 00:34:18 +01:00

ircd::fs: Support anonymous non-descript mapping.

This commit is contained in:
Jason Volk 2022-03-05 12:22:20 -08:00
parent e68b93fa61
commit af4d722ec3

View file

@ -2049,6 +2049,7 @@ ircd::fs::map::map(const fd &fd,
const size_t &size)
#if defined(HAVE_MMAP)
{
assert(size || int(fd) > -1);
const auto map_size
{
size?: fs::size(fd)
@ -2061,7 +2062,7 @@ ircd::fs::map::map(const fd &fd,
nullptr,
map_size,
prot(opts),
flags(opts),
flags(opts) | (int(fd) == -1? MAP_ANONYMOUS : 0),
int(fd),
opts.offset
)