waitpid(2) and CLONE_THREAD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

If a child is created by calling clone() with flags=0, it can successfully be
waitpid()'ed either by specifying its pid as returned by clone() or by pid=-1.

But if clone() is called with flags=(CLONE_THREAD | CLONE_SIGHAND | CLONE_VM),
waitpid() fails with ECHILD, no matter if it's called with or without __WALL or
__WCLONE flags, and even no matter if SIGCHLD is OR'ed explicitly with clone()'s
flags.

I've tried that on kernels 2.6.12 and 2.6.17, corresponding glibc's were with
LinuxThreads and NPTL.

Is it possible to wait for a child from the same thread group (i.e. having the
same PID and different TID)?

Thanks.

--
Sergey


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux