C<raise()>, i.e. it doesn't send a signal to the identified process
like it does on Unix platforms. Instead it immediately calls
C<TerminateProcess(process,signal)>. Thus the signal argument is
-used to set the exit-status of the terminated process. In particular,
-C<kill(0,$pid)> will kill the process identified by C<$pid> (unlike
-on Unix). This behavior may change in future.
+used to set the exit-status of the terminated process. However,
+a signal of 0 can be used to safely check if the specified process
+exists, as on Unix.
=item *
handles. kill() accepts any real process id, rather than strictly
return values from system(1,...).
+For better compatibility with Unix, C<kill(0, $pid)> can now be used to
+test whether a process exists.
+
The C<Shell> module is supported.
Rudimentary support for building under command.com in Windows 95
Not implemented, hence not useful for taint checking. (S<Mac OS>,
S<RISC OS>)
-Unlike Unix platforms, C<kill(0, $pid)> will actually terminate
-the process. (Win32)
+C<kill($sig, $pid)> makes the process exit immediately with exit
+status $sig. As in Unix, if $sig is 0 and the specified process exists,
+it returns true without actually terminating it. (Win32)
=item link OLDFILE,NEWFILE
/* it is a pseudo-forked child */
long child = find_pseudo_pid(-pid);
if (child >= 0) {
+ if (!sig)
+ return 0;
hProcess = w32_pseudo_child_handles[child];
if (TerminateThread(hProcess, sig)) {
remove_dead_pseudo_process(child);
{
long child = find_pid(pid);
if (child >= 0) {
+ if (!sig)
+ return 0;
hProcess = w32_child_handles[child];
if (TerminateProcess(hProcess, sig)) {
remove_dead_process(child);
}
else {
hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid);
- if (hProcess && TerminateProcess(hProcess, sig)) {
- CloseHandle(hProcess);
- return 0;
+ if (hProcess) {
+ if (!sig)
+ return 0;
+ if (TerminateProcess(hProcess, sig)) {
+ CloseHandle(hProcess);
+ return 0;
+ }
}
}
}