From c04d9d48f11777ee65f80f1d7c859b94f7bda24c Mon Sep 17 00:00:00 2001 From: rnou Date: Fri, 30 May 2025 16:24:38 +0200 Subject: [PATCH 1/5] include/client/gkfs_libc.hpp --- include/client/gkfs_libc.hpp | 164 +++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) diff --git a/include/client/gkfs_libc.hpp b/include/client/gkfs_libc.hpp index 0436fb058..36339b57d 100644 --- a/include/client/gkfs_libc.hpp +++ b/include/client/gkfs_libc.hpp @@ -69,6 +69,170 @@ struct __dirstream { char data[1] __attribute__((aligned(__alignof__(void*)))); }; // Originally its 0, but C++ does not permit it + +//------------------------- File I/O Operations ------------------------------// + +int open(const char* path, int flags, ...); +int open64(const char* path, int flags, ...); +int openat(int dirfd, const char* path, int flags, ...); +int openat64(int dirfd, const char* path, int flags, ...); // Note: Implemented via openat in source +int creat(const char* path, mode_t mode); +int close(int fd); +int close_range(unsigned int low, unsigned int high, int flags); +ssize_t read(int fd, void* buf, size_t nbyte); +ssize_t write(int fd, const void* buf, size_t nbyte); +ssize_t pread(int fd, void* buf, size_t count, off_t offset); +ssize_t pwrite(int fd, const void* buf, size_t count, off_t offset); +ssize_t pread64(int fd, void* buf, size_t count, off64_t offset); +ssize_t pwrite64(int fd, const void* buf, size_t count, off64_t offset); +ssize_t readv(int fd, const struct iovec* iov, int iovcnt); +ssize_t writev(int fd, const struct iovec* iov, int iovcnt); +ssize_t preadv(int fd, const struct iovec* iov, int iovcnt, off_t offset); +ssize_t pwritev(int fd, const struct iovec* iov, int iovcnt, off_t offset); +ssize_t preadv2(int fd, const struct iovec* iov, int iovcnt, off_t offset, int flags); +ssize_t pwritev2(int fd, const struct iovec* iov, int iovcnt, off_t offset, int flags); +off_t lseek(int fd, off_t offset, int whence); +off64_t lseek64(int fd, off64_t offset, int whence); +int ftruncate(int fd, off_t length); +int fsync(int fd); +int flock(int fd, int operation); + +//------------------------- Stat / Metadata Operations -------------------------// + +int stat(const char* path, struct stat* buf); +int stat64(const char* path, struct stat64* buf); // Note: Source uses __xstat64 symbol +int lstat(const char* path, struct stat* st); +int lstat64(const char* path, struct stat64* buf); +int fstat(int fd, struct stat* buf); +int fstat64(int fd, struct stat64* buf); +int fstatat(int dfd, const char* path, struct stat* buf, int flags); +int fstatat64(int dfd, const char* path, struct stat64* buf, int flags); +int statx(int dirfd, const char* path, int flags, unsigned int mask, struct statx* statxbuf); + +#ifdef GKFS_ENABLE_UNUSED_FUNCTIONS // __xstat variants often used by glibc internals +int __xstat(int ver, const char* path, struct stat* buf); +int __xstat64(int ver, const char* path, struct stat64* buf); +int __lxstat(int ver, const char* path, struct stat* buf); +int __lxstat64(int ver, const char* path, struct stat64* buf); +int __fxstat(int ver, int fd, struct stat* buf); +int __fxstatat(int ver, int dfd, const char* path, struct stat* buf, int flags); +int __fxstat64(int ver, int fd, struct stat64* buf); +#endif + +//------------------------- Directory Operations -----------------------------// + +int mkdir(const char* path, mode_t mode); +int mkdirat(int dirfd, const char* path, mode_t mode); +int rmdir(const char* path); +DIR* opendir(const char* dirname); +DIR* opendir64(const char* dirname); +DIR* fdopendir(int fd); + +// For scandir filter and compar function pointer types +typedef int (*scandir_filter_func_t)(const struct dirent*); +typedef int (*scandir_compar_func_t)(const struct dirent**, const struct dirent**); +// Note: Original source uses `typeof` (GNU extension) for filter/compar in scandir. +// Using standard function pointer typedefs here for better portability. + +struct dirent* readdir(DIR* dirp); +struct dirent64* readdir64(DIR* dirp); +int closedir(DIR* dirp); +void seekdir(DIR* dirp, long loc); +long telldir(DIR* dirp); +void rewinddir(DIR* dirstream); +int scandir(const char* dirname, struct dirent*** namelist, + scandir_filter_func_t filter, + scandir_compar_func_t compar); + +//------------------------- Path Operations ----------------------------------// + +int remove(const char* path); +int unlink(const char* path); +int rename(const char* oldpath, const char* newpath); +int renameat(int olddirfd, const char* oldpath, int newdirfd, const char* newpath); +int renameat2(int olddirfd, const char* oldpath, int newdirfd, const char* newpath, unsigned int flags); +int symlink(const char* target_path, const char* link_path); // POSIX: target, linkpath +int symlinkat(const char* target_path, int newdirfd, const char* link_path); + +#ifdef HAS_SYMLINKS +ssize_t readlink(const char* path, char* buf, size_t bufsize); +ssize_t readlinkat(int dfd, const char* path, char* buf, size_t bufsize); +#endif + +char* realpath(const char* path, char* resolved_path); +char* __realpath_chk(const char* path, char* resolved_path, size_t resolved_len); // GNU Fortify Source variant +int access(const char* path, int mode); +int faccessat(int dfd, const char* path, int mode, int flags); +int chdir(const char* path); +int fchdir(int fd); +char* getcwd(char* buffer, size_t size); + +//------------------------- Permissions --------------------------------------// + +int chmod(const char* path, mode_t mode); +int fchmod(int fd, mode_t mode); +int fchmodat(int dfd, const char* path, mode_t mode, int flags); +int chown(const char* path, uid_t owner, gid_t group); +int fchown(int fd, uid_t owner, gid_t group); + +//------------------------- Process and Descriptor Management ------------------// + +int dup(int fd); +int dup2(int oldfd, int newfd); +int dup3(int oldfd, int newfd, int flags); +int fcntl(int fd, int cmd, ...); + +#ifdef GKFS_ENABLE_UNUSED_FUNCTIONS +void exit(int status); // Note: This function does not return. +int pipe(int pipefd[2]); +#endif + +//------------------------- C Standard I/O (FILE*) ---------------------------// + +FILE* fopen(const char* path, const char* mode); +FILE* fdopen(int fd, const char* mode); +FILE* freopen64(const char* path, const char* mode, FILE* stream); // Note: Source uses "freopen" symbol +int fclose(FILE* stream); +size_t fread(void* ptr, size_t size, size_t nmemb, FILE* stream); +size_t fwrite(const void* ptr, size_t size, size_t nmemb, FILE* stream); +int fseek(FILE* stream, long int offset, int whence); +long ftell(FILE* stream); +void rewind(FILE* stream); +int feof(FILE* stream); +void clearerr(FILE* stream); +int fputs(const char* str, FILE* stream); +char* fgets(char* str, int n, FILE* stream); +int fflush(FILE* stream); + +//------------------------- AIO Operations -----------------------------------// + +int aio_read(struct aiocb* aiocbp); +int aio_write(struct aiocb* aiocbp); +int aio_error(const struct aiocb* aiocbp); +ssize_t aio_return(struct aiocb* aiocbp); + +//------------------------- Miscellaneous / Unsorted ---------------------------// + +int mkstemp(char* templates); + +#ifdef GKFS_ENABLE_UNUSED_FUNCTIONS +int futimes(int fd, const struct timeval tv[2]); +int utimes(const char* path, const struct timeval tv[2]); +ssize_t listxattr(const char* path, char* list, size_t size); +ssize_t llistxattr(const char* path, char* list, size_t size); +ssize_t flistxattr(int fd, char* list, size_t size); +#endif + +//========================= C++ ABI Interceptions ==============================// +// Intercepting C++ std::filesystem::remove_all +// The mangled name can vary with compiler/STL version. +// This specific name _ZNSt10filesystem10remove_allERKNS_7__cxx114pathE +// is for a GCC/libstdc++ compiled version of std::filesystem::remove_all(const std::filesystem::path&) +// To be link-time intercepted, it needs to be declared extern "C". +int _ZNSt10filesystem10remove_allERKNS_7__cxx114pathE(const std::filesystem::path& p); + + + #ifdef __cplusplus } #endif -- GitLab From 23472cc97532e081c896d5d45103db3c432c1454 Mon Sep 17 00:00:00 2001 From: Ramon Nou Date: Fri, 30 May 2025 16:28:06 +0200 Subject: [PATCH 2/5] formatting --- include/client/gkfs_libc.hpp | 367 +++++++++++++++++++++++------------ 1 file changed, 243 insertions(+), 124 deletions(-) diff --git a/include/client/gkfs_libc.hpp b/include/client/gkfs_libc.hpp index 36339b57d..e88a9936f 100644 --- a/include/client/gkfs_libc.hpp +++ b/include/client/gkfs_libc.hpp @@ -72,165 +72,284 @@ struct __dirstream { //------------------------- File I/O Operations ------------------------------// -int open(const char* path, int flags, ...); -int open64(const char* path, int flags, ...); -int openat(int dirfd, const char* path, int flags, ...); -int openat64(int dirfd, const char* path, int flags, ...); // Note: Implemented via openat in source -int creat(const char* path, mode_t mode); -int close(int fd); -int close_range(unsigned int low, unsigned int high, int flags); -ssize_t read(int fd, void* buf, size_t nbyte); -ssize_t write(int fd, const void* buf, size_t nbyte); -ssize_t pread(int fd, void* buf, size_t count, off_t offset); -ssize_t pwrite(int fd, const void* buf, size_t count, off_t offset); -ssize_t pread64(int fd, void* buf, size_t count, off64_t offset); -ssize_t pwrite64(int fd, const void* buf, size_t count, off64_t offset); -ssize_t readv(int fd, const struct iovec* iov, int iovcnt); -ssize_t writev(int fd, const struct iovec* iov, int iovcnt); -ssize_t preadv(int fd, const struct iovec* iov, int iovcnt, off_t offset); -ssize_t pwritev(int fd, const struct iovec* iov, int iovcnt, off_t offset); -ssize_t preadv2(int fd, const struct iovec* iov, int iovcnt, off_t offset, int flags); -ssize_t pwritev2(int fd, const struct iovec* iov, int iovcnt, off_t offset, int flags); -off_t lseek(int fd, off_t offset, int whence); -off64_t lseek64(int fd, off64_t offset, int whence); -int ftruncate(int fd, off_t length); -int fsync(int fd); -int flock(int fd, int operation); - -//------------------------- Stat / Metadata Operations -------------------------// - -int stat(const char* path, struct stat* buf); -int stat64(const char* path, struct stat64* buf); // Note: Source uses __xstat64 symbol -int lstat(const char* path, struct stat* st); -int lstat64(const char* path, struct stat64* buf); -int fstat(int fd, struct stat* buf); -int fstat64(int fd, struct stat64* buf); -int fstatat(int dfd, const char* path, struct stat* buf, int flags); -int fstatat64(int dfd, const char* path, struct stat64* buf, int flags); -int statx(int dirfd, const char* path, int flags, unsigned int mask, struct statx* statxbuf); - -#ifdef GKFS_ENABLE_UNUSED_FUNCTIONS // __xstat variants often used by glibc internals -int __xstat(int ver, const char* path, struct stat* buf); -int __xstat64(int ver, const char* path, struct stat64* buf); -int __lxstat(int ver, const char* path, struct stat* buf); -int __lxstat64(int ver, const char* path, struct stat64* buf); -int __fxstat(int ver, int fd, struct stat* buf); -int __fxstatat(int ver, int dfd, const char* path, struct stat* buf, int flags); -int __fxstat64(int ver, int fd, struct stat64* buf); +int +open(const char* path, int flags, ...); +int +open64(const char* path, int flags, ...); +int +openat(int dirfd, const char* path, int flags, ...); +int +openat64(int dirfd, const char* path, int flags, + ...); // Note: Implemented via openat in source +int +creat(const char* path, mode_t mode); +int +close(int fd); +int +close_range(unsigned int low, unsigned int high, int flags); +ssize_t +read(int fd, void* buf, size_t nbyte); +ssize_t +write(int fd, const void* buf, size_t nbyte); +ssize_t +pread(int fd, void* buf, size_t count, off_t offset); +ssize_t +pwrite(int fd, const void* buf, size_t count, off_t offset); +ssize_t +pread64(int fd, void* buf, size_t count, off64_t offset); +ssize_t +pwrite64(int fd, const void* buf, size_t count, off64_t offset); +ssize_t +readv(int fd, const struct iovec* iov, int iovcnt); +ssize_t +writev(int fd, const struct iovec* iov, int iovcnt); +ssize_t +preadv(int fd, const struct iovec* iov, int iovcnt, off_t offset); +ssize_t +pwritev(int fd, const struct iovec* iov, int iovcnt, off_t offset); +ssize_t +preadv2(int fd, const struct iovec* iov, int iovcnt, off_t offset, int flags); +ssize_t +pwritev2(int fd, const struct iovec* iov, int iovcnt, off_t offset, int flags); +off_t +lseek(int fd, off_t offset, int whence); +off64_t +lseek64(int fd, off64_t offset, int whence); +int +ftruncate(int fd, off_t length); +int +fsync(int fd); +int +flock(int fd, int operation); + +//------------------------- Stat / Metadata Operations +//-------------------------// + +int +stat(const char* path, struct stat* buf); +int +stat64(const char* path, + struct stat64* buf); // Note: Source uses __xstat64 symbol +int +lstat(const char* path, struct stat* st); +int +lstat64(const char* path, struct stat64* buf); +int +fstat(int fd, struct stat* buf); +int +fstat64(int fd, struct stat64* buf); +int +fstatat(int dfd, const char* path, struct stat* buf, int flags); +int +fstatat64(int dfd, const char* path, struct stat64* buf, int flags); +int +statx(int dirfd, const char* path, int flags, unsigned int mask, + struct statx* statxbuf); + +#ifdef GKFS_ENABLE_UNUSED_FUNCTIONS // __xstat variants often used by glibc + // internals +int +__xstat(int ver, const char* path, struct stat* buf); +int +__xstat64(int ver, const char* path, struct stat64* buf); +int +__lxstat(int ver, const char* path, struct stat* buf); +int +__lxstat64(int ver, const char* path, struct stat64* buf); +int +__fxstat(int ver, int fd, struct stat* buf); +int +__fxstatat(int ver, int dfd, const char* path, struct stat* buf, int flags); +int +__fxstat64(int ver, int fd, struct stat64* buf); #endif //------------------------- Directory Operations -----------------------------// -int mkdir(const char* path, mode_t mode); -int mkdirat(int dirfd, const char* path, mode_t mode); -int rmdir(const char* path); -DIR* opendir(const char* dirname); -DIR* opendir64(const char* dirname); -DIR* fdopendir(int fd); +int +mkdir(const char* path, mode_t mode); +int +mkdirat(int dirfd, const char* path, mode_t mode); +int +rmdir(const char* path); +DIR* +opendir(const char* dirname); +DIR* +opendir64(const char* dirname); +DIR* +fdopendir(int fd); // For scandir filter and compar function pointer types typedef int (*scandir_filter_func_t)(const struct dirent*); -typedef int (*scandir_compar_func_t)(const struct dirent**, const struct dirent**); -// Note: Original source uses `typeof` (GNU extension) for filter/compar in scandir. -// Using standard function pointer typedefs here for better portability. - -struct dirent* readdir(DIR* dirp); -struct dirent64* readdir64(DIR* dirp); -int closedir(DIR* dirp); -void seekdir(DIR* dirp, long loc); -long telldir(DIR* dirp); -void rewinddir(DIR* dirstream); -int scandir(const char* dirname, struct dirent*** namelist, - scandir_filter_func_t filter, - scandir_compar_func_t compar); +typedef int (*scandir_compar_func_t)(const struct dirent**, + const struct dirent**); +// Note: Original source uses `typeof` (GNU extension) for filter/compar in +// scandir. Using standard function pointer typedefs here for better +// portability. + +struct dirent* +readdir(DIR* dirp); +struct dirent64* +readdir64(DIR* dirp); +int +closedir(DIR* dirp); +void +seekdir(DIR* dirp, long loc); +long +telldir(DIR* dirp); +void +rewinddir(DIR* dirstream); +int +scandir(const char* dirname, struct dirent*** namelist, + scandir_filter_func_t filter, scandir_compar_func_t compar); //------------------------- Path Operations ----------------------------------// -int remove(const char* path); -int unlink(const char* path); -int rename(const char* oldpath, const char* newpath); -int renameat(int olddirfd, const char* oldpath, int newdirfd, const char* newpath); -int renameat2(int olddirfd, const char* oldpath, int newdirfd, const char* newpath, unsigned int flags); -int symlink(const char* target_path, const char* link_path); // POSIX: target, linkpath -int symlinkat(const char* target_path, int newdirfd, const char* link_path); +int +remove(const char* path); +int +unlink(const char* path); +int +rename(const char* oldpath, const char* newpath); +int +renameat(int olddirfd, const char* oldpath, int newdirfd, const char* newpath); +int +renameat2(int olddirfd, const char* oldpath, int newdirfd, const char* newpath, + unsigned int flags); +int +symlink(const char* target_path, + const char* link_path); // POSIX: target, linkpath +int +symlinkat(const char* target_path, int newdirfd, const char* link_path); #ifdef HAS_SYMLINKS -ssize_t readlink(const char* path, char* buf, size_t bufsize); -ssize_t readlinkat(int dfd, const char* path, char* buf, size_t bufsize); +ssize_t +readlink(const char* path, char* buf, size_t bufsize); +ssize_t +readlinkat(int dfd, const char* path, char* buf, size_t bufsize); #endif -char* realpath(const char* path, char* resolved_path); -char* __realpath_chk(const char* path, char* resolved_path, size_t resolved_len); // GNU Fortify Source variant -int access(const char* path, int mode); -int faccessat(int dfd, const char* path, int mode, int flags); -int chdir(const char* path); -int fchdir(int fd); -char* getcwd(char* buffer, size_t size); +char* +realpath(const char* path, char* resolved_path); +char* +__realpath_chk(const char* path, char* resolved_path, + size_t resolved_len); // GNU Fortify Source variant +int +access(const char* path, int mode); +int +faccessat(int dfd, const char* path, int mode, int flags); +int +chdir(const char* path); +int +fchdir(int fd); +char* +getcwd(char* buffer, size_t size); //------------------------- Permissions --------------------------------------// -int chmod(const char* path, mode_t mode); -int fchmod(int fd, mode_t mode); -int fchmodat(int dfd, const char* path, mode_t mode, int flags); -int chown(const char* path, uid_t owner, gid_t group); -int fchown(int fd, uid_t owner, gid_t group); - -//------------------------- Process and Descriptor Management ------------------// - -int dup(int fd); -int dup2(int oldfd, int newfd); -int dup3(int oldfd, int newfd, int flags); -int fcntl(int fd, int cmd, ...); +int +chmod(const char* path, mode_t mode); +int +fchmod(int fd, mode_t mode); +int +fchmodat(int dfd, const char* path, mode_t mode, int flags); +int +chown(const char* path, uid_t owner, gid_t group); +int +fchown(int fd, uid_t owner, gid_t group); + +//------------------------- Process and Descriptor Management +//------------------// + +int +dup(int fd); +int +dup2(int oldfd, int newfd); +int +dup3(int oldfd, int newfd, int flags); +int +fcntl(int fd, int cmd, ...); #ifdef GKFS_ENABLE_UNUSED_FUNCTIONS -void exit(int status); // Note: This function does not return. -int pipe(int pipefd[2]); +void +exit(int status); // Note: This function does not return. +int +pipe(int pipefd[2]); #endif //------------------------- C Standard I/O (FILE*) ---------------------------// -FILE* fopen(const char* path, const char* mode); -FILE* fdopen(int fd, const char* mode); -FILE* freopen64(const char* path, const char* mode, FILE* stream); // Note: Source uses "freopen" symbol -int fclose(FILE* stream); -size_t fread(void* ptr, size_t size, size_t nmemb, FILE* stream); -size_t fwrite(const void* ptr, size_t size, size_t nmemb, FILE* stream); -int fseek(FILE* stream, long int offset, int whence); -long ftell(FILE* stream); -void rewind(FILE* stream); -int feof(FILE* stream); -void clearerr(FILE* stream); -int fputs(const char* str, FILE* stream); -char* fgets(char* str, int n, FILE* stream); -int fflush(FILE* stream); +FILE* +fopen(const char* path, const char* mode); +FILE* +fdopen(int fd, const char* mode); +FILE* +freopen64(const char* path, const char* mode, + FILE* stream); // Note: Source uses "freopen" symbol +int +fclose(FILE* stream); +size_t +fread(void* ptr, size_t size, size_t nmemb, FILE* stream); +size_t +fwrite(const void* ptr, size_t size, size_t nmemb, FILE* stream); +int +fseek(FILE* stream, long int offset, int whence); +long +ftell(FILE* stream); +void +rewind(FILE* stream); +int +feof(FILE* stream); +void +clearerr(FILE* stream); +int +fputs(const char* str, FILE* stream); +char* +fgets(char* str, int n, FILE* stream); +int +fflush(FILE* stream); //------------------------- AIO Operations -----------------------------------// -int aio_read(struct aiocb* aiocbp); -int aio_write(struct aiocb* aiocbp); -int aio_error(const struct aiocb* aiocbp); -ssize_t aio_return(struct aiocb* aiocbp); +int +aio_read(struct aiocb* aiocbp); +int +aio_write(struct aiocb* aiocbp); +int +aio_error(const struct aiocb* aiocbp); +ssize_t +aio_return(struct aiocb* aiocbp); -//------------------------- Miscellaneous / Unsorted ---------------------------// +//------------------------- Miscellaneous / Unsorted +//---------------------------// -int mkstemp(char* templates); +int +mkstemp(char* templates); #ifdef GKFS_ENABLE_UNUSED_FUNCTIONS -int futimes(int fd, const struct timeval tv[2]); -int utimes(const char* path, const struct timeval tv[2]); -ssize_t listxattr(const char* path, char* list, size_t size); -ssize_t llistxattr(const char* path, char* list, size_t size); -ssize_t flistxattr(int fd, char* list, size_t size); +int +futimes(int fd, const struct timeval tv[2]); +int +utimes(const char* path, const struct timeval tv[2]); +ssize_t +listxattr(const char* path, char* list, size_t size); +ssize_t +llistxattr(const char* path, char* list, size_t size); +ssize_t +flistxattr(int fd, char* list, size_t size); #endif -//========================= C++ ABI Interceptions ==============================// +//========================= C++ ABI Interceptions +//==============================// // Intercepting C++ std::filesystem::remove_all // The mangled name can vary with compiler/STL version. // This specific name _ZNSt10filesystem10remove_allERKNS_7__cxx114pathE -// is for a GCC/libstdc++ compiled version of std::filesystem::remove_all(const std::filesystem::path&) -// To be link-time intercepted, it needs to be declared extern "C". -int _ZNSt10filesystem10remove_allERKNS_7__cxx114pathE(const std::filesystem::path& p); - +// is for a GCC/libstdc++ compiled version of std::filesystem::remove_all(const +// std::filesystem::path&) To be link-time intercepted, it needs to be declared +// extern "C". +int +_ZNSt10filesystem10remove_allERKNS_7__cxx114pathE( + const std::filesystem::path& p); #ifdef __cplusplus -- GitLab From b810c7a1b52afbec9f99979a97bafeba4cd4e0b5 Mon Sep 17 00:00:00 2001 From: Ramon Nou Date: Fri, 30 May 2025 16:30:20 +0200 Subject: [PATCH 3/5] adding disabled functions --- include/client/gkfs_libc.hpp | 3 --- src/client/gkfs_libc.cpp | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/client/gkfs_libc.hpp b/include/client/gkfs_libc.hpp index e88a9936f..24d40dc06 100644 --- a/include/client/gkfs_libc.hpp +++ b/include/client/gkfs_libc.hpp @@ -146,8 +146,6 @@ int statx(int dirfd, const char* path, int flags, unsigned int mask, struct statx* statxbuf); -#ifdef GKFS_ENABLE_UNUSED_FUNCTIONS // __xstat variants often used by glibc - // internals int __xstat(int ver, const char* path, struct stat* buf); int @@ -162,7 +160,6 @@ int __fxstatat(int ver, int dfd, const char* path, struct stat* buf, int flags); int __fxstat64(int ver, int fd, struct stat64* buf); -#endif //------------------------- Directory Operations -----------------------------// diff --git a/src/client/gkfs_libc.cpp b/src/client/gkfs_libc.cpp index 9403efd4a..bef5ceb95 100644 --- a/src/client/gkfs_libc.cpp +++ b/src/client/gkfs_libc.cpp @@ -1173,8 +1173,6 @@ statx(int dirfd, const char* path, int flags, unsigned int mask, GKFS_FALLBACK(statx, dirfd, path, flags, mask, statxbuf); } - -#ifdef GKFS_ENABLE_UNUSED_FUNCTIONS // __xstat style functions (versioned) int __xstat(int ver, const char* path, struct stat* buf) { @@ -1339,7 +1337,7 @@ version // the versioned one. So, __fxstatat64 would need its own DLSYM_WRAPPER // targeting "__fxstatat64" if it exists. For now, keeping as per what was // explicitly in the original for __* variants. -#endif // GKFS_ENABLE_UNUSED_FUNCTIONS + //------------------------- Directory Operations -----------------------------// -- GitLab From 0deb7b499bdf18762034ef41583117edfcf9ac98 Mon Sep 17 00:00:00 2001 From: Ramon Nou Date: Fri, 30 May 2025 16:31:20 +0200 Subject: [PATCH 4/5] format --- src/client/gkfs_libc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/gkfs_libc.cpp b/src/client/gkfs_libc.cpp index bef5ceb95..2b8a6e43f 100644 --- a/src/client/gkfs_libc.cpp +++ b/src/client/gkfs_libc.cpp @@ -1339,7 +1339,6 @@ version // explicitly in the original for __* variants. - //------------------------- Directory Operations -----------------------------// int -- GitLab From c9d4d6447348d084891783062838ae9298d51c86 Mon Sep 17 00:00:00 2001 From: Ramon Nou Date: Fri, 30 May 2025 16:33:23 +0200 Subject: [PATCH 5/5] adding disabled functions --- src/client/gkfs_libc.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/client/gkfs_libc.cpp b/src/client/gkfs_libc.cpp index 2b8a6e43f..ca04d0bd2 100644 --- a/src/client/gkfs_libc.cpp +++ b/src/client/gkfs_libc.cpp @@ -519,7 +519,6 @@ DLSYM_WRAPPER(int, statx, (dirfd, path, flags, mask, buf), "statx") DLSYM_WRAPPER(int, xstat64, (int ver, const char* path, struct stat64* buf), (ver, path, buf), "__xstat64") -#ifdef GKFS_ENABLE_UNUSED_FUNCTIONS // __xstat variants DLSYM_WRAPPER(int, lxstat64, (int ver, const char* path, struct stat64* buf), (ver, path, buf), "__lxstat64") DLSYM_WRAPPER(int, __lxstat, (int ver, const char* path, struct stat* buf), @@ -531,7 +530,6 @@ DLSYM_WRAPPER(int, fxstat64, (int ver, int fd, struct stat64* buf), DLSYM_WRAPPER(int, fxstatat, (int ver, int dfd, const char* path, struct stat* buf, int flags), (ver, dfd, path, buf, flags), "__fxstatat") -#endif // Directory Operations DLSYM_WRAPPER(int, mkdir, (const char* path, mode_t mode), (path, mode), -- GitLab