Re: Children first in fork

Mark Kettenis
2001-04-20T14:58:36Z

The behaviour of CLONE_PTRACE in Linux 2.4.x is different from the
behaviour in 2.2.x. Linus is describing the 2.4.x. behaviour, where
the program that's doing the tracing will get the events instead of
the "real" parent. I believe the 2.2.x behaviour was pretty much
useless, and IIRC that was the reason that Linus accepted a patch for
the new behaviour. I've tested CLONE_PTRACE in the sense that the
development version of GDB contains some code that allows debugging of
any clone() based thread stuff if the threads implementationion
specifies CLONE_PTRACE in its clone() calls. That way GDB notices new
threads automagically. It only works on Linux 2.4.x of course, and I
still have to hack something up to make this functionality in GDB
available to the user.

Mark