[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: daily snapshot make note



On Fri, 26 Jun 1998, Lloyd Wood wrote:

> mem-trace.h: In method `MemTrace::MemTrace()':
> In file included from scheduler.cc:47:
> mem-trace.h:37: warning: implicit declaration of function `int
> getrusage(...)'
> [..]
> mem-trace.h: In method `MemTrace::MemTrace(...)':
> In file included from tclAppInit.cc:78:
> mem-trace.h:37: warning: implicit declaration of function `int
> getrusage(...)'
> 
> ...and that's it. Under Solaris rusage is defined in <sys/rusage.h>
> according to man rusage [rusage(1B)  (SunOS/BSD Compatibility Package
> Commands)], but since that header file is not in our /usr/include/sys
> directory on any of our Solaris 2.5.1 or 2.4 machines,

rusage.h (below) is in /usr/ucbinclude/sys on Solaris...

...and only includes the rusage struct. Very odd - so
-I /usr/ucbinclude/ and
#include <sys/rusage.h> don't do the trick by themselves unless the
getrusage is defined in mem-trace.h anyway.

I'm told getrlimit() is the Portable Way To Go.

Cheers,

L.

<[email protected]>PGP<http://www.sat-net.com/L.Wood/>+44-1483-300800x3641

rusage.h:
/*
 *	Copyright (c) 1991, by Sun Microsystems, Inc.
 */

#ident	"@(#)rusage.h	1.1	91/12/04 SMI"

#ifndef _SYS_RUSAGE_H
#define _SYS_RUSAGE_H

/*
 * Resource utilization information.
 */

#define	RUSAGE_SELF	0
#define	RUSAGE_CHILDREN	-1

struct	rusage {
	struct timeval ru_utime;	/* user time used */
	struct timeval ru_stime;	/* system time used */
	long	ru_maxrss;
#define	ru_first	ru_ixrss
	long	ru_ixrss;		/* XXX: 0 */
	long	ru_idrss;		/* XXX: sum of rm_asrss */
	long	ru_isrss;		/* XXX: 0 */
	long	ru_minflt;		/* any page faults not requiring I/O */
	long	ru_majflt;		/* any page faults requiring I/O */
	long	ru_nswap;		/* swaps */
	long	ru_inblock;		/* block input operations */
	long	ru_oublock;		/* block output operations */
	long	ru_msgsnd;		/* messages sent */
	long	ru_msgrcv;		/* messages received */
	long	ru_nsignals;		/* signals received */
	long	ru_nvcsw;		/* voluntary context switches */
	long	ru_nivcsw;		/* involuntary " */
#define	ru_last		ru_nivcsw
};

#endif /* _SYS_RUSAGE_H */