pratik has asked for the wisdom of the Perl Monks concerning the following question:
It would return original parent's id that forked the child and pid of current parent. Any idea how to work around this problem ?use strict; my $pid = $$; print "My PID is $pid\n"; fork and exit; sleep 1 while -e "/proc/$pid/cwd"; print "My PPID is ", getppid, " after my parent is killed\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: getppid() returns cached value
by wazoox (Prior) on May 26, 2005 at 12:45 UTC | |
|
Re: getppid() returns cached value
by jasonk (Parson) on May 26, 2005 at 14:04 UTC | |
|
Re: getppid() returns cached value
by muntfish (Chaplain) on May 26, 2005 at 13:14 UTC | |
by pratik (Initiate) on May 26, 2005 at 13:32 UTC | |
|
Re: getppid() returns cached value
by Molt (Chaplain) on May 26, 2005 at 15:47 UTC |