Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to kill a process after calling fork?

by chromatic (Archbishop)
on Jun 20, 2000 at 05:56 UTC ( [id://18930]=note: print w/replies, xml ) Need Help??


in reply to How to kill a process after calling fork?

In the parent, if the fork call succeeds, $pid will contain the process ID of the child. You can then use the kill command to send any sort of signal to it (as you know the PID).
my $pid = fork(); if ($pid == 0) { # we're the child # exec something or other } else { sleep 10; # give the child a chance kill 1, $pid; # nighty-night }
Something along those lines will suffice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://18930]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-20 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found