Syscalls: Removes an old workaround for MAP_FIXED_NOREPLACE

We don't support these old kernels, so remove this workaround.
This commit is contained in:
Ryan Houdek committed 2025-08-27 11:52:10 -07:00
1 parent 87db37c65e
commit 5b0709de2f
1 file changed
-8
@@ -740,14 +740,6 @@ uint64_t SyscallHandler::HandleBRK(FEXCore::Core::CpuStateFrame* Frame, void* Ad
NewBRK = (uint64_t)GuestMmap(Frame->Thread, (void*)(DataSpace + DataSpaceMappedSize), AllocateNewSize, PROT_READ | PROT_WRITE,
MAP_FIXED_NOREPLACE | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (!FEX::HLE::HasSyscallError(NewBRK) && NewBRK != (DataSpace + DataSpaceMappedSize)) {
// Couldn't allocate that the region we wanted
// Can happen if MAP_FIXED_NOREPLACE isn't understood by the kernel
int ok = GuestMunmap(Frame->Thread, reinterpret_cast<void*>(NewBRK), AllocateNewSize);
LOGMAN_THROW_A_FMT(ok != -1, "Munmap failed");
NewBRK = ~0ULL;
}
if (FEX::HLE::HasSyscallError(NewBRK)) {
// If we couldn't allocate a new region then out of memory
return DataSpace + DataSpaceSize;