Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Modules/_posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
bytes = getdents64(fd_dir_fd, buffer, sizeof(buffer));
#else
bytes = syscall(SYS_getdents64, fd_dir_fd,
Expand Down
8 changes: 4 additions & 4 deletions Modules/clinic/posixmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Modules/clinic/signalmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Modules/clinic/socketmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -10863,7 +10863,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]
Expand All @@ -10881,7 +10881,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);
Expand All @@ -10894,7 +10894,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]
Expand All @@ -10915,7 +10915,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);
Expand Down
4 changes: 2 additions & 2 deletions Modules/signalmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,14 +635,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):
Expand Down Expand Up @@ -7424,7 +7424,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
Expand Down Expand Up @@ -7454,9 +7454,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
Expand All @@ -7481,7 +7481,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
Expand Down
2 changes: 1 addition & 1 deletion Python/perf_jit_trampoline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Python/thread_pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down Expand Up @@ -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__)
Expand Down
1 change: 1 addition & 0 deletions Tools/build/check_capi_macros.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 0 additions & 7 deletions Tools/build/check_capi_macros_ignored.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ HAVE_GDBM_H
HAVE_GDBM_NDBM_H
HAVE_GETADDRINFO
HAVE_GETC_UNLOCKED
HAVE_GETDENTS64
HAVE_GETEGID
HAVE_GETENTROPY
HAVE_GETEUID
Expand Down Expand Up @@ -285,7 +284,6 @@ HAVE_GETSID
HAVE_GETSOCKNAME
HAVE_GETSPENT
HAVE_GETSPNAM
HAVE_GETTID
HAVE_GETUID
HAVE_GETWD
HAVE_GLIBC_MEMMOVE_BUG
Expand All @@ -294,9 +292,7 @@ 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
Expand Down Expand Up @@ -397,9 +393,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
Expand Down
Loading
Loading