lkml.org 
[lkml]   [1999]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: vfork (ptracing)
Linus Torvalds wrote:
>
> On the other hand, maybe it's a generic problem with strace - if it gets
> the child PID from the return value of "fork()", and attaches to it that
> way, that has two problems:
> - it won't work reliably even under normal fork(), as it's timing-
> dependent, and by the time strace has attached to the child the child
> might have already done several system calls.
> - it would fail completely with vfork(), as vfork() only returns after
> the child has execve'd

This is normally handled by putting a busy loop at EIP before you let the
system call execute. The parent returns, attaches to the busy looping child
and then removes the busy loop. It's ugly like hell but this is only one of
ptrace's nasty sides...

Ciao, ET.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.060 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site