[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <69E17223-F0CA-4A4C-AAD7-065D6E6266D9@linux.alibaba.com>
Date: Thu, 22 Sep 2022 17:11:12 +0800
From: cambda@...ux.alibaba.com
To: "Eric W. Biederman" <ebiederm@...ssion.com>,
linux-kernel@...r.kernel.org
Cc: linux-api@...r.kernel.org, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Dust Li <dust.li@...ux.alibaba.com>,
Tony Lu <tonylu@...ux.alibaba.com>,
Cambda Zhu <cambda@...ux.alibaba.com>
Subject: Syscall kill() can send signal to thread ID
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
Powered by blists - more mailing lists