The DESCRIPTION says:
If *sig* is 0, then no signal is sent, but existence and
permission checks are still performed; this can be used to
check for the existence of a process ID.
On the other hand, the `RETURN VALUE` section contradicted that.
On success (at least one signal was sent), zero is returned. On
error, -1 is returned...
How can I get 0 when providing sig=0, if no signal was actually
sent, which is the criteria for success of this call???
Reported-by: Amit Pinhas <amitpinhass@gmail.com>
Co-authored-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Amit Pinhas <amitpinhass@gmail.com>
Message-ID: <
a4fa37e0fc89a3c99982ace3fe381991ebe85b00.
1739393685.git.amitpinhass@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
processes belong to the same session.
(Historically, the rules were different; see HISTORY.)
.SH RETURN VALUE
-On success (at least one signal was sent), zero is returned.
+On success, zero is returned.
+If signals were sent to a process group,
+success means that at least one signal was delivered.
On error, \-1 is returned, and
.I errno
is set to indicate the error.