aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorLuna <git@l4.pm>2020-12-05 23:46:08 -0300
committerAndrew Kelley <andrew@ziglang.org>2020-12-07 16:40:03 -0500
commit5f7b97e84c7e2bc7682510e97996ad30147026d0 (patch)
treebe01c06e770f020dcf612b69806ef42a843cb7ed /lib/std
parent5c60558796715c109ddbe12472fe5692029736b2 (diff)
downloadzig-5f7b97e84c7e2bc7682510e97996ad30147026d0.tar.gz
zig-5f7b97e84c7e2bc7682510e97996ad30147026d0.zip
add AddressFamilyNotSupported to SendError
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/fs/file.zig1
-rw-r--r--lib/std/os.zig7
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/std/fs/file.zig b/lib/std/fs/file.zig
index dc7b39eef1..e97be007ab 100644
--- a/lib/std/fs/file.zig
+++ b/lib/std/fs/file.zig
@@ -698,6 +698,7 @@ pub const File = struct {
error.FastOpenAlreadyInProgress,
error.MessageTooBig,
error.FileDescriptorNotASocket,
+ error.AddressFamilyNotSupported,
=> return self.writeFileAllUnseekable(in_file, args),
else => |e| return e,
diff --git a/lib/std/os.zig b/lib/std/os.zig
index 9fcb764e68..3f63869a1a 100644
--- a/lib/std/os.zig
+++ b/lib/std/os.zig
@@ -2711,7 +2711,6 @@ pub const ShutdownError = error{
/// Connection was reset by peer, application should close socket as it is no longer usable.
ConnectionResetByPeer,
-
BlockingOperationInProgress,
/// The network subsystem has failed.
@@ -2719,8 +2718,7 @@ pub const ShutdownError = error{
/// The socket is not connected (connection-oriented sockets only).
SocketNotConnected,
-
- SystemResources
+ SystemResources,
} || UnexpectedError;
pub const ShutdownHow = enum { recv, send, both };
@@ -4776,6 +4774,7 @@ pub const SendError = error{
BrokenPipe,
FileDescriptorNotASocket,
+ AddressFamilyNotSupported,
} || UnexpectedError;
/// Transmit a message to another socket.
@@ -4822,6 +4821,7 @@ pub fn sendto(
.WSAEMSGSIZE => return error.MessageTooBig,
.WSAENOBUFS => return error.SystemResources,
.WSAENOTSOCK => return error.FileDescriptorNotASocket,
+ .WSAEAFNOSUPPORT => return error.AddressFamilyNotSupported,
// TODO: handle more errors
else => |err| return windows.unexpectedWSAError(err),
}
@@ -4849,6 +4849,7 @@ pub fn sendto(
ENOTSOCK => unreachable, // The file descriptor sockfd does not refer to a socket.
EOPNOTSUPP => unreachable, // Some bit in the flags argument is inappropriate for the socket type.
EPIPE => return error.BrokenPipe,
+ EAFNOSUPPORT => return error.AddressFamilyNotSupported,
else => |err| return unexpectedErrno(err),
}
}