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 standard library.
std › Io › Kqueue › posixGetSockName Private Function posixGetSockName Doc Source Private Function std.Io.Kqueue.posixGetSockName
fn posixGetSockName (k : *Kqueue , socket_fd : posix .fd_t , addr : *posix .sockaddr , addr_len : *posix .socklen_t ) !void Params File Io/Kqueue.zig: 1420
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436 fn posixGetSockName (k : *Kqueue , socket_fd : posix .fd_t , addr : *posix .sockaddr , addr_len : *posix .socklen_t ) !void {
while (true ) {
try k .checkCancel ();
switch (posix .errno (posix .system .getsockname (socket_fd , addr , addr_len ))) {
.SUCCESS => break ,
.INTR => continue ,
.CANCELED => return error .Canceled ,
.BADF => |err | return errnoBug (err ), // File descriptor used after closed.
.FAULT => |err | return errnoBug (err ),
.INVAL => |err | return errnoBug (err ), // invalid parameters
.NOTSOCK => |err | return errnoBug (err ), // always a race condition
.NOBUFS => return error .SystemResources ,
else => |err | return posix .unexpectedErrno (err ),
}
}
}