Commit 03171493 authored by Ramon Nou's avatar Ramon Nou
Browse files

update arm

parent 7db4b597
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Changed 

### Fixed
  - SYS_lstat does not exists on some architectures, change to newfstatat ([!269](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/269))
    - We cannot use lstat directly as may cause a recursion call on libc interception.

## [0.9.5] - 2025-08
### New
+3 −2
Original line number Diff line number Diff line
@@ -107,8 +107,9 @@ get_open_fds() {
    char buffer[buffer_size];

    // Open /proc/self/fd directory using raw syscall
    int dir_fd = syscall_no_intercept_wrapper(SYS_open, "/proc/self/fd",
                                              O_RDONLY | O_DIRECTORY, 0);

    int dir_fd = syscall_no_intercept_wrapper(
            SYS_openat, AT_FDCWD, "/proc/self/fd", O_RDONLY | O_DIRECTORY, 0);
    if(dir_fd < 0) {
        return fds;
    }
+10 −1
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@
extern "C" {
#include <sys/stat.h>
#include <dlfcn.h>
#include <fcntl.h> // Required for AT_FDCWD and AT_SYMLINK_NOFOLLOW
}

using namespace std;
@@ -115,7 +116,15 @@ static char* (*real_realpath)(const char* path, char* resolved_path) = nullptr;
string
follow_symlinks(const string& path) {
    struct stat st{};
    auto res = syscall_no_intercept(SYS_lstat, path.c_str(), &st);
    long res;
// If we are in ARM device just call lstat, not the syscall lstat
#ifdef SYS_lstat
    res = syscall_no_intercept(SYS_lstat, path.c_str(), &st);
#else
    // Modern architectures (ARM64, RISC-V) use fstatat (newfstatat)
    res = syscall_no_intercept(SYS_newfstatat, AT_FDCWD, path.c_str(), &st,
                               AT_SYMLINK_NOFOLLOW);
#endif
    if(res < 0) {
        LOG(DEBUG, "path \"{}\" does not exist", path);
        return path;