gh-83714: Check for struct statx members in configure (#140402)

Some systems have the definitions of the mask bits without having the
corresponding members in struct statx.  Add configure checks for members
added after Linux 4.11 (when statx itself was added).
This commit is contained in:
Jeffrey Bosboom
2025-10-21 09:13:14 -07:00
committed by GitHub
parent b4d2307367
commit 60df1d7e0c
5 changed files with 92 additions and 13 deletions

View File

@@ -5827,6 +5827,17 @@ AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_passwd], [], [], [[
AC_CHECK_MEMBERS([siginfo_t.si_band], [], [], [[@%:@include <signal.h>]])
if test "$ac_cv_func_statx" = yes; then
# Some systems have the definitions of the mask bits without having the
# corresponding members in struct statx. Check for members added after Linux
# 4.11 (when statx itself was added).
AC_CHECK_MEMBERS([struct statx.stx_mnt_id])
AC_CHECK_MEMBERS([struct statx.stx_dio_mem_align])
# stx_dio_offset_align was added together with stx_dio_mem_align
AC_CHECK_MEMBERS([struct statx.stx_subvol])
AC_CHECK_MEMBERS([struct statx.stx_atomic_write_unit_min])
# stx_atomic_write_unit_max and stx_atomic_write_segments_max were added
# together with stx_atomic_write_unit_min
AC_CHECK_MEMBERS([struct statx.stx_dio_read_offset_align])
# stx_atomic_write_unit_max_opt was added in Linux 6.16, but is controlled by
# the STATX_WRITE_ATOMIC mask bit added in Linux 6.11, so having the mask bit
# doesn't imply having the member.