Re: Allow signaling a process by all its thread ids?

From: Chris Friesen
Date: Thu May 21 2009 - 18:57:23 EST


Simon Holm Thøgersen wrote:
> There is a bug report at https://bugs.launchpad.net/bugs/341239 where
> the question is asked. Should it be possible to signal a process with
> kill(2) by passing any of the thread ids belong to the process as
> argument to kill?

Based on POSIX, from the perspective of the kernel I think that a tid
that is not a tgid should result in ESRCH for the kill() syscall.

Such a tid would however be valid for the tgkill or tkill syscalls.

Makes sense to me. I suspect such a change would break a lot of
not-strictly-compliant programs though.

In the meantime, the pid file scenario could be modified to store both
the tid and pid (using userspace terminology now) and use the tgkill()
syscall. It should be noted that tgkill() is linux-specific.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/