std.posix.setsockopt: EOPNOTSUPP can be returned

On Linux, set REUSEPORT option on an unix socket returns a EOPNOTSUPP
error.
See 5b0af621c3
This commit is contained in:
Pierre Tachoire 2025-01-22 16:24:44 +01:00 committed by Alex Rønne Petersen
parent 530335b572
commit f3c29dcb24

View File

@ -6752,6 +6752,7 @@ pub const SetSockOptError = error{
// Setting the socket option requires more elevated permissions. // Setting the socket option requires more elevated permissions.
PermissionDenied, PermissionDenied,
OperationNotSupported,
NetworkSubsystemFailed, NetworkSubsystemFailed,
FileDescriptorNotASocket, FileDescriptorNotASocket,
SocketNotBound, SocketNotBound,
@ -6787,6 +6788,7 @@ pub fn setsockopt(fd: socket_t, level: i32, optname: u32, opt: []const u8) SetSo
.NOBUFS => return error.SystemResources, .NOBUFS => return error.SystemResources,
.PERM => return error.PermissionDenied, .PERM => return error.PermissionDenied,
.NODEV => return error.NoDevice, .NODEV => return error.NoDevice,
.OPNOTSUPP => return error.OperationNotSupported,
else => |err| return unexpectedErrno(err), else => |err| return unexpectedErrno(err),
} }
} }