> I also wonder if you really need both "int *retval" and the return value.
No.
Yes.
You listed the three possibilities for eligible_child().
For wait_consider_task(), there are four possibilities:
- all done, with error
- this thread was not eligible, look for another; return -ECHILD if none ready
- this thread was eligible but is not ready; return 0 or block if none ready
- all done, this thread is ready; return its pid
I'll post another version that I think you'll like a little better.
Thanks,
Roland
--