On Mon, Nov 24, 2003 at 01:19:21AM +0000, Jez Hancock wrote:

> - for each pid, send a CHLD signal to the pid

Careful -- not all processes will be set up to deal with SIGCHLD, and
some of them will be set up to deal with it in ways that don't meet
your expectations.

You can use signal '0' to test if a process of a given PID exists,
without obnoxious side effects:

    % kill -0 $$
    % echo $?
    % kill -0 999
    999: No such process
    % echo $?

However you need to be careful as kill is a shell built-in in many
shells -- tcsh(1) has a built-in but it behaves just like /bin/kill in
this case.  sh(1) and bash(1) seem not to use a built-in.



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to