Common/Linux/LnxHostSys: Fixed compatibility issues with FreeBSD, made error

handling more explicit
This commit is contained in:
Master Builder 2022-05-19 14:01:56 +00:00 committed by lightningterror
parent 46a649afc1
commit a26b91291c
1 changed files with 6 additions and 1 deletions

View File

@ -144,7 +144,12 @@ void* HostSys::MmapReservePtr(void* base, size_t size)
// or anonymous source, with PROT_NONE (no-access) permission. Since the mapping
// is completely inaccessible, the OS will simply reserve it and will not put it
// against the commit table.
return mmap(base, size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
void* result = mmap(base, size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
if (result == MAP_FAILED)
result = nullptr;
return result;
}
bool HostSys::MmapCommitPtr(void* base, size_t size, const PageProtectionMode& mode)