Lines Matching refs:pid
98 my $pid = 0;
101 $pid = 0 + <$pidfh>;
103 $pid = 0 if($pid < 0);
105 return $pid;
114 my $pid = Cygwin::winpid_to_pid($vpid - 65536);
115 if($pid) {
116 return $pid;
131 my $pid = $_[0];
133 if($pid > 0) {
135 $pid = winpid_to_pid($pid);
136 if ($pid > 65536 && os_is_win()) {
137 $pid -= 65536;
139 my $filter = "PID eq $pid";
142 if(index($result, "$pid") != -1) {
143 return -$pid;
150 if(kill(0, $pid)) {
151 return $pid;
162 my $pid = $_[0];
164 if($pid > 0) {
166 $pid = winpid_to_pid($pid);
167 if ($pid > 65536 && os_is_win()) {
168 $pid -= 65536;
171 my $cmd = "taskkill -t -pid $pid >nul 2>&1";
179 kill("TERM", $pid);
187 my $pid = $_[0];
189 if($pid > 0) {
191 $pid = winpid_to_pid($pid);
192 if ($pid > 65536 && os_is_win()) {
193 $pid -= 65536;
196 my $cmd = "taskkill -f -t -pid $pid >nul 2>&1";
204 kill("KILL", $pid);
212 my $pid = $_[0];
215 $pid = winpid_to_pid($pid);
217 if ($pid > 65536 && os_is_win()) {
219 return pidexists($pid)?0:$pid;
221 while(pidexists($pid)) {
224 return $pid;
228 return waitpid($pid, $flags);
244 my $pid = pidfromfile($pidfile);
246 if($pid > 0) {
248 if(pidexists($pid)) {
249 return $pid;
253 unlink($pidfile) if($pid == pidfromfile($pidfile));
255 pidwait($pid, &WNOHANG);
257 return -$pid;
293 my $pid = $1;
294 if($pid > 0) {
295 if(pidexists($pid)) {
296 print("RUN: Process with pid $pid signalled to die\n")
298 pidterm($pid);
299 push @signalled, $pid;
302 print("RUN: Process with pid $pid already dead\n")
305 pidwait($pid, &WNOHANG);
306 push @reapchild, $pid;
317 my $pid = $signalled[$i];
318 if(!pidexists($pid)) {
319 print("RUN: Process with pid $pid gracefully died\n")
323 pidwait($pid, &WNOHANG);
324 push @reapchild, $pid;
336 foreach my $pid (@signalled) {
337 if($pid > 0) {
338 print("RUN: Process with pid $pid forced to die with SIGKILL\n")
340 pidkill($pid);
342 pidwait($pid, &WNOHANG);
343 push @reapchild, $pid;
350 foreach my $pid (@reapchild) {
351 if($pid > 0) {
352 pidwait($pid, 0);
365 my $pid;
376 $pid = processexists($pidfile);
377 if($pid > 0) {
379 ($proto eq 'ftp')?'ctrl':'filt', $pid) if($verbose);
380 pidkill($pid);
381 pidwait($pid, 0);
390 $pid = processexists($pidfile);
391 if($pid > 0) {
393 $pid) if($verbose);
394 pidkill($pid);
395 pidwait($pid, 0);