From a3030221c3bb3f3d59cedc6db83c679470fca417 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Fri, 25 Mar 2022 07:47:15 +0100 Subject: [PATCH] std.fs: Handle EINVAL from linux.getdents64 Fixes #11178 --- lib/std/fs.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/fs.zig b/lib/std/fs.zig index 7a41bdf6a1..73efccbbfc 100644 --- a/lib/std/fs.zig +++ b/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;