1 /* headers to use the BSD sockets */
6 #define WIN32_LEAN_AND_MEAN
11 #define socket_error() WSAGetLastError()
13 #define EWOULDBLOCK WSAEWOULDBLOCK
14 #define EINTR WSAEINTR
15 #define EINPROGRESS WSAEINPROGRESS
17 int inet_aton(const char *cp
, struct in_addr
*ia
);
21 #include <sys/socket.h>
22 #include <netinet/in.h>
23 #include <netinet/tcp.h>
24 #include <arpa/inet.h>
28 #define socket_error() errno
29 #define closesocket(s) close(s)
31 int parse_unix_path(struct sockaddr_un
*uaddr
, const char *str
);
35 void socket_set_nonblock(int fd
);
36 int parse_host_port(struct sockaddr_in
*saddr
, const char *str
);
37 int parse_host_src_port(struct sockaddr_in
*haddr
,
38 struct sockaddr_in
*saddr
,
40 int send_all(int fd
, const uint8_t *buf
, int len1
);
42 #endif /* QEMU_SOCKET_H */