feature. See also
. The project being documented here (as the example) is the Zig library itself.
Kqueue.posixBind
fn posixBind(
k: *Kqueue,
socket_fd: posix.socket_t,
addr: *const posix.sockaddr,
addr_len: posix.socklen_t,
) !void
File
Code
fn posixBind(
k: *Kqueue,
socket_fd: posix.socket_t,
addr: *const posix.sockaddr,
addr_len: posix.socklen_t,
) !void {
while (true) {
try k.checkCancel();
switch (posix.errno(posix.system.bind(socket_fd, addr, addr_len))) {
.SUCCESS => break,
.INTR => continue,
.CANCELED => return error.Canceled,
.ADDRINUSE => return error.AddressInUse,
.BADF => |err| return errnoBug(err),
.INVAL => |err| return errnoBug(err),
.NOTSOCK => |err| return errnoBug(err),
.AFNOSUPPORT => return error.AddressFamilyUnsupported,
.ADDRNOTAVAIL => return error.AddressUnavailable,
.FAULT => |err| return errnoBug(err),
.NOMEM => return error.SystemResources,
else => |err| return posix.unexpectedErrno(err),
}
}
}