X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlipc.pod;h=5f8af22550b298aa93b45578a52acf9a6976e7f2;hb=363c40c40eaf5d0cfd92f460a3f838c41f9756ad;hp=637030c7269487d4abc85e35932edf70955bba2e;hpb=9ce5b4ad89f76922e208c6d250bb5f1abd31555c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlipc.pod b/pod/perlipc.pod index 637030c..5f8af22 100644 --- a/pod/perlipc.pod +++ b/pod/perlipc.pod @@ -95,13 +95,22 @@ it doesn't kill itself): } Another interesting signal to send is signal number zero. This doesn't -actually affect another process, but instead checks whether it's alive +actually affect a child process, but instead checks whether it's alive or has changed its UID. unless (kill 0 => $kid_pid) { warn "something wicked happened to $kid_pid"; } +When directed at a process whose UID is not identical to that +of the sending process, signal number zero may fail because +you lack permission to send the signal, even though the process is alive. +You may be able to determine the cause of failure using C<%!>. + + unless (kill 0 => $pid or $!{EPERM}) { + warn "$pid looks dead"; + } + You might also want to employ anonymous functions for simple signal handlers: @@ -279,7 +288,7 @@ to find out whether anyone (or anything) has accidentally removed our fifo. sleep 2; # to avoid dup signals } -=head2 Deferred Signals (Safe signals) +=head2 Deferred Signals (Safe Signals) In Perls before Perl 5.7.3 by installing Perl code to deal with signals, you were exposing yourself to danger from two things. First,