#include <unistd.h>
#include "dynamic-string.h"
#include "fatal-signal.h"
+#include "ovs-thread.h"
#include "packets.h"
#include "poll-loop.h"
#include "util.h"
OVS_NOT_REACHED();
}
}
+
+/* For Windows socket calls, 'errno' is not set. One has to call
+ * WSAGetLastError() to get the error number and then pass it to
+ * this function to get the correct error string.
+ *
+ * ovs_strerror() calls strerror_r() and would not get the correct error
+ * string for Windows sockets, but is good for POSIX. */
+const char *
+sock_strerror(int error)
+{
+#ifdef _WIN32
+ return ovs_format_message(error);
+#else
+ return ovs_strerror(error);
+#endif
+}