Skip to content

Commit 594366a

Browse files
committed
Fix os.mprotect signature
1 parent d1b6f29 commit 594366a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

std/os.zig

+2-2
Original file line numberDiff line numberDiff line change
@@ -1889,14 +1889,14 @@ pub const MProtectError = error{
18891889
};
18901890

18911891
/// `memory.len` must be page-aligned.
1892-
pub fn mprotect(memory: [*]align(mem.page_size) u8, protection: u32) MProtectError!void {
1892+
pub fn mprotect(memory: []align(mem.page_size) u8, protection: u32) MProtectError!void {
18931893
assert(mem.isAligned(memory.len, mem.page_size));
18941894
switch (errno(system.mprotect(memory.ptr, memory.len, protection))) {
18951895
0 => return,
18961896
EINVAL => unreachable,
18971897
EACCES => return error.AccessDenied,
18981898
ENOMEM => return error.OutOfMemory,
1899-
else => return unexpectedErrno(err),
1899+
else => |err| return unexpectedErrno(err),
19001900
}
19011901
}
19021902

0 commit comments

Comments
 (0)