Add AFNOSUPPORT error to bind (#12560)

This commit is contained in:
John Schmidt
2022-09-01 22:13:07 +02:00
committed by GitHub
parent 7c91a6fe48
commit 36f4f32fad

View File

@@ -3447,6 +3447,9 @@ pub const BindError = error{
/// A nonexistent interface was requested or the requested address was not local.
AddressNotAvailable,
/// The address is not valid for the address family of socket.
AddressFamilyNotSupported,
/// Too many symbolic links were encountered in resolving addr.
SymLinkLoop,
@@ -3502,6 +3505,7 @@ pub fn bind(sock: socket_t, addr: *const sockaddr, len: socklen_t) BindError!voi
.BADF => unreachable, // always a race condition if this error is returned
.INVAL => unreachable, // invalid parameters
.NOTSOCK => unreachable, // invalid `sockfd`
.AFNOSUPPORT => return error.AddressFamilyNotSupported,
.ADDRNOTAVAIL => return error.AddressNotAvailable,
.FAULT => unreachable, // invalid `addr` pointer
.LOOP => return error.SymLinkLoop,