I have an application that is multithreaded - one thread is responsible for collecting the dead children with wait(), anther thread spawns them with fork upon request.
I found out that on one platform with 2.4 kernel and LinuxThread wait always fails with ECHILD. I've found out that problem might be in non-POSIX compliant implementation of LinuxThreads on 2.4 kernel and the following discussion suggests that there is no way how this could be solved.
Still I'd like to be sure that nobody knows about any solution. Even patch for the kernel would be acceptable.
When I think about the application design I don't think it could be possible to do both fork() and wait() in a single thread (or only with enormous effort)