Subject: Re: SO_ERROR
From: [email-masked] (Tomas Fasth)

25 Nov 1997 08:56:26 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: [email-masked]

jman wrote:

> Is SO_ERROR not in gnu-win32?
> I'm trying to port/compile a program to Windows an get this error am
> I using the wrong includes?
> 
> `SO_ERROR' undeclared (first use this function)
> (Each undeclared identifier is reported only once
> for each function it appears in.)
> 
> The includes are
> #include <stdio.h>
> #include <errno.h>

SO_ERROR is usually defined in <sys/socket.h>.
However, the definition of SO_ERROR seem to be missing in gnu-win32.
The definition of the persistent socket options, which also begins with
SO_ and are part of a socket's private data, shows up in <asm/socket.h>
for some reason (although included from <sys/socket.h>) but no SO_ERROR.
A guess is that SO_ERROR might not have been implemented yet. On the
other hand, <winsock.h> as part of most C/C++ compilers for win16/win32,
contains a definition of SO_ERROR. So it's there somewhere under the
hood, but not as part of gnu-win32 as it seems.

The section in <winsock.h> looks like this:
/*
 * Additional options.
 */
#define SO_SNDBUF       0x1001          /* send buffer size */
#define SO_RCVBUF       0x1002          /* receive buffer size */
#define SO_SNDLOWAT     0x1003          /* send low-water mark */
#define SO_RCVLOWAT     0x1004          /* receive low-water mark */
#define SO_SNDTIMEO     0x1005          /* send timeout */
#define SO_RCVTIMEO     0x1006          /* receive timeout */
#define SO_ERROR        0x1007          /* get error status and clear */
#define SO_TYPE         0x1008          /* get socket type */

You might want to throw this section into the code you're trying to
compile and give it a try. Hold your hat though, in case... ;-)

Tomas
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".