Function mlockall [src]

Prototype

pub fn mlockall(flags: MCL) MlockError!void

Parameters

flags: MCL

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 mlockall(flags: MCL) MlockError!void { if (@TypeOf(system.mlockall) == void) @compileError("mlockall not supported on this OS"); return switch (errno(system.mlockall(flags))) { .SUCCESS => {}, .INVAL => unreachable, // bad flags .PERM => error.PermissionDenied, .NOMEM => error.LockedMemoryLimitExceeded, .AGAIN => error.SystemResources, else => |err| unexpectedErrno(err), }; }