summaryrefslogtreecommitdiff
path: root/src/port/getrusage.c
diff options
context:
space:
mode:
authorBruce Momjian2003-05-15 16:35:30 +0000
committerBruce Momjian2003-05-15 16:35:30 +0000
commit12c942383296bd626131241c012c2ab81b081738 (patch)
tree7a37bb6990282b36be53fae1bde399d8e603e9f9 /src/port/getrusage.c
parent2c0556068fc308ed9cce06c85de7e42305d34b86 (diff)
Allow Win32 to compile under MinGW. Major changes are:
Win32 port is now called 'win32' rather than 'win' add -lwsock32 on Win32 make gethostname() be only used when kerberos4 is enabled use /port/getopt.c new /port/opendir.c routines disable GUC unix_socket_group on Win32 convert some keywords.c symbols to KEYWORD_P to prevent conflict create new FCNTL_NONBLOCK macro to turn off socket blocking create new /include/port.h file that has /port prototypes, move out of c.h new /include/port/win32_include dir to hold missing include files work around ERROR being defined in Win32 includes
Diffstat (limited to 'src/port/getrusage.c')
-rw-r--r--src/port/getrusage.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/port/getrusage.c b/src/port/getrusage.c
index 14d37480460..386b1acf656 100644
--- a/src/port/getrusage.c
+++ b/src/port/getrusage.c
@@ -1,7 +1,9 @@
-/* $Id: getrusage.c,v 1.1 2002/07/18 04:13:59 momjian Exp $ */
+/* $Id: getrusage.c,v 1.2 2003/05/15 16:35:30 momjian Exp $ */
#include <stdio.h>
#include <errno.h>
+
+#include "postgres.h"
#include "rusagestub.h"
/* This code works on:
@@ -19,6 +21,10 @@
int
getrusage(int who, struct rusage * rusage)
{
+#ifdef WIN32
+ if (rusage)
+ memset(rusage, 0, sizeof(rusage));
+#else
struct tms tms;
int tick_rate = CLK_TCK; /* ticks per second */
clock_t u,
@@ -54,5 +60,6 @@ getrusage(int who, struct rusage * rusage)
rusage->ru_utime.tv_usec = TICK_TO_USEC(u, tick_rate);
rusage->ru_stime.tv_sec = TICK_TO_SEC(s, tick_rate);
rusage->ru_stime.tv_usec = TICK_TO_USEC(u, tick_rate);
+#endif
return 0;
}