Skip to content

gh-157695: Rename HAVE_GETDENTS64 to _Py_HAVE_GETDENTS64 - #162184

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:rename_gettid_macro2
Nov 18, 2026
Merged

vstinner merged 1 commit into
python:mainfrom
vstinner:rename_gettid_macro2

Conversation

@vstinner

@vstinner vstinner commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

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.

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.
@vstinner

Copy link
Copy Markdown
Member Author

This PR replaces the old PR gh-157939. The previous PR called PY_CHECK_FUNC_PRIVATE() without specifying the header file in configure.ac, which risks of not detecting a function which would be available otherwise.

In this PR, PY_CHECK_FUNC_PRIVATE() is now called with the related header file. I checked that on Linux, the 7 functions are still detected.

@vstinner
vstinner merged commit 4b8e534 into python:main Nov 18, 2026
61 checks passed
@vstinner
vstinner deleted the rename_gettid_macro2 branch November 18, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant