diff --git a/lib/std/posix.zig b/lib/std/posix.zig index c07d6e6f0d4fa57f73be3b61c8759d85b067785b..f920784ca54245a131f947ee10a84b34aabf0e4e 100644 --- a/lib/std/posix.zig +++ b/lib/std/posix.zig @@ -1198,6 +1198,10 @@ pub const WriteError = error{ /// This error occurs when a device gets disconnected before or mid-flush /// while it's being written to - errno(6): No such device or address. NoDevice, + + /// The socket type requires that message be sent atomically, and the size of the message + /// to be sent made this impossible. The message is not transmitted. + MessageTooBig, } || UnexpectedError; /// Write to a file descriptor. @@ -1279,6 +1283,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize { .CONNRESET => return error.ConnectionResetByPeer, .BUSY => return error.DeviceBusy, .NXIO => return error.NoDevice, + .MSGSIZE => return error.MessageTooBig, else => |err| return unexpectedErrno(err), } } diff --git a/src/fmt.zig b/src/fmt.zig index a86a4191d1b2e070b6a265d622e5687e604605d7..6b1d73951e03d91e86af67e2b2bfa341c6212f4a 100644 --- a/src/fmt.zig +++ b/src/fmt.zig @@ -202,6 +202,7 @@ const FmtError = error{ DestinationAddressRequired, DiskQuota, FileTooBig, + MessageTooBig, InputOutput, NoSpaceLeft, AccessDenied,