Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

cleanExit

Indicate intent to terminate with a successful exit code.

In debug builds, this is a no-op, so that the calling code's cleanup mechanisms are tested and so that external tools checking for resource leaks can be accurate. In release builds, this calls exit with code zero, and does not return.

process.cleanExit
pub fn cleanExit(io: Io) void

File

lib/std/process.zig:646

Code

pub fn cleanExit(io: Io) void {
    if (builtin.mode == .debug) return;
    _ = io.lockStderr(&.{}, .no_color) catch {};
    exit(0);
}