gh-144309: Build Python with POSIX 2024 (#144310)
On FreeBSD, the ppoll() function is only visible if the POSIX version
is 2024 or newer.
diff --git a/Misc/NEWS.d/next/Build/2026-01-28-19-04-12.gh-issue-144309.3sMFOh.rst b/Misc/NEWS.d/next/Build/2026-01-28-19-04-12.gh-issue-144309.3sMFOh.rst
new file mode 100644
index 0000000..c64ef49
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2026-01-28-19-04-12.gh-issue-144309.3sMFOh.rst
@@ -0,0 +1 @@
+Build Python with POSIX 2024, instead of POSIX 2008. Patch by Victor Stinner.
diff --git a/configure b/configure
index 30e35a0..cd89836 100755
--- a/configure
+++ b/configure
@@ -4757,9 +4757,9 @@
if test $define_xopen_source = yes
then
- # X/Open 7, incorporating POSIX.1-2008
+ # X/Open 8, incorporating POSIX.1-2024
-printf "%s\n" "#define _XOPEN_SOURCE 700" >>confdefs.h
+printf "%s\n" "#define _XOPEN_SOURCE 800" >>confdefs.h
# On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
@@ -4771,7 +4771,7 @@
-printf "%s\n" "#define _POSIX_C_SOURCE 200809L" >>confdefs.h
+printf "%s\n" "#define _POSIX_C_SOURCE 202405L" >>confdefs.h
fi
diff --git a/configure.ac b/configure.ac
index bc63d65..e9b45d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -916,8 +916,8 @@
if test $define_xopen_source = yes
then
- # X/Open 7, incorporating POSIX.1-2008
- AC_DEFINE([_XOPEN_SOURCE], [700],
+ # X/Open 8, incorporating POSIX.1-2024
+ AC_DEFINE([_XOPEN_SOURCE], [800],
[Define to the level of X/Open that your system supports])
# On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
@@ -927,8 +927,8 @@
AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1],
[Define to activate Unix95-and-earlier features])
- AC_DEFINE([_POSIX_C_SOURCE], [200809L],
- [Define to activate features from IEEE Stds 1003.1-2008])
+ AC_DEFINE([_POSIX_C_SOURCE], [202405L],
+ [Define to activate features from IEEE Std 1003.1-2024])
fi
# On HP-UX mbstate_t requires _INCLUDE__STDC_A1_SOURCE
diff --git a/pyconfig.h.in b/pyconfig.h.in
index 3d901e0..e2009b2 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -2042,7 +2042,7 @@
/* Define on NetBSD to activate all library features */
#undef _NETBSD_SOURCE
-/* Define to activate features from IEEE Stds 1003.1-2008 */
+/* Define to activate features from IEEE Std 1003.1-2024 */
#undef _POSIX_C_SOURCE
/* Define if you have POSIX threads, and your system does not define that. */