authorgravatar for pierre@lightpanda.ioPierre Tachoire <pierre@lightpanda.io> 2025-01-22 16:24:44+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-01-23 14:35:57+01:00
logf3c29dcb247be5e50d2d05f9fb2e814ebf115a86
tree3ee479584001c4d3b5237b297af0eff617c31d85
parent530335b572da5821bd438e2e68febd391502c668

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

1 files changed, 2 insertions(+), 0 deletions(-)

lib/std/posix.zig+2
...@@ -6752,6 +6752,7 @@ pub const SetSockOptError = error{...@@ -6752,6 +6752,7 @@ pub const SetSockOptError = error{
6752 // Setting the socket option requires more elevated permissions.6752 // Setting the socket option requires more elevated permissions.
6753 PermissionDenied,6753 PermissionDenied,
67546754
6755 OperationNotSupported,
6755 NetworkSubsystemFailed,6756 NetworkSubsystemFailed,
6756 FileDescriptorNotASocket,6757 FileDescriptorNotASocket,
6757 SocketNotBound,6758 SocketNotBound,
...@@ -6787,6 +6788,7 @@ pub fn setsockopt(fd: socket_t, level: i32, optname: u32, opt: []const u8) SetSo...@@ -6787,6 +6788,7 @@ pub fn setsockopt(fd: socket_t, level: i32, optname: u32, opt: []const u8) SetSo
6787 .NOBUFS => return error.SystemResources,6788 .NOBUFS => return error.SystemResources,
6788 .PERM => return error.PermissionDenied,6789 .PERM => return error.PermissionDenied,
6789 .NODEV => return error.NoDevice,6790 .NODEV => return error.NoDevice,
6791 .OPNOTSUPP => return error.OperationNotSupported,
6790 else => |err| return unexpectedErrno(err),6792 else => |err| return unexpectedErrno(err),
6791 }6793 }
6792 }6794 }