Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:func:`os.pidfd_open` and :func:`signal.pidfd_send_signal` are now
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these methods need addition annotations in the docs to highlight that they're not available?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, you can write "Android (API level 31 and newer)" in "Availability" of the modified functions.

unavailable when building against Android API levels older than 31, since
the underlying system calls may cause a crash.
6 changes: 3 additions & 3 deletions Modules/clinic/posixmodule.c.h

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

6 changes: 3 additions & 3 deletions Modules/clinic/signalmodule.c.h

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

5 changes: 4 additions & 1 deletion Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -10121,7 +10121,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
Expand Down
4 changes: 3 additions & 1 deletion Modules/signalmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading