diff --git a/tests/zfs-tests/cmd/statx.c b/tests/zfs-tests/cmd/statx.c index 1acc7e58c5ce..41968198d60a 100644 --- a/tests/zfs-tests/cmd/statx.c +++ b/tests/zfs-tests/cmd/statx.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -54,14 +55,16 @@ #endif /* __NR_statx */ +#ifndef HAVE_STATX int statx(int, const char *, int, unsigned int, void *) __attribute__((weak)); +#endif static inline int _statx(int fd, const char *path, int flags, unsigned int mask, void *stx) { - if (statx) + if (&statx != NULL) return (statx(fd, path, flags, mask, stx)); else return (syscall(__NR_statx, fd, path, flags, mask, stx));