/* w32sock.h --- internal auxilliary functions for Windows socket functions
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Get O_RDWR and O_BINARY. */
#include <fcntl.h>
-/* Get _get_osfhandle() and _open_osfhandle(). */
+/* Get _open_osfhandle(). */
#include <io.h>
+/* Get _get_osfhandle(). */
+#include "msvc-nothrow.h"
+
#define FD_TO_SOCKET(fd) ((SOCKET) _get_osfhandle ((fd)))
#define SOCKET_TO_FD(fh) (_open_osfhandle ((long) (fh), O_RDWR | O_BINARY))
set_winsock_errno (void)
{
int err = WSAGetLastError ();
- WSASetLastError (0);
/* Map some WSAE* errors to the runtime library's error codes. */
switch (err)