24 #ifdef HAVE_ARPA_INET_H
25 # include <arpa/inet.h>
31 #ifndef INVALID_SOCKET
32 # define INVALID_SOCKET -1
35 #ifdef HAVE_GETADDRINFO
36 # ifndef AI_NUMERICSERV
37 # define AI_NUMERICSERV 0
39 # ifndef AI_NUMERICHOST
40 # define AI_NUMERICHOST 0
45 # define INADDR_NONE ((in_addr_t)-1)
53 # define SOCK_CLOEXEC 0
57 # define close(sock) closesocket(sock)
66 # define accept(sock, addr, addrlen) net_accept(sock, addr, addrlen)
67 # define bind(sock, addr, addrlen) net_bind(sock, addr, addrlen)
68 # define close(sock) net_close(sock)
69 # define connect(sock, addr, addrlen) net_connect(sock, addr, addrlen)
70 # define gethostbyname(name) net_gethostbyname(name)
71 # define listen(sock, backlog) net_listen(sock, backlog)
72 # define poll(fds, nfds, timeout) net_poll(fds, nfds, timeout)
73 # define recv(sock, buf, len, flags) net_recv(sock, buf, len, flags)
74 # define recvfrom(sock, buf, len, flags, addr, addrlen) \
75 net_recvfrom(sock, buf, len, flags, addr, addrlen)
76 # define send(sock, buf, len, flags) net_send(sock, buf, len, flags)
77 # define sendto(sock, buf, len, flags, addr, addrlen) \
78 net_sendto(sock, buf, len, flags, addr, addrlen)
79 # define setsockopt(sock, level, name, value, len) \
80 net_setsockopt(sock, level, name, value, len)
81 # define socket(domain, type, proto) net_socket(domain, type, proto)
82 typedef u32 in_addr_t;