Re: Children first in fork

2001-04-20 Thread Linus Torvalds
On Fri, 20 Apr 2001, Mark Kettenis wrote: >I believe the 2.2.x behaviour was pretty much > useless, No. 2.2.x is not useless, it is apparently _buggy_ in this regard. Some of the fixes in the 2.3.x timeframe seem to not have made it into 2.2.x. Linus - To unsub

Re: Children first in fork

2001-04-20 Thread Linus Torvalds
On Fri, 20 Apr 2001, Xric Brunet wrote: > > Well, I tried that, and it doesn't work. I think you're using a buggy 2.2.x kernel. 2.4.x should do this right. Please give it a whirl. Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: Children first in fork

2001-04-20 Thread Mark Kettenis
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 t

Re: Children first in fork

2001-04-20 Thread Thomas Pornin
In article <9bn90l$anp$[EMAIL PROTECTED]> you write: > You're probably even better off just intercepting the fork, turning it > into a clone, and setting the CLONE_PTRACE option. Actually it is not that simple. The child process will be traced by its father, not the tracing program. The father mu

Re: Children first in fork

2001-04-20 Thread Éric Brunet
In ens.mailing-lists.linux-kernel, you wrote: >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)

Re: Children first in fork

2001-04-20 Thread Wichert Akkerman
In article <9bn90l$anp$[EMAIL PROTECTED]>, Linus Torvalds <[EMAIL PROTECTED]> wrote: >Not that I've tested it myself. I did a few months ago, it didn't work. Wichert. -- / Generally uninteresting signature - ignore at your con

Re: Children first in fork

2001-04-19 Thread Linus Torvalds
In article <9bn3sr$fer$[EMAIL PROTECTED]>, Wichert Akkerman <[EMAIL PROTECTED]> 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

Re: Children first in fork

2001-04-19 Thread Éric Brunet
In ens.mailing-lists.linux-kernel, you wrote: > It seems to me that what you really want is a fork option to create the >child in a suspended state. Yes, or a clone option (using ptrace, I can always change on the fly the fork system call into a clone system call and add whatever option I

RE: Children first in fork

2001-04-19 Thread David Schwartz
> Hello all, > > I have read on lwn.net that the patch that makes children run first after > a fork has been integrated in the latest pre-kernel. > > I am a little bit concerned by that, as I have begun to write a program > that monitors process using ptrace. The difficulty is to ptrace-attach >

Children first in fork

2001-04-19 Thread Éric Brunet
Hello all, I have read on lwn.net that the patch that makes children run first after a fork has been integrated in the latest pre-kernel. I am a little bit concerned by that, as I have begun to write a program that monitors process using ptrace. The difficulty is to ptrace-attach the child in a