WIN32 errno patch
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian - CVS <momjian@hub.org>
Cc: pgsql-hackers@postgreSQL.org
Date: 2001-07-21T20:45:54Z
Lists: pgsql-hackers
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