Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: PID after fork && exit

by Abigail-II (Bishop)
on May 12, 2003 at 20:23 UTC ( [id://257555]=note: print w/replies, xml ) Need Help??


in reply to Re: PID after fork && exit
in thread PID after fork && exit

That's very confusing what you write.

If fork fails, undef is returned. If fork succeeds, different values are returned in the parent and the child. In the child, fork returns 0, while in the parent, the process ID of child is returned. This is the only convenient time for the parent to get the process ID of the child. A parent can get the process ID of the child when it's reaping the child with some form of wait call, but then the child has already finished. Otherwise, the parents rests nothing else than walking the process list.

Abigail

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-18 23:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found