bellard | 6ca957f | 2006-04-30 22:53:25 +0000 | [diff] [blame] | 1 | /* headers to use the BSD sockets */ |
| 2 | #ifndef QEMU_SOCKET_H |
| 3 | #define QEMU_SOCKET_H |
| 4 | |
| 5 | #ifdef _WIN32 |
| 6 | |
| 7 | #include <windows.h> |
| 8 | #include <winsock2.h> |
| 9 | #include <ws2tcpip.h> |
| 10 | |
| 11 | #define socket_error() WSAGetLastError() |
| 12 | #undef EINTR |
| 13 | #define EWOULDBLOCK WSAEWOULDBLOCK |
| 14 | #define EINTR WSAEINTR |
| 15 | #define EINPROGRESS WSAEINPROGRESS |
| 16 | |
| 17 | #else |
| 18 | |
| 19 | #include <sys/socket.h> |
| 20 | #include <netinet/in.h> |
| 21 | #include <netinet/tcp.h> |
ths | ffd843b | 2006-12-21 19:46:43 +0000 | [diff] [blame] | 22 | #include <sys/un.h> |
bellard | 6ca957f | 2006-04-30 22:53:25 +0000 | [diff] [blame] | 23 | |
| 24 | #define socket_error() errno |
| 25 | #define closesocket(s) close(s) |
| 26 | |
| 27 | #endif /* !_WIN32 */ |
| 28 | |
| 29 | void socket_set_nonblock(int fd); |
| 30 | |
| 31 | #endif /* QEMU_SOCKET_H */ |