Function munlock [src]

Prototype

pub fn munlock(memory: []align(page_size_min) const u8) MlockError!void

Parameters

memory: []align(page_size_min) const u8

Possible Errors

LockedMemoryLimitExceeded
PermissionDenied
SystemResources
Unexpected UnexpectedError

The Operating System returned an undocumented error code.

This error is in theory not possible, but it would be better to handle this error than to invoke undefined behavior.

When this error code is observed, it usually means the Zig Standard Library needs a small patch to add the error code to the error set for the respective function.

Source

pub fn munlock(memory: []align(page_size_min) const u8) MlockError!void { if (@TypeOf(system.munlock) == void) @compileError("munlock not supported on this OS"); return switch (errno(system.munlock(memory.ptr, memory.len))) { .SUCCESS => {}, .INVAL => unreachable, // unaligned or runs off end of addr space .PERM => return error.PermissionDenied, .NOMEM => return error.LockedMemoryLimitExceeded, .AGAIN => return error.SystemResources, else => |err| unexpectedErrno(err), }; }