From 99403336667db48db89b95a09522569534366bae Mon Sep 17 00:00:00 2001 From: Marco Edoardo Santimaria Date: Thu, 28 Aug 2025 15:12:22 +0000 Subject: [PATCH] riscv readlinkat fixes --- src/posix/utils/filesystem.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/posix/utils/filesystem.hpp b/src/posix/utils/filesystem.hpp index a58297566..47b6ecebc 100644 --- a/src/posix/utils/filesystem.hpp +++ b/src/posix/utils/filesystem.hpp @@ -329,7 +329,9 @@ resolve_possible_symlink(const std::filesystem::path &input_path) { } if (std::filesystem::is_symlink(resolved)) { char buf[PATH_MAX]{0}; - if (capio_syscall(SYS_readlink, resolved.c_str(), buf, sizeof(buf) - 1) == -1) { + auto result = + capio_syscall(SYS_readlinkat, AT_FDCWD, resolved.c_str(), buf, sizeof(buf) - 1); + if (result == -1) { LOG("File might not exist. path was %s and Error is %s", resolved.c_str(), strerror(errno)); continue;