pkill(1): Add option -T to restrict to current terminal
This option is introduced for feature parity with killall(1) where it
restricts to matching processes in the current terminal by specifying
the -T option. While this is achievable via pkill(1)'s -t option, for
feature parity and convenience, this commit implements the -T option.
Signed-off-by: Levente Kurusa <lkurusa@kernelstuff.org>
(aly)
I've reviewed and revised the original patch:
* Adjust the option orders in code and in the man page.
* Check and copy the return of ttyname(), which can be NULL and is a
internal static buffer.
* Make option '-t' accept a full path to the terminal device. This
simplifies the code by avoiding the strip of "/dev/". Meanwhile
update the man page accordingly.
* Fix some minor issues in the original patch.
DragonFly-bug: #3163