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.

dup2Linux

unistd.dup2Linux
fn dup2Linux(old: c_int, new: c_int) callconv(.c) c_int

File

lib/c/unistd.zig:107

Code

fn dup2Linux(old: c_int, new: c_int) callconv(.c) c_int {
    const busy: usize = @bitCast(-@as(isize, @backingInt(linux.E.BUSY)));
    var res = busy;
    while (res == busy) res = linux.dup2(old, new);
    return errno(res);
}