The patch below makes it possible to disable AF_UNIX (unix-domain)
sockets in host environments which do not define _WIN32, by adding
-DNO_UNIX_SOCKETS to the compiler flags. This is useful in the
effectively-embedded qemu host which are going to be using for device
emulation in Xen.
#define EINTR WSAEINTR
#define EINPROGRESS WSAEINPROGRESS
+#ifndef NO_UNIX_SOCKETS
+#define NO_UNIX_SOCKETS 1
+#endif
+
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
+
+#ifndef NO_UNIX_SOCKETS
#include <sys/un.h>
+#endif
#define socket_error() errno
#define closesocket(s) close(s)
return 0;
}
-#ifndef _WIN32
+#ifndef NO_UNIX_SOCKETS
static int parse_unix_path(struct sockaddr_un *uaddr, const char *str)
{
const char *p;
}
#endif
}
-#ifndef _WIN32
+#ifndef NO_UNIX_SOCKETS
if (strstart(display, "unix:", &p)) {
addr = (struct sockaddr *)&uaddr;
addrlen = sizeof(uaddr);