compiling client utils under win32 - current 7.3devel is broken

From: Joe Conway <mail(at)joeconway(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: compiling client utils under win32 - current 7.3devel is broken
Date: 2002-09-25 22:04:39
Message-ID: 3D9232F7.9090001@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm trying to get the client utilities to compile under win32/VS.net per
http://developer.postgresql.org/docs/postgres/install-win32.html.

I was able to do this successfully using the 7.2.2 tarball, but using current
7.3devel there are a number of minor issues (missing defines, adjustments to
includes), and one more difficult item (at least so far). The latter is the
use of gettimeofday in fe-connect.c:connectDBComplete for which there does not
seem to be a good alternate under win32.

In connectDBComplete I see:

/*
* Prepare to time calculations, if connect_timeout isn't zero.
*/
if (conn->connect_timeout != NULL)
{
remains.tv_sec = atoi(conn->connect_timeout);

so it seems that the connection timeout can only be specified to the nearest
second. Given that, is there any reason not to use time() instead of
gettimeofday()?

It looks like there is a great deal of complexity added to the function just
to accommodate the fact that gettimeofday returns seconds and microseconds as
distinct members of the result struct. I think switching this code to use
time() would both simplify it, and make it win32 compatible.

Comments?

Joe

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-09-25 22:06:38 Re: CVS checkout errors
Previous Message Tom Lane 2002-09-25 21:49:17 Re: Relation 0 does not exist