root / qemu_socket.h @ ce8536e2
History | View | Annotate | Download (591 Bytes)
1 | 6ca957f0 | bellard | /* headers to use the BSD sockets */
|
---|---|---|---|
2 | 6ca957f0 | bellard | #ifndef QEMU_SOCKET_H
|
3 | 6ca957f0 | bellard | #define QEMU_SOCKET_H
|
4 | 6ca957f0 | bellard | |
5 | 6ca957f0 | bellard | #ifdef _WIN32
|
6 | 4fddf62a | ths | #define WIN32_LEAN_AND_MEAN
|
7 | 6ca957f0 | bellard | #include <windows.h> |
8 | 6ca957f0 | bellard | #include <winsock2.h> |
9 | 6ca957f0 | bellard | #include <ws2tcpip.h> |
10 | 6ca957f0 | bellard | |
11 | 6ca957f0 | bellard | #define socket_error() WSAGetLastError()
|
12 | 6ca957f0 | bellard | #undef EINTR
|
13 | 6ca957f0 | bellard | #define EWOULDBLOCK WSAEWOULDBLOCK
|
14 | 6ca957f0 | bellard | #define EINTR WSAEINTR
|
15 | 6ca957f0 | bellard | #define EINPROGRESS WSAEINPROGRESS
|
16 | 6ca957f0 | bellard | |
17 | 6ca957f0 | bellard | #else
|
18 | 6ca957f0 | bellard | |
19 | 6ca957f0 | bellard | #include <sys/socket.h> |
20 | 6ca957f0 | bellard | #include <netinet/in.h> |
21 | 6ca957f0 | bellard | #include <netinet/tcp.h> |
22 | ffd843bc | ths | #include <sys/un.h> |
23 | 6ca957f0 | bellard | |
24 | 6ca957f0 | bellard | #define socket_error() errno
|
25 | 6ca957f0 | bellard | #define closesocket(s) close(s)
|
26 | 6ca957f0 | bellard | |
27 | 6ca957f0 | bellard | #endif /* !_WIN32 */ |
28 | 6ca957f0 | bellard | |
29 | 6ca957f0 | bellard | void socket_set_nonblock(int fd); |
30 | 6ca957f0 | bellard | |
31 | 6ca957f0 | bellard | #endif /* QEMU_SOCKET_H */ |