Jerry Feldman wrote:
On 07/26/2009 05:52 AM, Per Jessen wrote:
I'm forking a process, then waiting to pick it up with
waitpid(-1,0,WNOHANG)
but waitpid() returns -1 and error 10: No child processes ??
I suspect this may be somehow system/kernel dependent, coz' I have such code in a few places and it has always worked just fine, i.e. returned 0 when no child existed or had exited.
I have a SIGCHLD signal handler, which just increments a counter. When the counter is >0, I call waitpid().
I obviously googled this, and came across a few hits, but nothing really useful.
I'm pretty sure that waitpid() will return -1 if executed after your signal handler.
Yeah, I think you're right - I've been going over my old code, and I have a check for errno!=ECHILD. /Per Jessen, Zürich -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org