motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit ec7adeda2b06e6cc3a453b8e2487a5a3516ed488 (tree)
parent 83fad7d4f79314b14445542907a259ee1e57d10a
Author: Robin Voetter <robin@voetter.nl>
Date:   Fri,  8 Jan 2021 01:36:08 +0100

Add EPERM to std.os.setsockopt

Diffstat:
Mlib/std/os.zig | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/std/os.zig b/lib/std/os.zig @@ -5482,6 +5482,9 @@ pub const SetSockOptError = error{ /// Insufficient resources are available in the system to complete the call. SystemResources, + // Setting the socket option requires more elevated permissions. + PermissionDenied, + NetworkSubsystemFailed, FileDescriptorNotASocket, SocketNotBound, @@ -5514,6 +5517,7 @@ pub fn setsockopt(fd: socket_t, level: u32, optname: u32, opt: []const u8) SetSo ENOPROTOOPT => return error.InvalidProtocolOption, ENOMEM => return error.SystemResources, ENOBUFS => return error.SystemResources, + EPERM => return error.PermissionDenied, else => |err| return unexpectedErrno(err), } }