lkml.org 
[lkml]   [2001]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: wait() and strace -f
    On Tue, Dec 18, 2001 at 04:59:58PM +0900, OGAWA Hirofumi wrote:
    > Kurt Roeckx <Q@ping.be> writes:
    >
    > > I think it's related to strace being the "real" parent of the
    > > child. But that doesn't really explain why I need 2 childs.
    >
    > Probably, it's feature (or bug) of strace. I'm seems, if strace has
    > child, trace of a child is started before wait() of parent. Then,
    > exit() of child continue wait() of parent.

    If I understand what you're saying, sleep(1) in child1, and
    sleep(2) in the parent should fix the problem, which it doesn't.

    And it still doesn't explain why it only happens with 2 childs.

    Maybe I should have mentioned this before: the wait will clean up
    the first child at the time the second child dies, or atleast
    that's what wait() returns.

    > > if (!fork())
    > > {
    > > /* Child 1. */
    > sleep(2);
    > > return 0;
    > > }
    >
    > The above change is continued the parent after 2 seconds.

    I know that too, as I said, only when child 1 dies before the
    parent calls wait().


    Kurt

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

    \
     
     \ /
      Last update: 2005-03-22 13:14    [W:0.022 / U:0.692 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site