Function setsid [src]

Prototype

pub fn setsid() SetSidError!pid_t

Possible Errors

PermissionDenied

The calling process is already a process group leader, or the process group ID of a process other than the calling process matches the process ID of the calling process.

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 setsid() SetSidError!pid_t { const rc = system.setsid(); switch (errno(rc)) { .SUCCESS => return rc, .PERM => return error.PermissionDenied, else => |err| return unexpectedErrno(err), } }