authorgravatar for git@yorhel.nlYorhel <git@yorhel.nl> 2021-04-30 11:29:37+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-04-30 15:08:07+02:00
logf79b487337d7d11ae35fd4a15294c75e23c5f02b
tree26a22356bdf9276559032249bd4e369236cc5669
parent4e07755ce705066cdb4e20feebc5010c7e3e6d12

Handle EPERM and ELOOP in os.fstatat()


1 files changed, 3 insertions(+), 1 deletions(-)

lib/std/os.zig+3-1
......@@ -3419,7 +3419,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat {
34193419 }
34203420}
34213421
3422pub const FStatAtError = FStatError || error{ NameTooLong, FileNotFound };
3422pub const FStatAtError = FStatError || error{ NameTooLong, FileNotFound, SymLinkLoop };
34233423
34243424/// Similar to `fstat`, but returns stat of a resource pointed to by `pathname`
34253425/// which is relative to `dirfd` handle.
......@@ -3466,8 +3466,10 @@ pub fn fstatatZ(dirfd: fd_t, pathname: [*:0]const u8, flags: u32) FStatAtError!S
34663466 EBADF => unreachable, // Always a race condition.
34673467 ENOMEM => return error.SystemResources,
34683468 EACCES => return error.AccessDenied,
3469 EPERM => return error.AccessDenied,
34693470 EFAULT => unreachable,
34703471 ENAMETOOLONG => return error.NameTooLong,
3472 ELOOP => return error.SymLinkLoop,
34713473 ENOENT => return error.FileNotFound,
34723474 ENOTDIR => return error.FileNotFound,
34733475 else => |err| return unexpectedErrno(err),