From 5f7b97e84c7e2bc7682510e97996ad30147026d0 Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 5 Dec 2020 23:46:08 -0300 Subject: [PATCH] add AddressFamilyNotSupported to SendError --- lib/std/fs/file.zig | 1 + lib/std/os.zig | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/std/fs/file.zig b/lib/std/fs/file.zig index dc7b39eef..e97be007a 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 9fcb764e6..3f63869a1 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), } }