Re: Children first in fork

Linus Torvalds
2001-04-19T17:59:19Z

In article <9bn3sr$fer$1@picard.cistron.nl>,
Wichert Akkerman <wichert@cistron.nl> wrote:
>
>What you can do is what strace does: insert a loop instruction after
>the fork or clone call and remove that when the call returns.

You're probably even better off just intercepting the fork, turning it
into a clone, and setting the CLONE_PTRACE option. Which (together with
tracing the parent, which you will obviously be doing already in order
to do all this in the first place) will nicely cause the child to get an
automatic SIGSTOP _and_ be already traced.

Not that I've tested it myself.

Linus