1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Win32 compile fixes for pgbench, pgcrypto, and tsearch.

Claudio Natoli
This commit is contained in:
Tom Lane
2004-09-14 03:39:55 +00:00
parent fc564686a7
commit bf06825e31
5 changed files with 34 additions and 19 deletions

View File

@ -1,5 +1,5 @@
/*
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.32 2004/08/29 05:06:36 momjian Exp $
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.33 2004/09/14 03:39:23 tgl Exp $
*
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
* written by Tatsuo Ishii
@ -44,6 +44,10 @@
extern char *optarg;
extern int optind;
#ifdef WIN32
#undef select
#endif
/********************************************************************
* some configurable parameters */
@ -705,7 +709,7 @@ main(int argc, char **argv)
int nsocks; /* return from select(2) */
int maxsock; /* max socket number to be waited */
#ifndef __CYGWIN__
#if !(defined(__CYGWIN__) || defined(__MINGW32__))
struct rlimit rlim;
#endif
@ -755,7 +759,7 @@ main(int argc, char **argv)
fprintf(stderr, "invalid number of clients: %d\n", nclients);
exit(1);
}
#ifndef __CYGWIN__
#if !(defined(__CYGWIN__) || defined(__MINGW32__))
#ifdef RLIMIT_NOFILE /* most platform uses RLIMIT_NOFILE */
if (getrlimit(RLIMIT_NOFILE, &rlim) == -1)
{
@ -772,7 +776,7 @@ main(int argc, char **argv)
fprintf(stderr, "Use limit/ulimt to increase the limit before using pgbench.\n");
exit(1);
}
#endif /* #ifndef __CYGWIN__ */
#endif /* #if !(defined(__CYGWIN__) || defined(__MINGW32__)) */
break;
case 'C':
is_connect = 1;
@ -935,7 +939,7 @@ main(int argc, char **argv)
/* set random seed */
gettimeofday(&tv1, 0);
srand((uint) tv1.tv_usec);
srand((unsigned int) tv1.tv_usec);
/* get start up time */
gettimeofday(&tv1, 0);