Add ioctl errors
parent
2c641c93da
commit
901aab8761
|
@ -533,7 +533,18 @@ fn if_nametoindex(name: []const u8) !u32 {
|
||||||
@ptrToInt(&ifr),
|
@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 {
|
pub const AddressList = struct {
|
||||||
|
|
Loading…
Reference in New Issue