From: Kir Kolyshkin <kolyshkin@gmail.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: Kir Kolyshkin <kolyshkin@gmail.com>,
linux-man@vger.kernel.org, Christian Brauner <brauner@kernel.org>,
Oleg Nesterov <oleg@redhat.com>
Subject: [PATCH 3/3] pidfd_send_signal.2: describe flags
Date: Mon, 8 Jul 2024 19:13:34 -0700 [thread overview]
Message-ID: <20240709021335.158849-4-kolyshkin@gmail.com> (raw)
In-Reply-To: <20240709021335.158849-1-kolyshkin@gmail.com>
Those flags were added in Linux 6.9 (see [1]), and are documented in
[2].
The text added is a modified version of [3], removing some repetition
and adapting from markdown to mandoc.
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e1fb1dc08e73
[2]: https://github.com/brauner/man-pages-md/blob/main/pidfd_send_signal.md
[3]: https://github.com/brauner/man-pages-md/pull/2
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
---
man/man2/pidfd_send_signal.2 | 53 ++++++++++++++++++++++++++++++++++--
1 file changed, 50 insertions(+), 3 deletions(-)
diff --git a/man/man2/pidfd_send_signal.2 b/man/man2/pidfd_send_signal.2
index c7aecbf96..11d81dbe2 100644
--- a/man/man2/pidfd_send_signal.2
+++ b/man/man2/pidfd_send_signal.2
@@ -77,8 +77,55 @@ .SH DESCRIPTION
.P
The
.I flags
-argument is reserved for future use;
-currently, this argument must be specified as 0.
+argument allows to modify the scope of the signal. By
+default, the scope of the signal will be inferred from the
+. I pidfd
+argument. For example, if
+.I pidfd
+refers to a specific thread, i.e., the
+.I pidfd
+was created through
+.BR pidfd_open (2)
+passing the
+.B PIDFD_THREAD
+flag
+or through
+.BR clone3 (2)
+using the
+.B CLONE_PIDFD
+flag together with the
+.B CLONE_THREAD
+flag, then passing
+.I pidfd to
+.BR pidfd_send_signal (2)
+and leaving the
+.I flags argument as
+.B 0
+will cause the signal to be sent to the specific thread referenced by the
+.I pidfd.
+.TP
+.BR PIDFD_SIGNAL_THREAD " (since Linux v6.9)"
+.\" commit e1fb1dc08e73466830612bcf2f9f72180965c9ba
+Ensure that the signal is sent to the specific thread referenced by
+.I pidfd.
+.TP
+.BR PIDFD_SIGNAL_THREAD_GROUP " (since Linux v6.9)"
+.\" commit e1fb1dc08e73466830612bcf2f9f72180965c9ba
+If
+.I pidfd
+refers to a thread-group leader, ensure that the signal is
+sent to the thread-group, even if
+.I pidfd
+was created to refer to a specific thread.
+.TP
+.BR PIDFD_SIGNAL_PROCESS_GROUP " (since Linux v6.9)"
+.\" commit e1fb1dc08e73466830612bcf2f9f72180965c9ba
+If
+.I pidfd
+refers to a process-group leader, ensure that the signal is
+sent to the process-group, even if
+.I pidfd
+was created to refer to a specific thread or to a thread-group leader.
.SH RETURN VALUE
On success,
.BR pidfd_send_signal ()
@@ -102,7 +149,7 @@ .SH ERRORS
.TP
.B EINVAL
.I flags
-is not 0.
+is not valid.
.TP
.B EPERM
The calling process does not have permission to send the signal
--
2.45.2
next prev parent reply other threads:[~2024-07-09 2:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 2:13 [PATCH 0/3] man2: document Linux v6.9 pidfd-related changes Kir Kolyshkin
2024-07-09 2:13 ` [PATCH 1/3] clone.2: document CLONE_PIDFD | CLONE_THREAD Kir Kolyshkin
2024-07-09 2:13 ` [PATCH 2/3] pidfd_open.2: add PIDFD_THREAD and poll nuances Kir Kolyshkin
2024-07-09 9:42 ` Oleg Nesterov
2024-07-09 22:06 ` Kirill Kolyshkin
2024-07-09 22:25 ` Oleg Nesterov
2024-07-09 2:13 ` Kir Kolyshkin [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-10-08 2:00 [PATCH v2 0/3] man2: document Linux v6.9 pidfd-related changes Kir Kolyshkin
2025-10-08 2:00 ` [PATCH 3/3] pidfd_send_signal.2: describe flags Kir Kolyshkin
2025-10-29 11:14 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240709021335.158849-4-kolyshkin@gmail.com \
--to=kolyshkin@gmail.com \
--cc=alx@kernel.org \
--cc=brauner@kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=oleg@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox