diff --git a/junixsocket-native/src/main/c/config.h b/junixsocket-native/src/main/c/config.h index 7a7990873..cda6f4cbf 100644 --- a/junixsocket-native/src/main/c/config.h +++ b/junixsocket-native/src/main/c/config.h @@ -367,7 +367,10 @@ int jux_mangleErrno(int); # else // This allows us to link against older glibc versions # define memcpy memmove -# ifndef _STAT_VER +# if defined(__loongarch64) +// no stat/__xstat workaround on loongarch64 +# else +# ifndef _STAT_VER # if defined(__aarch64__) || defined(__riscv) # define _STAT_VER 0 # elif defined(__x86_64__) @@ -375,12 +378,13 @@ int jux_mangleErrno(int); # else # define _STAT_VER 3 # endif -# endif -# if !defined(__xstat) +# endif +# if !defined(__xstat) extern int __xstat (int __ver, const char *__filename, struct stat *__stat_buf) __THROW __nonnull ((2, 3)); +# endif +# define stat(...) __xstat(_STAT_VER, __VA_ARGS__) # endif -# define stat(...) __xstat(_STAT_VER, __VA_ARGS__) # endif #endif