debuggers.hg

view tools/ioemu/qemu_socket.h @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children
line source
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 #ifndef NO_UNIX_SOCKETS
18 #define NO_UNIX_SOCKETS 1
19 #endif
21 #else
23 #include <sys/socket.h>
24 #include <netinet/in.h>
25 #include <netinet/tcp.h>
27 #ifndef NO_UNIX_SOCKETS
28 #include <sys/un.h>
29 #endif
31 #define socket_error() errno
32 #define closesocket(s) close(s)
34 #endif /* !_WIN32 */
36 void socket_set_nonblock(int fd);
38 #endif /* QEMU_SOCKET_H */