Commit a3030221c3

Yorhel <git@yorhel.nl>
2022-03-25 07:47:15
std.fs: Handle EINVAL from linux.getdents64
Fixes #11178
1 parent 29c32b3
Changed files (1)
lib
std
lib/std/fs.zig
@@ -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;