Re: libpq sockets on win32 - Mailing list pgsql-interfaces

From Peter Eisentraut
Subject Re: libpq sockets on win32
Date
Msg-id Pine.LNX.4.30.0106042021520.768-100000@peter.localdomain
Whole thread Raw
In response to libpq sockets on win32  ("Jeff Johnson" <jeff@jeffjohnson.net>)
List pgsql-interfaces
Jeff Johnson writes:

> After some poking around, it looked like recv was setting errno to
> ENOENT for some reason.  I figured out why today.  Win32 sockets don't
> set errno at all.  ENOENT was just left in errno from some earlier
> call.

There are already a few (wrong) attempts to cover this situation in
fe-connect.c, but it looks like a bunch of #ifdef's are needed.

> I haven't done much C coding in a few years and don't want to break
> other code by blindly doing:
>
> #define errno WSAGetLastError

Probably rather

#ifndef WIN32
normal code;
#else
windows code;
#endif

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: libpq sockets on win32
Next
From: Bruce Momjian
Date:
Subject: Re: libpq sockets on win32