From 0afff6c3a9d18af4a210673913370fc5d4cdc7de Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 12 Mar 2026 20:04:25 +0100 Subject: [PATCH 1/2] statx requires include For usage of statx() function you need to include . When compiling the testsuite with uClibc-ng >= 1.0.57 you get following gcc error: tests/zfs-tests/cmd/statx.c:58:1: error: conflicting types for 'statx'; have 'int(int, const char *, int, unsigned int, void *)' 58 | statx(int, const char *, int, unsigned int, void *) | ^~~~~ In file included from /home/wbx/buildroot/br2-zfs/TestZfsUclibc/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/sys/stat.h:381, from ./lib/libspl/include/os/linux/sys/stat.h:30, from /home/wbx/buildroot/br2-zfs/TestZfsUclibc/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/fcntl.h:37, from tests/zfs-tests/cmd/statx.c:29: /home/wbx/buildroot/br2-zfs/TestZfsUclibc/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/bits/statx.h:98:5: note: previous declaration of 'statx' with type 'int(int, const char * restrict, int, unsigned int, struct statx * restrict)' 98 | int statx (int __dirfd, const char *__restrict __path, int __flags, | ^~~~~ The reason is that uClibc-ng before 1.0.56 did not expose statx(). With uClibc-ng 1.0.57 there is a mismatch when is included, because uClibc-ng has a transient dependency on . Glibc does not include , but in fcntl.h so the error does not happen here, but not the real statx() from glibc is used in this case. To make both C libraries happy, only define statx() locally, when no statx is recognized via configure and include the correct header. --- tests/zfs-tests/cmd/statx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/zfs-tests/cmd/statx.c b/tests/zfs-tests/cmd/statx.c index 1acc7e58c5ce..81fea91debb6 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,9 +55,11 @@ #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) From 5008932fd68eee504a83800f2c29ca07261f6b7f Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 13 Mar 2026 00:23:52 +0100 Subject: [PATCH 2/2] fix error: the address of 'statx' will always evaluate as 'true' --- tests/zfs-tests/cmd/statx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/zfs-tests/cmd/statx.c b/tests/zfs-tests/cmd/statx.c index 81fea91debb6..41968198d60a 100644 --- a/tests/zfs-tests/cmd/statx.c +++ b/tests/zfs-tests/cmd/statx.c @@ -64,7 +64,7 @@ statx(int, const char *, int, unsigned int, void *) 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));