summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2019-11-20 04:39:14 (GMT)
committerGitHub <noreply@github.com>2019-11-20 04:39:14 (GMT)
commit7483451577916e693af6d20cf520b2cc7e2174d2 (patch)
tree54fdd671a4513a4cf938f1438ce53823909b02db /Doc
parentbe143ec99674ba38c5811f34cdb85ef39c2dc8f8 (diff)
downloadcpython-7483451577916e693af6d20cf520b2cc7e2174d2.zip
cpython-7483451577916e693af6d20cf520b2cc7e2174d2.tar.gz
cpython-7483451577916e693af6d20cf520b2cc7e2174d2.tar.bz2
closes bpo-38712: Add signal.pidfd_send_signal. (GH-17070)
This exposes a Linux-specific syscall for sending a signal to a process identified by a file descriptor rather than a pid. For simplicity, we don't support the siginfo_t parameter to the syscall. This parameter allows implementing a pidfd version of rt_sigqueueinfo(2), which Python also doesn't support.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/signal.rst13
-rw-r--r--Doc/whatsnew/3.9.rst7
2 files changed, 20 insertions, 0 deletions
diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst
index 8fecc2b..a79fc50 100644
--- a/Doc/library/signal.rst
+++ b/Doc/library/signal.rst
@@ -247,6 +247,19 @@ The :mod:`signal` module defines the following functions:
.. versionadded:: 3.8
+.. function:: pidfd_send_signal(pidfd, sig, siginfo=None, flags=0)
+
+ Send signal *sig* to the process referred to by file descriptor *pidfd*.
+ Python does not currently support the *siginfo* parameter; it must be
+ ``None``. The *flags* argument is provided for future extensions; no flag
+ values are currently defined.
+
+ See the :manpage:`pidfd_send_signal(2)` man page for more information.
+
+ .. availability:: Linux 5.1+
+ .. versionadded:: 3.9
+
+
.. function:: pthread_kill(thread_id, signalnum)
Send the signal *signalnum* to the thread *thread_id*, another thread in the
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index ddb295f..ce1d3e0 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -197,6 +197,13 @@ now raises :exc:`ImportError` instead of :exc:`ValueError` for invalid relative
import attempts.
(Contributed by Ngalim Siregar in :issue:`37444`.)
+signal
+------
+
+Exposed the Linux-specific :func:`signal.pidfd_send_signal` for sending to
+signals to a process using a file descriptor instead of a pid. (:issue:`38712`)
+
+
Optimizations
=============