mirror of https://github.com/python/cpython
[3.13] gh-123014: Disable pidfd API on older Android versions (GH-124458) (#124543)
gh-123014: Disable pidfd API on older Android versions (#124458)
(cherry picked from commit c58c572a65
)
This commit is contained in:
parent
9f2e6ca199
commit
9f5b921491
|
@ -4572,7 +4572,7 @@ written in Python, such as a mail server's external command delivery program.
|
|||
|
||||
See the :manpage:`pidfd_open(2)` man page for more details.
|
||||
|
||||
.. availability:: Linux >= 5.3
|
||||
.. availability:: Linux >= 5.3, Android >= :func:`build-time <sys.getandroidapilevel>` API level 31
|
||||
.. versionadded:: 3.9
|
||||
|
||||
.. data:: PIDFD_NONBLOCK
|
||||
|
|
|
@ -411,7 +411,7 @@ The :mod:`signal` module defines the following functions:
|
|||
|
||||
See the :manpage:`pidfd_send_signal(2)` man page for more information.
|
||||
|
||||
.. availability:: Linux >= 5.1
|
||||
.. availability:: Linux >= 5.1, Android >= :func:`build-time <sys.getandroidapilevel>` API level 31
|
||||
.. versionadded:: 3.9
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
:func:`os.pidfd_open` and :func:`signal.pidfd_send_signal` are now
|
||||
unavailable when building against Android API levels older than 31, since
|
||||
the underlying system calls may cause a crash.
|
|
@ -5954,7 +5954,7 @@ os_wait(PyObject *module, PyObject *Py_UNUSED(ignored))
|
|||
|
||||
#endif /* defined(HAVE_WAIT) */
|
||||
|
||||
#if (defined(__linux__) && defined(__NR_pidfd_open))
|
||||
#if (defined(__linux__) && defined(__NR_pidfd_open) && !(defined(__ANDROID__) && __ANDROID_API__ < 31))
|
||||
|
||||
PyDoc_STRVAR(os_pidfd_open__doc__,
|
||||
"pidfd_open($module, /, pid, flags=0)\n"
|
||||
|
@ -6013,7 +6013,7 @@ exit:
|
|||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* (defined(__linux__) && defined(__NR_pidfd_open)) */
|
||||
#endif /* (defined(__linux__) && defined(__NR_pidfd_open) && !(defined(__ANDROID__) && __ANDROID_API__ < 31)) */
|
||||
|
||||
#if defined(HAVE_SETNS)
|
||||
|
||||
|
@ -12819,4 +12819,4 @@ os__is_inputhook_installed(PyObject *module, PyObject *Py_UNUSED(ignored))
|
|||
#ifndef OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF
|
||||
#define OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF
|
||||
#endif /* !defined(OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF) */
|
||||
/*[clinic end generated code: output=6a1d88bd90c7a28b input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=b2ffb856bcada7c9 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -670,7 +670,7 @@ exit:
|
|||
|
||||
#endif /* defined(HAVE_PTHREAD_KILL) */
|
||||
|
||||
#if (defined(__linux__) && defined(__NR_pidfd_send_signal))
|
||||
#if (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"
|
||||
|
@ -723,7 +723,7 @@ exit:
|
|||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* (defined(__linux__) && defined(__NR_pidfd_send_signal)) */
|
||||
#endif /* (defined(__linux__) && defined(__NR_pidfd_send_signal) && !(defined(__ANDROID__) && __ANDROID_API__ < 31)) */
|
||||
|
||||
#ifndef SIGNAL_ALARM_METHODDEF
|
||||
#define SIGNAL_ALARM_METHODDEF
|
||||
|
@ -776,4 +776,4 @@ exit:
|
|||
#ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
|
||||
#define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
|
||||
#endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */
|
||||
/*[clinic end generated code: output=6d8e17a32cef668f input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=c57b4b98fad6f4b8 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -10102,7 +10102,10 @@ os_wait_impl(PyObject *module)
|
|||
}
|
||||
#endif /* HAVE_WAIT */
|
||||
|
||||
#if defined(__linux__) && defined(__NR_pidfd_open)
|
||||
|
||||
// This system call always crashes on older Android versions.
|
||||
#if defined(__linux__) && defined(__NR_pidfd_open) && \
|
||||
!(defined(__ANDROID__) && __ANDROID_API__ < 31)
|
||||
/*[clinic input]
|
||||
os.pidfd_open
|
||||
pid: pid_t
|
||||
|
|
|
@ -1299,7 +1299,9 @@ signal_pthread_kill_impl(PyObject *module, unsigned long thread_id,
|
|||
#endif /* #if defined(HAVE_PTHREAD_KILL) */
|
||||
|
||||
|
||||
#if defined(__linux__) && defined(__NR_pidfd_send_signal)
|
||||
// This system call always crashes on older Android versions.
|
||||
#if defined(__linux__) && defined(__NR_pidfd_send_signal) && \
|
||||
!(defined(__ANDROID__) && __ANDROID_API__ < 31)
|
||||
/*[clinic input]
|
||||
signal.pidfd_send_signal
|
||||
|
||||
|
|
Loading…
Reference in New Issue