RE: [DOCS] Re: libpq sockets on win32

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, <jeff(at)jeffjohnson(dot)net>
Cc: <pgsql-interfaces(at)postgresql(dot)org>
Subject: RE: [DOCS] Re: libpq sockets on win32
Date: 2001-06-05 14:47:02
Message-ID: 81124B76C0CF364EBAC6CD213ABEDEF701AA0D@ARGON.edu.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

> > > I have done exactly that. I assume fcntl(), ioctl(),
> > > select() use errno
> > > even if used on a socket, while getsockopt(), setsockopt(),
> > socket(),
> > > connect(), getsockname(), send(), recv() use WSAGetLastError. Is
> > this
> > > list correct?
> >
> > I don't know enough about such things.
>
> The web page wasn't clear about that.
No, that list is not correct.

1) select() can *only* be used on a socket in Windows, and it puts its
error info in WSAGetLastError().

2) ioctl() should *not* be used on sockets. Instead, ioctlsocket()
shuold be used. ioctlsocket() puts its error info in WSAGetLastError().
(http://msdn.microsoft.com/library/psdk/winsock/ovrvw3_98mq.htm). (loads
fine in my Netscape, doesn't look all that good, but definitly readable)

3) fcntl() should *not* be used on sockets. ioctlsocket() again.

Generaelly, all functions dealing with sockets use WSAGetLastError().
And sockets and file descriptors are *not* necessarily interchangable on
Win32.

Note - this is Win32, *not* cygwin. Cygwin maps to errno, AFAIK.

//Magnus

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Kemin Zhou 2001-06-05 18:16:33 difficulty building the C++ interface
Previous Message Tom Lane 2001-06-05 14:16:40 Re: query works in psql, but not thru JDBC