OSDN Git Service

Currently, building on any platform that hasn't got getrusage()
authorBruce Momjian <bruce@momjian.us>
Mon, 13 Jul 1998 16:39:07 +0000 (16:39 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 13 Jul 1998 16:39:07 +0000 (16:39 +0000)
commit976b3862ce8f4f6c9c7bdc7e21010ffe39dba504
treebc11371c1b281ee20f4ee7d491b4a46a6dbf951b
parent5aea4062d68ae49bca3131a285793b932930cc43
Currently, building on any platform that hasn't got getrusage()
requires manual editing of src/backend/port/getrusage.c, because
its substitute version of getrusage is #if'd out.

There is no good reason for that, because configure won't even
include the file into the Makefile unless the platform hasn't got
getrusage.  Furthermore, we only have one working substitute version
of getrusage --- the alleged HPUX syscall-based code doesn't work.
(It causes a coredump because the syscall returns a struct rusage
that's much larger than the stub struct defined in
src/include/rusagestub.h.)  The times()-based emulation works fine
on HPUX, however.

I propose, therefore, that getrusage.c should just unconditionally
compile the times-based version, and rely on configure to include
the file only if needed.  This will be one less manual configuration
step on all platforms that need this code.

Patch attached.

Tom Lane.
src/backend/port/getrusage.c