[haiku-commits] Re: r34092 - haiku/trunk/src/libs/bsd

  • From: "François Revol" <revol@xxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 18 Nov 2009 00:24:44 +0100 CET

> 2009/11/17 François Revol <revol@xxxxxxx>:
> >> The usage gathered is either from the first child to change state
> > > (in
> >> the case of wait3()) or the specified pid (in the case of wait4).
> >
> > http://www.manpagez.com/man/2/getrusage/
> >
> > Getrusage() returns information describing the resources utilized
> > by
> > the current process, or *all* its terminated child processes.
>
> Attention to the details. :)
>
> RUSAGE_CHILDREN
>               Return resource usage statistics for all children of
> the calling
>               process that have terminated and been waited for.
>
> Key here is "terminated and waited for". I wait for only one specific
> children or any children.

That's unclear to me and I'm too lazy to write a test...

Is it reset to 0 on getrusage() return for the next wait*() ?

What if 2 threads are racing for wait4() ? :P

François.

Other related posts: