Statistics
| Branch: | Revision:

root / qemu_socket.h @ f5049756

History | View | Annotate | Download (685 Bytes)

1
/* headers to use the BSD sockets */
2
#ifndef QEMU_SOCKET_H
3
#define QEMU_SOCKET_H
4

    
5
#ifdef _WIN32
6
#define WIN32_LEAN_AND_MEAN
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
int inet_aton(const char *cp, struct in_addr *ia);
18

    
19
#else
20

    
21
#include <sys/socket.h>
22
#include <netinet/in.h>
23
#include <netinet/tcp.h>
24
#include <arpa/inet.h>
25
#include <netdb.h>
26
#include <sys/un.h>
27

    
28
#define socket_error() errno
29
#define closesocket(s) close(s)
30

    
31
#endif /* !_WIN32 */
32

    
33
void socket_set_nonblock(int fd);
34

    
35
#endif /* QEMU_SOCKET_H */