Maximum optimized size for direct I/O with torn-write protection.
.. availability:: Linux >= 4.11 with glibc >= 2.28 and build-time kernel
- userspace API headers >= 6.11.
+ userspace API headers >= 6.16.
.. attribute:: stx_atomic_write_segments_max
MM(stx_atomic_write_segments_max, Py_T_UINT, atomic_write_segments_max,
"maximum iovecs for direct I/O with torn-write protection"),
#endif
-#if 0
+#ifdef HAVE_STRUCT_STATX_STX_ATOMIC_WRITE_UNIT_MAX_OPT
MM(stx_atomic_write_unit_max_opt, Py_T_UINT, atomic_write_unit_max_opt,
"maximum optimized size for direct I/O with torn-write protection"),
#endif
fi
+if test "$ac_cv_func_statx" = yes; then
+ # 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.
+ ac_fn_c_check_member "$LINENO" "struct statx" "stx_atomic_write_unit_max_opt" "ac_cv_member_struct_statx_stx_atomic_write_unit_max_opt" "$ac_includes_default"
+if test "x$ac_cv_member_struct_statx_stx_atomic_write_unit_max_opt" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_STATX_STX_ATOMIC_WRITE_UNIT_MAX_OPT 1" >>confdefs.h
+
+
+fi
+
+fi
+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for time.h that defines altzone" >&5
printf %s "checking for time.h that defines altzone... " >&6; }
if test ${ac_cv_header_time_altzone+y}
# Issue #21085: In Cygwin, siginfo_t does not have si_band field.
AC_CHECK_MEMBERS([siginfo_t.si_band], [], [], [[@%:@include <signal.h>]])
+if test "$ac_cv_func_statx" = yes; then
+ # 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.
+ AC_CHECK_MEMBERS([struct statx.stx_atomic_write_unit_max_opt])
+fi
+
AC_CACHE_CHECK([for time.h that defines altzone], [ac_cv_header_time_altzone], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <time.h>]], [[return altzone;]])],
[ac_cv_header_time_altzone=yes],
/* Define to 1 if 'pw_passwd' is a member of 'struct passwd'. */
#undef HAVE_STRUCT_PASSWD_PW_PASSWD
+/* Define to 1 if 'stx_atomic_write_unit_max_opt' is a member of 'struct
+ statx'. */
+#undef HAVE_STRUCT_STATX_STX_ATOMIC_WRITE_UNIT_MAX_OPT
+
/* Define to 1 if 'st_birthtime' is a member of 'struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BIRTHTIME