#define recv win32_recv
#define recvfrom win32_recvfrom
#define shutdown win32_shutdown
+#define closesocket win32_closesocket
#define ioctlsocket win32_ioctlsocket
#define setsockopt win32_setsockopt
#define getsockopt win32_getsockopt
#undef recv
#undef recvfrom
#undef shutdown
+#undef closesocket
#undef ioctlsocket
#undef setsockopt
#undef getsockopt
return r;
}
+int
+win32_closesocket(SOCKET s)
+{
+ int r;
+
+ SOCKET_TEST_ERROR(r = closesocket(TO_SOCKET(s)));
+ return r;
+}
+
SOCKET
win32_socket(int af, int type, int protocol)
{
SOCKET s;
- StartSockets();
#ifndef USE_SOCKETS_AS_HANDLES
SOCKET_TEST(s = socket(af, type, protocol), INVALID_SOCKET);
#else
+ StartSockets();
if((s = socket(af, type, protocol)) == INVALID_SOCKET)
errno = WSAGetLastError();
else