From f3c29dcb247be5e50d2d05f9fb2e814ebf115a86 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Wed, 22 Jan 2025 16:24:44 +0100 Subject: [PATCH] std.posix.setsockopt: EOPNOTSUPP can be returned On Linux, set REUSEPORT option on an unix socket returns a EOPNOTSUPP error. See https://github.com/torvalds/linux/commit/5b0af621c3f6ef9261cf6067812f2fd9943acb4b --- lib/std/posix.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/posix.zig b/lib/std/posix.zig index 71d7baa999..94d63cf9ef 100644 --- a/lib/std/posix.zig +++ b/lib/std/posix.zig @@ -6752,6 +6752,7 @@ pub const SetSockOptError = error{ // Setting the socket option requires more elevated permissions. PermissionDenied, + OperationNotSupported, NetworkSubsystemFailed, FileDescriptorNotASocket, SocketNotBound, @@ -6787,6 +6788,7 @@ pub fn setsockopt(fd: socket_t, level: i32, optname: u32, opt: []const u8) SetSo .NOBUFS => return error.SystemResources, .PERM => return error.PermissionDenied, .NODEV => return error.NoDevice, + .OPNOTSUPP => return error.OperationNotSupported, else => |err| return unexpectedErrno(err), } }