Bug#233589: waitpid fails to wait for termination of a process started from a different thread
On Wed, Feb 18, 2004 at 05:00:08PM -0500, Cris Sinnott wrote:
> Package:glibc
> Version:2.3.2-90
>
> Waitpid fails with errno 10 when called from a thread other than the one
> that started the process being waited on. This happens regardless of whether
> the threads were created with pthread_create() or clone() (see sample code).
>
> The man pages installed on my system (see uname -a below), indicate that
> libpthread/glibc support this behavior. From the LINUX NOTES section of the
> man page for waitpid(2):
>
> ... since Linux 2.4 a thread can, and by default will, wait on children of
> other threads in the same thread group...
>
> my system
> >uname -a
> Linux amd64 2.4.21-193-smp #1 SMP Thu Jan 22 16:52:24 UTC 2004 x86_64 x86_64
> x86_64 GNU/Linux
You have misinterpreted the man page. In fact, LinuxThreads threads
are not all in the same "thread group". This will work using NPTL and
a 2.6 kernel, but not otherwise.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
Reply to: