#define BSD_SELECT /* use Berkley Sockets select */
#include <assert.h>
-#include <sys\types.h>
+#include <sys/types.h>
#ifdef __EMX__
#include <sys/time.h>
#else
-#include <utils.h>
-#include <sys\time.h>
+#include <string.h>
+
+#include <sys/time.h>
#include <types.h>
-#include <in.h>
+#include <netinet/in.h>
#include <netdb.h>
#include <nerrno.h>
#if defined(__VISAGECPP__) && __IBMCPP__ < 400
-#include <machine\endian.h>
+#include <machine/endian.h>
#include <socket.h>
#include <ioctl.h>
#include <select.h>
#else
-#include <sys\socket.h>
-#include <sys\ioctl.h>
-#include <sys\select.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <sys/select.h>
#ifdef __EMX__
#define soclose(a) close(a)
#endif
#endif
-#include <string.h>
#include <stdio.h>
#if (defined(__VISAGECPP__) && __IBMCPP__ < 400) || defined(__EMX__)
# ifdef min
#endif
#include <stddef.h>
#include <ctype.h>
+#include <stdlib.h>
#include <signal.h>
return GSOCK_IOERR;
}
- ioctl(sck->m_fd, FIONBIO, &arg);
+ ioctl(sck->m_fd, FIONBIO, (char*)&arg, sizeof(arg));
_GSocket_Enable_Events(sck);
/* Bind to the local address,
return NULL;
}
- ioctl(connection->m_fd, FIONBIO, &arg);
+ ioctl(connection->m_fd, FIONBIO, (char*)&arg, sizeof(arg));
_GSocket_Enable_Events(connection);
return connection;
return GSOCK_IOERR;
}
- ioctl(sck->m_fd, FIONBIO, &arg);
+ ioctl(sck->m_fd, FIONBIO, (char*)&arg, sizeof(arg));
_GSocket_Enable_Events(sck);
/* Connect it to the peer address, with a timeout (see below) */
ret = connect(sck->m_fd, sck->m_peer->m_addr, sck->m_peer->m_len);
printf("connect on %d to %X (%d) returned %d, errno = %d\n",
- sck->m_fd, sck->m_peer->m_addr, sck->m_peer->m_len, ret, errno);
+ sck->m_fd, sck->m_peer->m_addr, sck->m_peer->m_len, ret, errno);
if (ret == -1)
{
err = errno;
return GSOCK_IOERR;
}
- ioctl(sck->m_fd, FIONBIO, &arg);
+ ioctl(sck->m_fd, FIONBIO, (char*)&arg, sizeof(arg));
_GSocket_Enable_Events(sck);
/* Bind to the local address,
if ((flags & (1 << count)) != 0)
{
printf("Setting callback no %d for socket at %X to address %X,data %X\n",
- count, socket, callback, cdata);
+ count, socket, callback, cdata);
socket->m_cbacks[count] = callback;
socket->m_data[count] = cdata;
}
if ((flags & (1 << count)) != 0)
{
printf("Removing callback no %d for socket at %X",
- count, socket);
+ count, socket);
socket->m_cbacks[count] = NULL;
socket->m_data[count] = NULL;
}
ret = send(socket->m_fd, buffer, size, 0);
UNMASK_SIGNAL();
#else
- ret = send(socket->m_fd, buffer, size, 0);
+ ret = send(socket->m_fd, (char *)buffer, size, 0);
#endif
return ret;
}
ret = sendto(socket->m_fd, buffer, size, 0, addr, len);
UNMASK_SIGNAL();
#else
- ret = sendto(socket->m_fd, buffer, size, 0, addr, len);
+ ret = sendto(socket->m_fd, (char *)buffer, size, 0, addr, len);
#endif
/* Frees memory allocated from _GAddress_translate_to */
{
#elif defined(HAVE_INET_ADDR)
addr->s_addr = inet_addr(hostname);
- if ( (addr->s_addr == -1 )
+ if ( addr->s_addr == -1 )
{
#else
/* Use gethostbyname by default */