Tom Lane wrote:
> momjian(at)postgresql(dot)org (Bruce Momjian) writes:
> > Add include needed for new getrusage() call.
>
> If that's actually needed, how did the code build before? It's always
> included sys/resource.h, except possibly on machines without getrusage
> ... are there any? I was thinking rusagestub was dead code, myself.
Uh, all I know is that it started failing yesterday. The failure I got
was:
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-fno-strict-aliasing -O1 -Wall -Wmissing-prototypes
-Wmissing-declarations -Wpointer-arith -Wcast-align
-I../../../src/include -I/usr/local/include/readline
-I/usr/contrib/include -DWIN32_STACK_RLIMIT=4194304 -c -o postgres.o
postgres.c
In file included from postgres.c:31:
/usr/include/sys/resource.h:63: field `ru_utime' has incomplete type
/usr/include/sys/resource.h:64: field `ru_stime' has incomplete type
gmake: *** [postgres.o] Error 1
and resource.h has:
struct rusage {
struct timeval ru_utime; /* user time used */
struct timeval ru_stime; /* system time used */
so it is timeval it wanted. But I have:
#define HAVE_GETRUSAGE 1
For me, 'struct timeval' is coming in via #include "libpq/libpq.h", but
of course that is _after_ the inclusion of resource.h. Not sure where
you see that sys/resource.h was always there. Looking at the CVS diffs
I see it added only in the past day.
--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Next: From: Tom Lane Date: 2006-10-08 18:29:25 Subject: Re: Use non-deprecated APIs for dynloader/darwin.c Previous: From: Bruce Momjian Date: 2006-10-08 18:03:55 Subject: Re: The improvement for psql of 8.2beta1 not
Next: From: Bruce Momjian Date: 2006-10-08 18:15:53 Subject: pgsql: In release notes, mention that multi-line history saving does not Previous: From: Tom Lane Date: 2006-10-08 17:57:31 Subject: Re: [COMMITTERS] pgsql: Add include needed for new getrusage() call.