https://github.com/python/cpython/commit/4b8e53431f0bd02aeeb13c2e2a7b7fe51576774c
commit: 4b8e53431f0bd02aeeb13c2e2a7b7fe51576774c
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2026-11-18T13:29:12+01:00
summary:
gh-157695: Rename HAVE_GETDENTS64 to _Py_HAVE_GETDENTS64 (#162184)
In configure script, use PY_CHECK_FUNC_PRIVATE() to detect
functions:
* getdents64() of <dirent.h>: _Py_HAVE_GETDENTS64
* gettid() of <unistd.h>: _Py_HAVE_GETTID
* if_indextoname() of <net/if.h>: _Py_HAVE_IF_INDEXTONAME
* if_nametoindex() of <net/if.h>: _Py_HAVE_IF_NAMETOINDEX
* pidfd_getfd() of <sys/pidfd.h>: _Py_HAVE_PIDFD_GETFD
* pidfd_open() of <sys/pidfd.h>: _Py_HAVE_PIDFD_OPEN
* pidfd_send_signal() of <sys/pidfd.h>: _Py_HAVE_PIDFD_SEND_SIGNAL
Add shebang to Tools/build/check_capi_macros.py and make the script
executable.
files:
M Modules/_posixsubprocess.c
M Modules/clinic/posixmodule.c.h
M Modules/clinic/signalmodule.c.h
M Modules/clinic/socketmodule.c.h
M Modules/posixmodule.c
M Modules/signalmodule.c
M Modules/socketmodule.c
M Python/perf_jit_trampoline.c
M Python/thread_pthread.h
M Tools/build/check_capi_macros.py
M Tools/build/check_capi_macros_ignored.txt
M configure
M configure.ac
M pyconfig.h.in
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 415e0afbe88125e..8ad01414ad80755 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -373,10 +373,10 @@ _close_range_except(int start_fd,
return 0;
}
-#if defined(HAVE_GETDENTS64) \
+#if defined(_Py_HAVE_GETDENTS64) \
|| (defined(__linux__) && defined(HAVE_SYS_SYSCALL_H))
-#ifdef HAVE_GETDENTS64
+#ifdef _Py_HAVE_GETDENTS64
# define py_dirent64 dirent64
#else
/* It doesn't matter if d_name has room for NAME_MAX chars; we're using this
@@ -392,7 +392,7 @@ struct py_dirent64 {
unsigned char d_type;
char d_name[256]; /* Filename (null-terminated) */
};
-#endif // !HAVE_GETDENTS64
+#endif // !_Py_HAVE_GETDENTS64
static int
_brute_force_closer(int first, int last)
@@ -435,7 +435,7 @@ _close_open_fds_safe(int start_fd, int *fds_to_keep,
Py_ssize_t fds_to_keep_len)
char buffer[sizeof(struct py_dirent64)];
Py_ssize_t bytes;
while (1) {
-#ifdef HAVE_GETDENTS64
+#ifdef _Py_HAVE_GETDENTS64
/* musl <1.2.4 headers expose `getdents64` as an alias for
`getdents`, whose buffer parameter
* is `struct dirent *`. We use `void *` to support both that
interface and the glibc declaration
* without an incompatible-pointer diagnostic.
diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h
index e992a4d1b8f7971..c2f183f70378367 100644
--- a/Modules/clinic/posixmodule.c.h
+++ b/Modules/clinic/posixmodule.c.h
@@ -6322,7 +6322,7 @@ os_wait(PyObject *module, PyObject *Py_UNUSED(ignored))
#endif /* defined(HAVE_WAIT) */
-#if (defined(HAVE_PIDFD_OPEN) || (defined(__linux__) &&
defined(__NR_pidfd_open) && !(defined(__ANDROID__) && __ANDROID_API__ < 31)))
+#if (defined(_Py_HAVE_PIDFD_OPEN) || (defined(__linux__) &&
defined(__NR_pidfd_open) && !(defined(__ANDROID__) && __ANDROID_API__ < 31)))
PyDoc_STRVAR(os_pidfd_open__doc__,
"pidfd_open($module, /, pid, flags=0)\n"
@@ -6397,9 +6397,9 @@ os_pidfd_open(PyObject *module, PyObject *const *args,
Py_ssize_t nargs, PyObjec
return return_value;
}
-#endif /* (defined(HAVE_PIDFD_OPEN) || (defined(__linux__) &&
defined(__NR_pidfd_open) && !(defined(__ANDROID__) && __ANDROID_API__ < 31))) */
+#endif /* (defined(_Py_HAVE_PIDFD_OPEN) || (defined(__linux__) &&
defined(__NR_pidfd_open) && !(defined(__ANDROID__) && __ANDROID_API__ < 31))) */
-#if (defined(HAVE_PIDFD_GETFD) || (defined(__linux__) &&
defined(__NR_pidfd_getfd) && !(defined(__ANDROID__) && __ANDROID_API__ < 31)))
+#if (defined(_Py_HAVE_PIDFD_GETFD) || (defined(__linux__) &&
defined(__NR_pidfd_getfd) && !(defined(__ANDROID__) && __ANDROID_API__ < 31)))
PyDoc_STRVAR(os_pidfd_getfd__doc__,
"pidfd_getfd($module, /, pidfd, targetfd, *, flags=0)\n"
@@ -6484,7 +6484,7 @@ os_pidfd_getfd(PyObject *module, PyObject *const *args,
Py_ssize_t nargs, PyObje
return return_value;
}
-#endif /* (defined(HAVE_PIDFD_GETFD) || (defined(__linux__) &&
defined(__NR_pidfd_getfd) && !(defined(__ANDROID__) && __ANDROID_API__ < 31)))
*/
+#endif /* (defined(_Py_HAVE_PIDFD_GETFD) || (defined(__linux__) &&
defined(__NR_pidfd_getfd) && !(defined(__ANDROID__) && __ANDROID_API__ < 31)))
*/
#if defined(HAVE_SETNS)
@@ -13763,4 +13763,4 @@ os__emscripten_log(PyObject *module, PyObject *const
*args, Py_ssize_t nargs, Py
#ifndef OS__EMSCRIPTEN_LOG_METHODDEF
#define OS__EMSCRIPTEN_LOG_METHODDEF
#endif /* !defined(OS__EMSCRIPTEN_LOG_METHODDEF) */
-/*[clinic end generated code: output=c92854d21c8f6290 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=077c57e5f93bd790 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h
index 6125f253ac0380d..26139ff0fc0cd39 100644
--- a/Modules/clinic/signalmodule.c.h
+++ b/Modules/clinic/signalmodule.c.h
@@ -689,7 +689,7 @@ signal_pthread_kill(PyObject *module, PyObject *const
*args, Py_ssize_t nargs)
#endif /* defined(HAVE_PTHREAD_KILL) */
-#if (defined(HAVE_PIDFD_SEND_SIGNAL) || (defined(__linux__) &&
defined(__NR_pidfd_send_signal) && !(defined(__ANDROID__) && __ANDROID_API__ <
31)))
+#if (defined(_Py_HAVE_PIDFD_SEND_SIGNAL) || (defined(__linux__) &&
defined(__NR_pidfd_send_signal) && !(defined(__ANDROID__) && __ANDROID_API__ <
31)))
PyDoc_STRVAR(signal_pidfd_send_signal__doc__,
"pidfd_send_signal($module, pidfd, signalnum, siginfo=None, flags=0, /)\n"
@@ -754,7 +754,7 @@ signal_pidfd_send_signal(PyObject *module, PyObject *const
*args, Py_ssize_t nar
return return_value;
}
-#endif /* (defined(HAVE_PIDFD_SEND_SIGNAL) || (defined(__linux__) &&
defined(__NR_pidfd_send_signal) && !(defined(__ANDROID__) && __ANDROID_API__ <
31))) */
+#endif /* (defined(_Py_HAVE_PIDFD_SEND_SIGNAL) || (defined(__linux__) &&
defined(__NR_pidfd_send_signal) && !(defined(__ANDROID__) && __ANDROID_API__ <
31))) */
#ifndef SIGNAL_ALARM_METHODDEF
#define SIGNAL_ALARM_METHODDEF
@@ -807,4 +807,4 @@ signal_pidfd_send_signal(PyObject *module, PyObject *const
*args, Py_ssize_t nar
#ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
#define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
#endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */
-/*[clinic end generated code: output=2a04ec31f49b1c93 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=48d30418971f312a input=a9049054013a1b77]*/
diff --git a/Modules/clinic/socketmodule.c.h b/Modules/clinic/socketmodule.c.h
index 09041d92a305793..5a1a128b304f028 100644
--- a/Modules/clinic/socketmodule.c.h
+++ b/Modules/clinic/socketmodule.c.h
@@ -2152,7 +2152,7 @@ _socket_if_nameindex(PyObject *module, PyObject
*Py_UNUSED(ignored))
#endif /* (defined(HAVE_IF_NAMEINDEX) || defined(MS_WINDOWS_DESKTOP)) */
-#if (defined(HAVE_IF_NAMETOINDEX) || defined(MS_WINDOWS_DESKTOP))
+#if (defined(_Py_HAVE_IF_NAMETOINDEX) || defined(MS_WINDOWS_DESKTOP))
PyDoc_STRVAR(_socket_if_nametoindex__doc__,
"if_nametoindex($module, oname, /)\n"
@@ -2184,9 +2184,9 @@ _socket_if_nametoindex(PyObject *module, PyObject *arg)
return return_value;
}
-#endif /* (defined(HAVE_IF_NAMETOINDEX) || defined(MS_WINDOWS_DESKTOP)) */
+#endif /* (defined(_Py_HAVE_IF_NAMETOINDEX) || defined(MS_WINDOWS_DESKTOP)) */
-#if (defined(HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP))
+#if (defined(_Py_HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP))
PyDoc_STRVAR(_socket_if_indextoname__doc__,
"if_indextoname($module, if_index, /)\n"
@@ -2215,7 +2215,7 @@ _socket_if_indextoname(PyObject *module, PyObject *arg)
return return_value;
}
-#endif /* (defined(HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP)) */
+#endif /* (defined(_Py_HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP)) */
#if defined(CMSG_LEN)
@@ -2449,4 +2449,4 @@ _socket_CMSG_SPACE(PyObject *module, PyObject *arg)
#ifndef _SOCKET_CMSG_SPACE_METHODDEF
#define _SOCKET_CMSG_SPACE_METHODDEF
#endif /* !defined(_SOCKET_CMSG_SPACE_METHODDEF) */
-/*[clinic end generated code: output=bca43f33969d67ad input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e6e677d3de0c63e4 input=a9049054013a1b77]*/
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index c6f89fc2454e88a..619154309b40e31 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -10870,7 +10870,7 @@ os_wait_impl(PyObject *module)
// This system call always crashes on older Android versions.
-#if defined(HAVE_PIDFD_OPEN) \
+#if defined(_Py_HAVE_PIDFD_OPEN) \
|| (defined(__linux__) && defined(__NR_pidfd_open) \
&& !(defined(__ANDROID__) && __ANDROID_API__ < 31))
/*[clinic input]
@@ -10888,7 +10888,7 @@ static PyObject *
os_pidfd_open_impl(PyObject *module, pid_t pid, unsigned int flags)
/*[clinic end generated code: output=5c7252698947dc41 input=03058b32c389f874]*/
{
-#ifdef HAVE_PIDFD_OPEN
+#ifdef _Py_HAVE_PIDFD_OPEN
int fd = pidfd_open(pid, flags);
#else
int fd = syscall(__NR_pidfd_open, pid, flags);
@@ -10901,7 +10901,7 @@ os_pidfd_open_impl(PyObject *module, pid_t pid,
unsigned int flags)
#endif
-#if defined(HAVE_PIDFD_GETFD) \
+#if defined(_Py_HAVE_PIDFD_GETFD) \
|| (defined(__linux__) && defined(__NR_pidfd_getfd) \
&& !(defined(__ANDROID__) && __ANDROID_API__ < 31))
/*[clinic input]
@@ -10922,7 +10922,7 @@ os_pidfd_getfd_impl(PyObject *module, int pidfd, int
targetfd,
unsigned int flags)
/*[clinic end generated code: output=e1a1415a13c7137f input=ef6417fb10deb1cc]*/
{
-#ifdef HAVE_PIDFD_GETFD
+#ifdef _Py_HAVE_PIDFD_GETFD
int fd = pidfd_getfd(pidfd, targetfd, flags);
#else
int fd = syscall(__NR_pidfd_getfd, pidfd, targetfd, flags);
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index addf6b456b1f95c..85ed113a17e5e81 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -1304,7 +1304,7 @@ signal_pthread_kill_impl(PyObject *module, unsigned long
thread_id,
// This system call always crashes on older Android versions.
-#if defined(HAVE_PIDFD_SEND_SIGNAL) \
+#if defined(_Py_HAVE_PIDFD_SEND_SIGNAL) \
|| (defined(__linux__) && defined(__NR_pidfd_send_signal) \
&& !(defined(__ANDROID__) && __ANDROID_API__ < 31))
/*[clinic input]
@@ -1329,7 +1329,7 @@ signal_pidfd_send_signal_impl(PyObject *module, int
pidfd, int signalnum,
PyErr_SetString(PyExc_TypeError, "siginfo must be None");
return NULL;
}
-#ifdef HAVE_PIDFD_SEND_SIGNAL
+#ifdef _Py_HAVE_PIDFD_SEND_SIGNAL
int res = pidfd_send_signal(pidfd, signalnum, NULL, flags);
#else
int res = syscall(__NR_pidfd_send_signal, pidfd, signalnum, NULL, flags);
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 4df03284cbdd24f..7a76882e1633e10 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -606,14 +606,14 @@ _PyLong_##NAME##_Converter(PyObject *obj, void *ptr)
\
return 1; \
}
-#if defined(HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP)
+#if defined(_Py_HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP)
# ifdef MS_WINDOWS
UNSIGNED_INT_CONVERTER(NetIfindex, NET_IFINDEX)
# else
# define _PyLong_NetIfindex_Converter _PyLong_UnsignedInt_Converter
# define NET_IFINDEX unsigned int
# endif
-#endif // defined(HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP)
+#endif // defined(_Py_HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP)
/*[python input]
class NET_IFINDEX_converter(CConverter):
@@ -7403,7 +7403,7 @@ _socket_if_nameindex_impl(PyObject *module)
#endif // defined(HAVE_IF_NAMEINDEX) || defined(MS_WINDOWS_DESKTOP)
-#if defined(HAVE_IF_NAMETOINDEX) || defined(MS_WINDOWS_DESKTOP)
+#if defined(_Py_HAVE_IF_NAMETOINDEX) || defined(MS_WINDOWS_DESKTOP)
/*[clinic input]
_socket.if_nametoindex
@@ -7433,9 +7433,9 @@ _socket_if_nametoindex_impl(PyObject *module, PyObject
*oname)
return PyLong_FromUnsignedLong(index);
}
-#endif // defined(HAVE_IF_NAMETOINDEX) || defined(MS_WINDOWS_DESKTOP)
+#endif // defined(_Py_HAVE_IF_NAMETOINDEX) || defined(MS_WINDOWS_DESKTOP)
-#if defined(HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP)
+#if defined(_Py_HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP)
/*[clinic input]
@permit_long_summary
@@ -7460,7 +7460,7 @@ _socket_if_indextoname_impl(PyObject *module, NET_IFINDEX
index)
return PyUnicode_DecodeFSDefault(name);
}
-#endif // defined(HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP)
+#endif // defined(_Py_HAVE_IF_INDEXTONAME) || defined(MS_WINDOWS_DESKTOP)
#ifdef CMSG_LEN
diff --git a/Python/perf_jit_trampoline.c b/Python/perf_jit_trampoline.c
index 07aa8e769bf2d7d..da6a7e69633db52 100644
--- a/Python/perf_jit_trampoline.c
+++ b/Python/perf_jit_trampoline.c
@@ -672,7 +672,7 @@ static void perf_map_jit_write_entry_with_name(
uint64_t thread_id = 0;
pthread_threadid_np(NULL, &thread_id);
ev.thread_id = (uint32_t)thread_id;
-#elif defined(HAVE_GETTID)
+#elif defined(_Py_HAVE_GETTID)
ev.thread_id = gettid();
#else
ev.thread_id = syscall(SYS_gettid); // Get thread ID via system call
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index e660bca84068604..c7f245acddb290c 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -18,7 +18,7 @@
#include <signal.h>
#include <unistd.h> /* pause(), also getthrid() on OpenBSD */
-#ifdef HAVE_GETTID
+#ifdef _Py_HAVE_GETTID
# include <unistd.h> // gettid()
#elif defined(__linux__)
# include <sys/syscall.h> /* syscall(SYS_gettid) */
@@ -384,7 +384,7 @@ PyThread_get_thread_native_id(void)
#ifdef __APPLE__
uint64_t native_id;
(void) pthread_threadid_np(NULL, &native_id);
-#elif defined(HAVE_GETTID)
+#elif defined(_Py_HAVE_GETTID)
pid_t native_id;
native_id = gettid();
#elif defined(__linux__)
diff --git a/Tools/build/check_capi_macros.py b/Tools/build/check_capi_macros.py
old mode 100644
new mode 100755
index 62ae1fd0bb1c941..86c433a11683487
--- a/Tools/build/check_capi_macros.py
+++ b/Tools/build/check_capi_macros.py
@@ -1,3 +1,4 @@
+#! /usr/bin/env python3
"""
Check that all macros defined by the Python C API have a name starting with
"Py". Ignore names listed by check_capi_macros_ignored.txt: macros with an
diff --git a/Tools/build/check_capi_macros_ignored.txt
b/Tools/build/check_capi_macros_ignored.txt
index 1800a2c4ec8946c..73d4f7be0766b9f 100644
--- a/Tools/build/check_capi_macros_ignored.txt
+++ b/Tools/build/check_capi_macros_ignored.txt
@@ -235,7 +235,6 @@ HAVE_GDBM_H
HAVE_GDBM_NDBM_H
HAVE_GETADDRINFO
HAVE_GETC_UNLOCKED
-HAVE_GETDENTS64
HAVE_GETEGID
HAVE_GETENTROPY
HAVE_GETEUID
@@ -279,16 +278,13 @@ HAVE_GETSERVBYNAME
HAVE_GETSERVBYPORT
HAVE_GETSID
HAVE_GETSOCKNAME
-HAVE_GETTID
HAVE_GETUID
HAVE_GRANTPT
HAVE_GRP_H
HAVE_HSTRERROR
HAVE_HTOLE64
HAVE_ICONV_H
-HAVE_IF_INDEXTONAME
HAVE_IF_NAMEINDEX
-HAVE_IF_NAMETOINDEX
HAVE_INET_ATON
HAVE_INET_NTOA
HAVE_INET_PTON
@@ -389,9 +385,6 @@ HAVE_PANELW
HAVE_PANEL_H
HAVE_PATHCONF
HAVE_PAUSE
-HAVE_PIDFD_GETFD
-HAVE_PIDFD_OPEN
-HAVE_PIDFD_SEND_SIGNAL
HAVE_PIPE
HAVE_PIPE2
HAVE_PLOCK
diff --git a/configure b/configure
index e033b0217aefad5..a2e9c1711adb794 100755
--- a/configure
+++ b/configure
@@ -21009,12 +21009,6 @@ if test "x$ac_cv_func_gai_strerror" = xyes
then :
printf "%s\n" "#define HAVE_GAI_STRERROR 1" >>confdefs.h
-fi
-ac_fn_c_check_func "$LINENO" "getdents64" "ac_cv_func_getdents64"
-if test "x$ac_cv_func_getdents64" = xyes
-then :
- printf "%s\n" "#define HAVE_GETDENTS64 1" >>confdefs.h
-
fi
ac_fn_c_check_func "$LINENO" "getegid" "ac_cv_func_getegid"
if test "x$ac_cv_func_getegid" = xyes
@@ -21177,12 +21171,6 @@ if test "x$ac_cv_func_getsid" = xyes
then :
printf "%s\n" "#define HAVE_GETSID 1" >>confdefs.h
-fi
-ac_fn_c_check_func "$LINENO" "gettid" "ac_cv_func_gettid"
-if test "x$ac_cv_func_gettid" = xyes
-then :
- printf "%s\n" "#define HAVE_GETTID 1" >>confdefs.h
-
fi
ac_fn_c_check_func "$LINENO" "getuid" "ac_cv_func_getuid"
if test "x$ac_cv_func_getuid" = xyes
@@ -21195,24 +21183,12 @@ if test "x$ac_cv_func_grantpt" = xyes
then :
printf "%s\n" "#define HAVE_GRANTPT 1" >>confdefs.h
-fi
-ac_fn_c_check_func "$LINENO" "if_indextoname" "ac_cv_func_if_indextoname"
-if test "x$ac_cv_func_if_indextoname" = xyes
-then :
- printf "%s\n" "#define HAVE_IF_INDEXTONAME 1" >>confdefs.h
-
fi
ac_fn_c_check_func "$LINENO" "if_nameindex" "ac_cv_func_if_nameindex"
if test "x$ac_cv_func_if_nameindex" = xyes
then :
printf "%s\n" "#define HAVE_IF_NAMEINDEX 1" >>confdefs.h
-fi
-ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex"
-if test "x$ac_cv_func_if_nametoindex" = xyes
-then :
- printf "%s\n" "#define HAVE_IF_NAMETOINDEX 1" >>confdefs.h
-
fi
ac_fn_c_check_func "$LINENO" "initgroups" "ac_cv_func_initgroups"
if test "x$ac_cv_func_initgroups" = xyes
@@ -21357,24 +21333,6 @@ if test "x$ac_cv_func_pause" = xyes
then :
printf "%s\n" "#define HAVE_PAUSE 1" >>confdefs.h
-fi
-ac_fn_c_check_func "$LINENO" "pidfd_open" "ac_cv_func_pidfd_open"
-if test "x$ac_cv_func_pidfd_open" = xyes
-then :
- printf "%s\n" "#define HAVE_PIDFD_OPEN 1" >>confdefs.h
-
-fi
-ac_fn_c_check_func "$LINENO" "pidfd_getfd" "ac_cv_func_pidfd_getfd"
-if test "x$ac_cv_func_pidfd_getfd" = xyes
-then :
- printf "%s\n" "#define HAVE_PIDFD_GETFD 1" >>confdefs.h
-
-fi
-ac_fn_c_check_func "$LINENO" "pidfd_send_signal" "ac_cv_func_pidfd_send_signal"
-if test "x$ac_cv_func_pidfd_send_signal" = xyes
-then :
- printf "%s\n" "#define HAVE_PIDFD_SEND_SIGNAL 1" >>confdefs.h
-
fi
ac_fn_c_check_func "$LINENO" "pipe" "ac_cv_func_pipe"
if test "x$ac_cv_func_pipe" = xyes
@@ -22101,6 +22059,299 @@ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getdents64" >&5
+printf %s "checking for getdents64... " >&6; }
+if test ${ac_cv_func_getdents64+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <dirent.h>
+int
+main (void)
+{
+(void)getdents64
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_func_getdents64=yes
+else case e in #(
+ e) ac_cv_func_getdents64=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getdents64"
>&5
+printf "%s\n" "$ac_cv_func_getdents64" >&6; }
+ if test "x$ac_cv_func_getdents64" = xyes
+then :
+
+printf "%s\n" "#define _Py_HAVE_GETDENTS64 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettid" >&5
+printf %s "checking for gettid... " >&6; }
+if test ${ac_cv_func_gettid+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+int
+main (void)
+{
+(void)gettid
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_func_gettid=yes
+else case e in #(
+ e) ac_cv_func_gettid=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_gettid" >&5
+printf "%s\n" "$ac_cv_func_gettid" >&6; }
+ if test "x$ac_cv_func_gettid" = xyes
+then :
+
+printf "%s\n" "#define _Py_HAVE_GETTID 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for if_indextoname"
>&5
+printf %s "checking for if_indextoname... " >&6; }
+if test ${ac_cv_func_if_indextoname+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <net/if.h>
+int
+main (void)
+{
+(void)if_indextoname
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_func_if_indextoname=yes
+else case e in #(
+ e) ac_cv_func_if_indextoname=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_func_if_indextoname" >&5
+printf "%s\n" "$ac_cv_func_if_indextoname" >&6; }
+ if test "x$ac_cv_func_if_indextoname" = xyes
+then :
+
+printf "%s\n" "#define _Py_HAVE_IF_INDEXTONAME 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for if_nametoindex"
>&5
+printf %s "checking for if_nametoindex... " >&6; }
+if test ${ac_cv_func_if_nametoindex+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <net/if.h>
+int
+main (void)
+{
+(void)if_nametoindex
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_func_if_nametoindex=yes
+else case e in #(
+ e) ac_cv_func_if_nametoindex=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_func_if_nametoindex" >&5
+printf "%s\n" "$ac_cv_func_if_nametoindex" >&6; }
+ if test "x$ac_cv_func_if_nametoindex" = xyes
+then :
+
+printf "%s\n" "#define _Py_HAVE_IF_NAMETOINDEX 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pidfd_open" >&5
+printf %s "checking for pidfd_open... " >&6; }
+if test ${ac_cv_func_pidfd_open+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/pidfd.h>
+int
+main (void)
+{
+(void)pidfd_open
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_func_pidfd_open=yes
+else case e in #(
+ e) ac_cv_func_pidfd_open=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_pidfd_open"
>&5
+printf "%s\n" "$ac_cv_func_pidfd_open" >&6; }
+ if test "x$ac_cv_func_pidfd_open" = xyes
+then :
+
+printf "%s\n" "#define _Py_HAVE_PIDFD_OPEN 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pidfd_getfd" >&5
+printf %s "checking for pidfd_getfd... " >&6; }
+if test ${ac_cv_func_pidfd_getfd+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/pidfd.h>
+int
+main (void)
+{
+(void)pidfd_getfd
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_func_pidfd_getfd=yes
+else case e in #(
+ e) ac_cv_func_pidfd_getfd=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_pidfd_getfd"
>&5
+printf "%s\n" "$ac_cv_func_pidfd_getfd" >&6; }
+ if test "x$ac_cv_func_pidfd_getfd" = xyes
+then :
+
+printf "%s\n" "#define _Py_HAVE_PIDFD_GETFD 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for
pidfd_send_signal" >&5
+printf %s "checking for pidfd_send_signal... " >&6; }
+if test ${ac_cv_func_pidfd_send_signal+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/pidfd.h>
+int
+main (void)
+{
+(void)pidfd_send_signal
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ ac_cv_func_pidfd_send_signal=yes
+else case e in #(
+ e) ac_cv_func_pidfd_send_signal=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_func_pidfd_send_signal" >&5
+printf "%s\n" "$ac_cv_func_pidfd_send_signal" >&6; }
+ if test "x$ac_cv_func_pidfd_send_signal" = xyes
+then :
+
+printf "%s\n" "#define _Py_HAVE_PIDFD_SEND_SIGNAL 1" >>confdefs.h
+
+fi
+
+
+
+
+
# os.statx uses Linux's statx function. AIX also has a function named statx,
# but it's unrelated. Check only on Linux (including Android).
case $ac_sys_system in #(
diff --git a/configure.ac b/configure.ac
index d654f680643041c..2be6d852c6e977a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5757,15 +5757,15 @@ AC_CHECK_FUNCS([ \
copy_file_range ctermid dladdr dup explicit_bzero explicit_memset \
faccessat fchmod fchmodat fchown fchownat fdopendir fdwalk fexecve \
fpathconf fstatat ftruncate futimens futimes futimesat \
- gai_strerror getdents64 getegid geteuid getgid getgrent getgrgid getgrgid_r \
+ gai_strerror getegid geteuid getgid getgrent getgrgid getgrgid_r \
getgrnam_r getgrouplist gethostname getitimer getloadavg getlogin getlogin_r
\
getpeername getpgid getpid getppid getpriority _getpty \
getpwent getpwnam_r getpwuid getpwuid_r getresgid getresuid getrusage getsid
\
- gettid getuid grantpt if_indextoname if_nameindex \
- if_nametoindex initgroups kill killpg lchown linkat \
+ getuid grantpt if_nameindex \
+ initgroups kill killpg lchown linkat \
lockf lstat lutimes madvise mbrtowc memrchr mkdirat mkfifo mkfifoat \
mknod mknodat mktime mmap mremap nice openat opendir pathconf pause \
- pidfd_open pidfd_getfd pidfd_send_signal pipe \
+ pipe \
plock poll ppoll posix_fadvise posix_fallocate posix_openpt \
pread preadv preadv2 process_vm_readv \
pthread_cond_timedwait_relative_np pthread_condattr_setclock pthread_init \
@@ -5788,7 +5788,13 @@ PY_CHECK_FUNC_PRIVATE([freadlink], [@%:@include
<unistd.h>])
PY_CHECK_FUNC_PRIVATE([strerror_r], [@%:@include <string.h>])
# FreeBSD pthread_attr_get_np()
PY_CHECK_FUNC_PRIVATE([pthread_attr_get_np], [@%:@include <pthread_np.h>])
-
+PY_CHECK_FUNC_PRIVATE([getdents64], [@%:@include <dirent.h>])
+PY_CHECK_FUNC_PRIVATE([gettid], [@%:@include <unistd.h>])
+PY_CHECK_FUNC_PRIVATE([if_indextoname], [@%:@include <net/if.h>])
+PY_CHECK_FUNC_PRIVATE([if_nametoindex], [@%:@include <net/if.h>])
+PY_CHECK_FUNC_PRIVATE([pidfd_open], [@%:@include <sys/pidfd.h>])
+PY_CHECK_FUNC_PRIVATE([pidfd_getfd], [@%:@include <sys/pidfd.h>])
+PY_CHECK_FUNC_PRIVATE([pidfd_send_signal], [@%:@include <sys/pidfd.h>])
# os.statx uses Linux's statx function. AIX also has a function named statx,
# but it's unrelated. Check only on Linux (including Android).
diff --git a/pyconfig.h.in b/pyconfig.h.in
index dba7d193bcb3d19..18534d7e80e3893 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -552,9 +552,6 @@
/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
#undef HAVE_GETC_UNLOCKED
-/* Define to 1 if you have the 'getdents64' function. */
-#undef HAVE_GETDENTS64
-
/* Define to 1 if you have the 'getegid' function. */
#undef HAVE_GETEGID
@@ -684,9 +681,6 @@
/* Define if you have the 'getsockname' function. */
#undef HAVE_GETSOCKNAME
-/* Define to 1 if you have the 'gettid' function. */
-#undef HAVE_GETTID
-
/* Define to 1 if you have the 'getuid' function. */
#undef HAVE_GETUID
@@ -705,15 +699,9 @@
/* Define to 1 if you have the <iconv.h> header file. */
#undef HAVE_ICONV_H
-/* Define to 1 if you have the 'if_indextoname' function. */
-#undef HAVE_IF_INDEXTONAME
-
/* Define to 1 if you have the 'if_nameindex' function. */
#undef HAVE_IF_NAMEINDEX
-/* Define to 1 if you have the 'if_nametoindex' function. */
-#undef HAVE_IF_NAMETOINDEX
-
/* Define if you have the 'inet_aton' function. */
#undef HAVE_INET_ATON
@@ -1009,15 +997,6 @@
/* Define to 1 if you have the 'pause' function. */
#undef HAVE_PAUSE
-/* Define to 1 if you have the 'pidfd_getfd' function. */
-#undef HAVE_PIDFD_GETFD
-
-/* Define to 1 if you have the 'pidfd_open' function. */
-#undef HAVE_PIDFD_OPEN
-
-/* Define to 1 if you have the 'pidfd_send_signal' function. */
-#undef HAVE_PIDFD_SEND_SIGNAL
-
/* Define to 1 if you have the 'pipe' function. */
#undef HAVE_PIPE
@@ -2151,13 +2130,34 @@
/* Define if you have the 'freadlink' function. */
#undef _Py_HAVE_FREADLINK
+/* Define if you have the 'getdents64' function. */
+#undef _Py_HAVE_GETDENTS64
+
+/* Define if you have the 'gettid' function. */
+#undef _Py_HAVE_GETTID
+
/* Define if you have a working iconv() function. */
#undef _Py_HAVE_ICONV
+/* Define if you have the 'if_indextoname' function. */
+#undef _Py_HAVE_IF_INDEXTONAME
+
+/* Define if you have the 'if_nametoindex' function. */
+#undef _Py_HAVE_IF_NAMETOINDEX
+
/* Define to 1 if libgcc __register_frame and __deregister_frame are linkable.
*/
#undef _Py_HAVE_LIBGCC_EH_FRAME_REGISTRATION
+/* Define if you have the 'pidfd_getfd' function. */
+#undef _Py_HAVE_PIDFD_GETFD
+
+/* Define if you have the 'pidfd_open' function. */
+#undef _Py_HAVE_PIDFD_OPEN
+
+/* Define if you have the 'pidfd_send_signal' function. */
+#undef _Py_HAVE_PIDFD_SEND_SIGNAL
+
/* Define if you have the 'PR_SET_VMA_ANON_NAME' constant. */
#undef _Py_HAVE_PR_SET_VMA_ANON_NAME
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]