mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
Add ioctl errors
This commit is contained in:
parent
2c641c93da
commit
901aab8761
@ -533,7 +533,18 @@ fn if_nametoindex(name: []const u8) !u32 {
|
||||
@ptrToInt(&ifr),
|
||||
);
|
||||
|
||||
return ifr.ifr_ifru.ifru_ivalue;
|
||||
switch (os.errno(rc)) {
|
||||
os.EBADF => return error.BadFile,
|
||||
os.EINTR => return error.CaughtSignal,
|
||||
os.EINVAL => unreachable,
|
||||
os.EIO => return error.FileSystem,
|
||||
os.ENOTTY => unreachable,
|
||||
os.ENXIO => unreachable,
|
||||
os.ENODEV => return error.Unsupported,
|
||||
else => {},
|
||||
}
|
||||
|
||||
return @bitCast(u32, ifr.ifr_ifru.ifru_ivalue);
|
||||
}
|
||||
|
||||
pub const AddressList = struct {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user