public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kurt Roeckx <Q@ping.be>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: linux-kernel@vger.kernel.org
Subject: Re: wait() and strace -f
Date: Tue, 18 Dec 2001 21:18:39 +0100	[thread overview]
Message-ID: <20011218211839.A4447@ping.be> (raw)
In-Reply-To: <20011218021407.A1595@ping.be> <877krlc60x.fsf@devron.myhome.or.jp>
In-Reply-To: <877krlc60x.fsf@devron.myhome.or.jp>; from hirofumi@mail.parknet.co.jp on Tue, Dec 18, 2001 at 04:59:58PM +0900

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


  parent reply	other threads:[~2001-12-18 20:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-18  1:14 wait() and strace -f Kurt Roeckx
2001-12-18 15:32 ` OGAWA Hirofumi
     [not found] ` <877krlc60x.fsf@devron.myhome.or.jp>
2001-12-18 20:18   ` Kurt Roeckx [this message]
2001-12-19 15:26     ` OGAWA Hirofumi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011218211839.A4447@ping.be \
    --to=q@ping.be \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox