Skip site navigation (1) Skip section navigation (2)

WIN32 errno patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian - CVS <momjian(at)hub(dot)org>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: WIN32 errno patch
Date: 2001-07-21 20:45:54
Message-ID: 21086.995748354@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackerspgsql-patches
Upon review, I don't think these patches are very good at all.
#defining errno as WSAGetLastError() is a fairly blunt instrument,
and it breaks all the places that do actually need to use errno,
such as PQoidValue, lo_import, lo_export.  I'm also concerned that
PQrequestCancel may need to save/restore both errno and
WSAGetLastError() in order to be safe for use in a signal handler.

Is errno a plain variable on WIN32, or is it a macro?  If the former,
we could hack around this problem by doing

	#if WIN32
	#undef errno
	#endif

	...

	#if WIN32
	#define errno WSAGetLastError()
	#endif

around the routines that need to access the real errno.  While ugly,
this probably beats the alternative of ifdef'ing all the places that
do need to access the WSA error code.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2001-07-21 21:35:45
Subject: Re: WIN32 errno patch
Previous:From: mlwDate: 2001-07-21 18:48:58
Subject: sub queries and caching.

pgsql-committers by date

Next:From: Bruce Momjian - CVSDate: 2001-07-21 21:27:41
Subject: pgsql/src/interfaces/jdbc/org/postgresql/test ...
Previous:From: Bruce Momjian - CVSDate: 2001-07-21 18:57:09
Subject: pgsql/src/interfaces/jdbc/org/postgresql jdbc1 ...

pgsql-patches by date

Next:From: Bruce MomjianDate: 2001-07-21 21:27:58
Subject: Re: [PATCHES] Re: [PATCH] Cleanup of JDBC character encoding
Previous:From: Anders BengtssonDate: 2001-07-21 20:20:39
Subject: Re: [PATCHES] Re: [PATCH] Cleanup of JDBC character encoding

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group