Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "echo | ps -j $(:) | cat | cat | cat" runs components in different process groups



On Mon, 23 Apr 2018 15:03:12 +0100
Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> The main reason I didn't do this is the effect of killpg with signal 0
> isn't actually defined in the Linu man pages or as far as I can see in
> POSIX. But we do this elsewhere so presumably it's a well-known fact
> this works...

After enough poking in manuals, this certainly looks pukka on Linux...

"man killpg" sez

       On  Linux, killpg() is implemented as a library function that makes the
       call kill(-pgrp, sig).

and "man 2 kill" sez

       If  sig  is 0, then no signal is sent, but error checking is still per‐
       formed; this can be used to check for the existence of a process ID  or
       process group ID.

Given it's already all over the shell it's obviously the right thing to
do here, too.

pws



Messages sorted by: Reverse Date, Date, Thread, Author