Thursday, 18 August 2011

waitpid($childpid,0)

process is running: waitpid returns 0; $? is -1
process is exiting: waitpid returns pid; $? is actual exit code
process doesn't exist: waitpid returns -1; $? is -1

so we need $? when waitpid returns childpid
we need to grab $? separately from $ret=waitpid($childpid,0)
$ret will return 0, pid or -1

No comments:

Post a Comment

Tweets by @sriramperumalla