From 6cfae337a10106114a78f56738e83e7b6638d61d Mon Sep 17 00:00:00 2001 From: Johannes Nixdorf Date: Sat, 9 Aug 2025 19:13:07 +0200 Subject: [PATCH] configure: Base NEED_INTERNAL_STATX on libc headers first MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit At compile time the libc headers are preferred, and linux/stat.h is only included if the libc headers don't provide a definition for statx and its types (tested on STATX_TYPE). The configure test should be based on the same logic. This fixes one cause for failing to compile against musl libc. Signed-off-by: Johannes Nixdorf Reviewed-by: Christoph Hellwig Reviewed-by: Petr Vaněk --- m4/package_libcdev.m4 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 index b77ac1a7..650b8b7b 100644 --- a/m4/package_libcdev.m4 +++ b/m4/package_libcdev.m4 @@ -129,7 +129,15 @@ AC_DEFUN([AC_NEED_INTERNAL_STATX], AC_CHECK_MEMBER(struct statx.stx_atomic_write_unit_max_opt, , need_internal_statx=yes, - [#include ] + [[ +#define _GNU_SOURCE +#include +#include + +#ifndef STATX_TYPE +#include +#endif +]] ) ],need_internal_statx=yes, [#include ] -- 2.47.3