vm: fix mapping of file's last page

thanks @red_prig for investigation
This commit is contained in:
DH 2024-08-31 21:17:02 +03:00
parent ea2915467a
commit e6022c1c4c
6 changed files with 136 additions and 69 deletions

13
rx/include/rx/mem.hpp Normal file
View file

@ -0,0 +1,13 @@
#pragma once
#include <cstddef>
namespace rx::mem {
extern const std::size_t pageSize;
void *map(void *address, std::size_t size, int prot, int flags, int fd = -1,
std::ptrdiff_t offset = 0);
void *reserve(std::size_t size);
bool reserve(void *address, std::size_t size);
bool protect(void *address, std::size_t size, int prot);
bool unmap(void *address, std::size_t size);
} // namespace rx::mem