45 #if defined(EAI_ADDRFAMILY)
46 case EAI_ADDRFAMILY:
return UV_EAI_ADDRFAMILY;
48 #if defined(EAI_AGAIN)
49 case EAI_AGAIN:
return UV_EAI_AGAIN;
51 #if defined(EAI_BADFLAGS)
52 case EAI_BADFLAGS:
return UV_EAI_BADFLAGS;
54 #if defined(EAI_BADHINTS)
55 case EAI_BADHINTS:
return UV_EAI_BADHINTS;
57 #if defined(EAI_CANCELED)
58 case EAI_CANCELED:
return UV_EAI_CANCELED;
61 case EAI_FAIL:
return UV_EAI_FAIL;
63 #if defined(EAI_FAMILY)
64 case EAI_FAMILY:
return UV_EAI_FAMILY;
66 #if defined(EAI_MEMORY)
67 case EAI_MEMORY:
return UV_EAI_MEMORY;
69 #if defined(EAI_NODATA)
70 case EAI_NODATA:
return UV_EAI_NODATA;
72 #if defined(EAI_NONAME)
73 # if !defined(EAI_NODATA) || EAI_NODATA != EAI_NONAME
74 case EAI_NONAME:
return UV_EAI_NONAME;
77 #if defined(EAI_OVERFLOW)
78 case EAI_OVERFLOW:
return UV_EAI_OVERFLOW;
80 #if defined(EAI_PROTOCOL)
81 case EAI_PROTOCOL:
return UV_EAI_PROTOCOL;
83 #if defined(EAI_SERVICE)
84 case EAI_SERVICE:
return UV_EAI_SERVICE;
86 #if defined(EAI_SOCKTYPE)
87 case EAI_SOCKTYPE:
return UV_EAI_SOCKTYPE;
89 #if defined(EAI_SYSTEM)
90 case EAI_SYSTEM:
return UV__ERR(errno);
93 assert(!
"unknown EAI_* error code");
106 err = getaddrinfo(
req->hostname,
req->service,
req->hints, &
req->addrinfo);
120 else if (
req->service)
122 else if (
req->hostname)
131 if (
status == UV_ECANCELED) {
133 req->retcode = UV_EAI_CANCELED;
144 const char* hostname,
146 const struct addrinfo* hints) {
147 char hostname_ascii[256];
162 (void) &hostname_ascii;
164 if (hostname !=
NULL) {
166 hostname + strlen(hostname),
168 hostname_ascii +
sizeof(hostname_ascii));
171 hostname = hostname_ascii;
175 hostname_len = hostname ? strlen(hostname) + 1 : 0;
176 service_len = service ? strlen(service) + 1 : 0;
177 hints_len = hints ?
sizeof(*hints) : 0;
197 len +=
sizeof(*hints);
236 if (if_indextoname(ifindex, ifname_buf) ==
NULL)
239 len =
strnlen(ifname_buf,
sizeof(ifname_buf));
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec req
long uv__idna_toascii(const char *s, const char *se, char *d, char *de)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static const char struct stat static buf struct stat static buf static vhangup int status
assert(limit<=UINT32_MAX/2)
size_t strnlen(const char *str, size_t maxlen)
#define container_of(ptr, type, member)
void uv__work_submit(uv_loop_t *loop, struct uv__work *w, enum uv__work_kind kind, void(*work)(struct uv__work *w), void(*done)(struct uv__work *w, int status))
int uv_if_indextoiid(unsigned int ifindex, char *buffer, size_t *size)
static void uv__getaddrinfo_work(struct uv__work *w)
void uv_freeaddrinfo(struct addrinfo *ai)
static void uv__getaddrinfo_done(struct uv__work *w, int status)
int uv_getaddrinfo(uv_loop_t *loop, uv_getaddrinfo_t *req, uv_getaddrinfo_cb cb, const char *hostname, const char *service, const struct addrinfo *hints)
int uv__getaddrinfo_translate_error(int sys_err)
int uv_if_indextoname(unsigned int ifindex, char *buffer, size_t *size)
void * uv__malloc(size_t size)
#define uv__req_init(loop, req, typ)
#define uv__req_unregister(loop, req)
void(* uv_getaddrinfo_cb)(uv_getaddrinfo_t *req, int status, struct addrinfo *res)