[m-rev.] diff: move library changes on the mode-constraints branch onto trunk

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Feb 26 21:40:40 AEDT 2003


On 26-Feb-2003, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> @@ -26,14 +31,14 @@
>  #if 0
>  #include <sys/rusage.h>
>  #else
> -void getrusage(int, struct rusage *);
> +int getrusage(int, struct rusage *);
>  #endif

Posix specifies that rusage() should be declared in <sys/resource.h>.
So I think this whole #if ... #endif should be just deleted.
  
>  millisec milli_time(void)
>      {
>  	struct rusage p;
>  
> -	getrusage(RUSAGE_SELF, &p);
> +	(void) getrusage(RUSAGE_SELF, &p);
>  	return (millisec)(p.ru_utime.tv_sec * 1000) +
>  	       (millisec)(p.ru_utime.tv_usec / 1000);
>      }

The return value from getrusage() should be checked.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list