linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Syscall kill() can send signal to thread ID
@ 2022-09-22  9:11 cambda
  2022-09-22 15:09 ` Eric W. Biederman
  2022-09-22 15:33 ` Eric W. Biederman
  0 siblings, 2 replies; 12+ messages in thread
From: cambda @ 2022-09-22  9:11 UTC (permalink / raw)
  To: Eric W. Biederman, linux-kernel
  Cc: linux-api, Xuan Zhuo, Dust Li, Tony Lu, Cambda Zhu

I found syscall kill() can send signal to a thread id, which is
not the TGID. But the Linux manual page kill(2) said:

"The kill() system call can be used to send any signal to any
process group or process."

And the Linux manual page tkill(2) said:

"tgkill() sends the signal sig to the thread with the thread ID
tid in the thread group tgid.  (By contrast, kill(2) can be used
to send a signal only to a process (i.e., thread group) as a
whole, and the signal will be delivered to an arbitrary thread
within that process.)"

I don't know whether the meaning of this 'process' should be
the TGID? Because I found kill(tid, 0) will return ESRCH on FreeBSD,
while Linux sends signal to the thread group that the thread belongs
to.

If this is as expected, should we add a notice to the Linux manual
page? Because it's a syscall and the pids not equal to tgid are not
listed under /proc. This may be a little confusing, I guess.

Regards,
Cambda

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-09-24  3:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22  9:11 Syscall kill() can send signal to thread ID cambda
2022-09-22 15:09 ` Eric W. Biederman
2022-09-23  5:31   ` Florian Weimer
2022-09-23  6:25     ` cambda
2022-09-23  7:53       ` Florian Weimer
2022-09-23  8:40         ` Cambda Zhu
2022-09-23 21:15           ` Eric W. Biederman
2022-09-22 15:33 ` Eric W. Biederman
2022-09-23  3:56   ` cambda
2022-09-23 11:24     ` David Laight
2022-09-23 21:21     ` Eric W. Biederman
2022-09-24  3:16       ` Cambda Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).