summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/stat.c4
-rw-r--r--src/stat.h8
2 files changed, 4 insertions, 8 deletions
diff --git a/src/stat.c b/src/stat.c
index eca5bab..e525f24 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -13,7 +13,7 @@
#include <sys/stat.h>
#include <sys/types.h>
-#if BFS_USE_STATX && !BFS_HAS_LIBC_STATX
+#if BFS_USE_STATX && !BFS_HAS_STATX
# include <linux/stat.h>
# include <sys/syscall.h>
# include <unistd.h>
@@ -137,7 +137,7 @@ static int bfs_stat_impl(int at_fd, const char *at_path, int at_flags, struct bf
* Wrapper for the statx() system call, which had no glibc wrapper prior to 2.28.
*/
static int bfs_statx(int at_fd, const char *at_path, int at_flags, unsigned int mask, struct statx *buf) {
-#if BFS_HAS_LIBC_STATX
+#if BFS_HAS_STATX
int ret = statx(at_fd, at_path, at_flags, mask, buf);
#else
int ret = syscall(SYS_statx, at_fd, at_path, at_flags, mask, buf);
diff --git a/src/stat.h b/src/stat.h
index 1fdd263..8d7144d 100644
--- a/src/stat.h
+++ b/src/stat.h
@@ -17,16 +17,12 @@
#include <sys/types.h>
#include <time.h>
-#if defined(STATX_BASIC_STATS) && (!__ANDROID__ || __ANDROID_API__ >= 30)
-# define BFS_HAS_LIBC_STATX true
-#elif __linux__
+#if !BFS_HAS_STATX && BFS_HAS_STATX_SYSCALL
# include <linux/stat.h>
#endif
#ifndef BFS_USE_STATX
-# ifdef STATX_BASIC_STATS
-# define BFS_USE_STATX true
-# endif
+# define BFS_USE_STATX (BFS_HAS_STATX || BFS_HAS_STATX_SYSCALL)
#endif
#if BFS_USE_SYS_PARAM_H