Loading src/client/gkfs_libc.cpp +24 −4 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ std::atomic<bool> initializing{false}; */ // Define a debug macro, can be easily disabled // #define GKFS_TRACE #define GKFS_TRACE // #define PATH_SHORTCUT #ifdef GKFS_DEBUG_BUILD Loading Loading @@ -280,9 +280,12 @@ DLSYM_WRAPPER(int, xstat64, (int ver, const char* path, struct stat64* buf), (ver, path, buf), "__xstat64") DLSYM_WRAPPER(int, fxstat64, (int ver, int fd, struct stat64* buf), (ver, fd, buf), "__fxstat64") DLSYM_WRAPPER(int, lstat, (int ver, const char* path, struct stat* buf), DLSYM_WRAPPER(int, __lxstat, (int ver, const char* path, struct stat* buf), (ver, path, buf), "__lxstat") DLSYM_WRAPPER(int, lstat, (const char* path, struct stat* buf), (path, buf), "lstat") DLSYM_WRAPPER(int, lstat64, (const char* path, struct stat64* buf), (path, buf), "lstat64") Loading Loading @@ -994,7 +997,7 @@ __lxstat(int ver, const char* path, struct stat* buf) { } } } GKFS_FALLBACK(lstat, ver, path, buf); GKFS_FALLBACK(__lxstat, ver, path, buf); } int Loading Loading @@ -2153,6 +2156,20 @@ llistxattr(const char* path, char* list, size_t size) { GKFS_FALLBACK(llistxattr, path, list, size); } int lstat(const char* path, struct stat* st) { initializeGekko(); if(CTX->interception_enabled()) { std::string resolved; if(resolve_gkfs_path(AT_FDCWD, path, resolved, 0, false) == PathStatus::Internal) { DEBUG_INFO("[GKFS] {}", resolved); auto res = gkfs::syscall::gkfs_stat(resolved, st, false); return res; } } GKFS_FALLBACK(lstat, path, st); } int lstat64(const char* path, struct stat64* buf) { Loading Loading @@ -2556,3 +2573,6 @@ renameat2(int olddirfd, const char* oldpath, int newdirfd, const char* newpath, } GKFS_FALLBACK(renameat2, olddirfd, oldpath, newdirfd, newpath, flags); } Loading
src/client/gkfs_libc.cpp +24 −4 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ std::atomic<bool> initializing{false}; */ // Define a debug macro, can be easily disabled // #define GKFS_TRACE #define GKFS_TRACE // #define PATH_SHORTCUT #ifdef GKFS_DEBUG_BUILD Loading Loading @@ -280,9 +280,12 @@ DLSYM_WRAPPER(int, xstat64, (int ver, const char* path, struct stat64* buf), (ver, path, buf), "__xstat64") DLSYM_WRAPPER(int, fxstat64, (int ver, int fd, struct stat64* buf), (ver, fd, buf), "__fxstat64") DLSYM_WRAPPER(int, lstat, (int ver, const char* path, struct stat* buf), DLSYM_WRAPPER(int, __lxstat, (int ver, const char* path, struct stat* buf), (ver, path, buf), "__lxstat") DLSYM_WRAPPER(int, lstat, (const char* path, struct stat* buf), (path, buf), "lstat") DLSYM_WRAPPER(int, lstat64, (const char* path, struct stat64* buf), (path, buf), "lstat64") Loading Loading @@ -994,7 +997,7 @@ __lxstat(int ver, const char* path, struct stat* buf) { } } } GKFS_FALLBACK(lstat, ver, path, buf); GKFS_FALLBACK(__lxstat, ver, path, buf); } int Loading Loading @@ -2153,6 +2156,20 @@ llistxattr(const char* path, char* list, size_t size) { GKFS_FALLBACK(llistxattr, path, list, size); } int lstat(const char* path, struct stat* st) { initializeGekko(); if(CTX->interception_enabled()) { std::string resolved; if(resolve_gkfs_path(AT_FDCWD, path, resolved, 0, false) == PathStatus::Internal) { DEBUG_INFO("[GKFS] {}", resolved); auto res = gkfs::syscall::gkfs_stat(resolved, st, false); return res; } } GKFS_FALLBACK(lstat, path, st); } int lstat64(const char* path, struct stat64* buf) { Loading Loading @@ -2556,3 +2573,6 @@ renameat2(int olddirfd, const char* oldpath, int newdirfd, const char* newpath, } GKFS_FALLBACK(renameat2, olddirfd, oldpath, newdirfd, newpath, flags); }