respect mmap_min_addr

This commit is contained in:
2025-12-03 13:12:28 +01:00
parent 673ad2a33b
commit 114157ccb7

View File

@@ -53,6 +53,9 @@ pub fn main() !void {
// Initialize patcher
patcher = try Patcher.init(std.heap.page_allocator); // TODO: allocator
// Block the first 64k to avoid mmap_min_addr (EPERM) issues on Linux.
// TODO: read it from `/proc/sys/vm/mmap_min_addr` instead.
try patcher.address_allocator.block(patcher.gpa, .{ .start = 0, .end = 0x10000 }, 0);
// Map file into memory
const file = try lookupFile(mem.sliceTo(std.os.argv[arg_index], 0));