-/* Serial interface for raw TCP connections on Un*x like systems
- Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001
+/* Serial interface for raw TCP connections on Un*x like systems.
+
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2005
Free Software Foundation, Inc.
This file is part of GDB.
#ifdef USE_WIN32API
#include <winsock2.h>
#define ETIMEDOUT WSAETIMEDOUT
-#define close closesocket
+#define close(fd) closesocket (fd)
#define ioctl ioctlsocket
#else
#include <netinet/in.h>
#include <signal.h>
#include "gdb_string.h"
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
static int net_open (struct serial *scb, const char *name);
static void net_close (struct serial *scb);
void _initialize_ser_tcp (void);
/* Got something. Is it an error? */
{
- int res, err, len;
+ int res, err;
+ socklen_t len;
len = sizeof(err);
/* On Windows, the fourth parameter to getsockopt is a "char *";
on UNIX systems it is generally "void *". The cast to "void *"