kvm: qemu: Fix compile error in non-x86 arch
[kvm-userspace.git] / qemu / qemu_socket.h
blob6687de724aa472b5abc6d1af710436322c70eeee
1 /* headers to use the BSD sockets */
2 #ifndef QEMU_SOCKET_H
3 #define QEMU_SOCKET_H
5 #ifdef _WIN32
7 #include <windows.h>
8 #include <winsock2.h>
9 #include <ws2tcpip.h>
11 #define socket_error() WSAGetLastError()
12 #undef EINTR
13 #define EWOULDBLOCK WSAEWOULDBLOCK
14 #define EINTR WSAEINTR
15 #define EINPROGRESS WSAEINPROGRESS
17 #else
19 #include <sys/socket.h>
20 #include <netinet/in.h>
21 #include <netinet/tcp.h>
22 #include <sys/un.h>
24 #define socket_error() errno
25 #define closesocket(s) close(s)
27 #endif /* !_WIN32 */
29 void socket_set_nonblock(int fd);
31 int parse_host_port(struct sockaddr_in *saddr, const char *str);
33 #endif /* QEMU_SOCKET_H */