[lkml]   [2001]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: wait() and strace -f
    On Tue, Dec 18, 2001 at 04:59:58PM +0900, OGAWA Hirofumi wrote:
    > Kurt Roeckx <> 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().


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

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