Commit 2c5113f6d1

Andrew Kelley <andrew@ziglang.org>
2025-02-04 06:41:12
std.os.linux.mmap: remove logic that does not belong here
1 parent 601f632
Changed files (1)
lib
std
lib/std/os/linux.zig
@@ -899,10 +899,6 @@ pub fn umount2(special: [*:0]const u8, flags: u32) usize {
 
 pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: MAP, fd: i32, offset: i64) usize {
     if (@hasField(SYS, "mmap2")) {
-        // Make sure the offset is also specified in multiples of page size
-        if ((offset & (MMAP2_UNIT - 1)) != 0)
-            return @bitCast(-@as(isize, @intFromEnum(E.INVAL)));
-
         return syscall6(
             .mmap2,
             @intFromPtr(address),