#include <sys/ioctl.h> /* For FIONBIO. */
#endif
-#include <sys/time.h>
-
-#include "gdb_socket.h"
+#include "gdb_sys_time.h"
#ifdef USE_WIN32API
#include <winsock2.h>
#define close(fd) closesocket (fd)
#define ioctl ioctlsocket
#else
+#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#include <sys/socket.h>
#include <netinet/tcp.h>
#endif
int n, port, tmp;
int use_udp;
struct hostent *hostent;
- union gdb_sockaddr_u sockaddr;
+ struct sockaddr_in sockaddr;
#ifdef USE_WIN32API
u_long ioarg;
#else
return -1;
}
- sockaddr.sa_in.sin_family = PF_INET;
- sockaddr.sa_in.sin_port = htons (port);
- memcpy (&sockaddr.sa_in.sin_addr.s_addr, hostent->h_addr,
+ sockaddr.sin_family = PF_INET;
+ sockaddr.sin_port = htons (port);
+ memcpy (&sockaddr.sin_addr.s_addr, hostent->h_addr,
sizeof (struct in_addr));
retry:
/* Use Non-blocking connect. connect() will return 0 if connected
already. */
- n = connect (scb->fd, &sockaddr.sa, sizeof (sockaddr.sa_in));
+ n = connect (scb->fd, (struct sockaddr *) &sockaddr, sizeof (sockaddr));
if (n < 0)
{
ser_base_noflush_set_tty_state,
ser_base_setbaudrate,
ser_base_setstopbits,
+ ser_base_setparity,
ser_base_drain_output,
ser_base_async,
net_read_prim,