fix: Fix fstatat by passing O_PATH when calling openat2

This commit is contained in:
Ibuki.O
2026-05-20 12:11:11 +09:00
parent b07babc03c
commit 0e2f24125a
+1 -1
View File
@@ -480,7 +480,7 @@ impl Pal for Sys {
}
}
let file = openat2(dirfd, path, flags, 0)?;
let file = openat2(dirfd, path, flags, fcntl::O_PATH)?;
// Close the file descriptor after fstat(2) regardless of success or failure.
let fstat_res = unsafe { libredox::fstat(*file as usize, buf.as_mut_ptr()) };
let close_res = syscall::close(*file as usize);