Change 20607 by [EMAIL PROTECTED] on 2003/08/10 20:44:23
Subject: Re: killing for vital signs [PATCH]
From: "John P. Linderman" <[EMAIL PROTECTED]>
Date: Sun, 10 Aug 2003 15:44:33 -0400 (EDT)
Message-Id: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/pod/perlfunc.pod#402 edit
... //depot/perl/pod/perlipc.pod#50 edit
Differences ...
==== //depot/perl/pod/perlfunc.pod#402 (text) ====
Index: perl/pod/perlfunc.pod
--- perl/pod/perlfunc.pod#401~20242~ Sun Jul 27 13:21:40 2003
+++ perl/pod/perlfunc.pod Sun Aug 10 13:44:23 2003
@@ -2378,7 +2378,7 @@
kill 9, @goners;
If SIGNAL is zero, no signal is sent to the process. This is a
-useful way to check that the process is alive and hasn't changed
+useful way to check that a child process is alive and hasn't changed
its UID. See L<perlport> for notes on the portability of this
construct.
@@ -2386,7 +2386,9 @@
process groups instead of processes. (On System V, a negative I<PROCESS>
number will also kill process groups, but that's not portable.) That
means you usually want to use positive not negative signals. You may also
-use a signal name in quotes. See L<perlipc/"Signals"> for details.
+use a signal name in quotes.
+
+See L<perlipc/"Signals"> for more details.
=item last LABEL
==== //depot/perl/pod/perlipc.pod#50 (text) ====
Index: perl/pod/perlipc.pod
--- perl/pod/perlipc.pod#49~20178~ Mon Jul 21 12:19:06 2003
+++ perl/pod/perlipc.pod Sun Aug 10 13:44:23 2003
@@ -95,11 +95,20 @@
}
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
End of Patch.