std.fs: Handle EINVAL from linux.getdents64

Fixes #11178
This commit is contained in:
Yorhel 2022-03-25 07:47:15 +01:00 committed by Veikka Tuominen
parent 29c32b3dc5
commit a3030221c3

View File

@ -605,7 +605,7 @@ pub const Dir = struct {
.BADF => unreachable, // Dir is invalid or was opened without iteration ability
.FAULT => unreachable,
.NOTDIR => unreachable,
.INVAL => unreachable,
.INVAL => return error.Unexpected, // Linux may in some cases return EINVAL when reading /proc/$PID/net.
else => |err| return os.unexpectedErrno(err),
}
if (rc == 0) return null;