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{
67526752 // Setting the socket option requires more elevated permissions.
67536753 PermissionDenied,
67546754
6755 OperationNotSupported,
67556756 NetworkSubsystemFailed,
67566757 FileDescriptorNotASocket,
67576758 SocketNotBound,
......@@ -6787,6 +6788,7 @@ pub fn setsockopt(fd: socket_t, level: i32, optname: u32, opt: []const u8) SetSo
67876788 .NOBUFS => return error.SystemResources,
67886789 .PERM => return error.PermissionDenied,
67896790 .NODEV => return error.NoDevice,
6791 .OPNOTSUPP => return error.OperationNotSupported,
67906792 else => |err| return unexpectedErrno(err),
67916793 }
67926794 }