in reply to Re^3: Testing whether a process has finished
in thread Testing whether a process has finished

but there is no description of what the possible value of these flags might be...

From the docs (emphasis mine),

If you say "$kid = waitpid(-1, WNOHANG);", then you can do a non-blocking wait