Go to the documentation of this file.
56 size_t len = strlen(s) + 1;
65 size_t len = strlen(s);
118 if (malloc_func == NULL || realloc_func == NULL ||
119 calloc_func == NULL || free_func == NULL) {
131 #define XX(uc, lc) case UV_##uc: return sizeof(uv_##lc##_t);
169 snprintf(
buf,
sizeof(
buf),
"Unknown system error %d",
err);
172 return copy != NULL ?
copy :
"Unknown system error";
175 #define UV_ERR_NAME_GEN_R(name, _) \
177 uv__strscpy(buf, #name, buflen); break;
181 default: snprintf(
buf, buflen,
"Unknown system error %d",
err);
185 #undef UV_ERR_NAME_GEN_R
188 #define UV_ERR_NAME_GEN(name, _) case UV_ ## name: return #name;
195 #undef UV_ERR_NAME_GEN
198 #define UV_STRERROR_GEN_R(name, msg) \
200 snprintf(buf, buflen, "%s", msg); break;
204 default: snprintf(
buf, buflen,
"Unknown system error %d",
err);
208 #undef UV_STRERROR_GEN_R
211 #define UV_STRERROR_GEN(name, msg) case UV_ ## name: return msg;
218 #undef UV_STRERROR_GEN
223 addr->sin_family = AF_INET;
226 addr->sin_len =
sizeof(*addr);
233 char address_part[40];
234 size_t address_part_size;
235 const char* zone_index;
241 addr->sin6_len =
sizeof(*addr);
244 zone_index = strchr(ip,
'%');
245 if (zone_index != NULL) {
246 address_part_size = zone_index - ip;
247 if (address_part_size >=
sizeof(address_part))
248 address_part_size =
sizeof(address_part) - 1;
250 memcpy(address_part, ip, address_part_size);
251 address_part[address_part_size] =
'\0';
257 addr->sin6_scope_id = atoi(zone_index);
259 addr->sin6_scope_id = if_nametoindex(zone_index);
278 const struct sockaddr*
addr,
279 unsigned int flags) {
280 unsigned int addrlen;
282 if (
handle->type != UV_TCP)
285 if (
addr->sa_family == AF_INET)
286 addrlen =
sizeof(
struct sockaddr_in);
297 const struct sockaddr*
addr,
298 unsigned int flags) {
299 unsigned int addrlen;
301 if (
handle->type != UV_UDP)
304 if (
addr->sa_family == AF_INET)
305 addrlen =
sizeof(
struct sockaddr_in);
317 const struct sockaddr*
addr,
319 unsigned int addrlen;
321 if (
handle->type != UV_TCP)
324 if (
addr->sa_family == AF_INET)
325 addrlen =
sizeof(
struct sockaddr_in);
336 unsigned int addrlen;
338 if (
handle->type != UV_UDP)
349 if (
addr->sa_family == AF_INET)
350 addrlen =
sizeof(
struct sockaddr_in);
364 struct sockaddr_storage
addr;
366 if (
handle->type != UV_UDP)
369 addrlen =
sizeof(
addr);
378 unsigned int addrlen;
380 if (
handle->type != UV_UDP)
387 return UV_EDESTADDRREQ;
390 if (
addr->sa_family == AF_INET)
391 addrlen =
sizeof(
struct sockaddr_in);
394 #if defined(AF_UNIX) && !defined(_WIN32)
395 else if (
addr->sa_family == AF_UNIX)
396 addrlen =
sizeof(
struct sockaddr_un);
412 const struct sockaddr*
addr,
427 const struct sockaddr*
addr) {
449 if (
handle->type != UV_UDP)
490 #define X(uc, lc) case UV_##uc: type = #lc; break;
493 default:
type =
"<unknown>";
497 "[%c%c%c] %-8s %p\n",
548 for (
i = 0;
i < nbufs;
i++)
570 required_len = strlen(
handle->path);
571 if (required_len >= *
size) {
572 *
size = required_len + 1;
577 *
size = required_len;
578 buffer[required_len] =
'\0';
589 return &
req->fs.info.nbufs;
600 # define uv__fs_scandir_free uv__free
602 # define uv__fs_scandir_free free
611 if (*nbufs > 0 && *nbufs != (
unsigned int)
req->result)
613 for (; *nbufs < (
unsigned int)
req->result; (*nbufs)++)
644 if (*nbufs == (
unsigned int)
req->result) {
650 dent = dents[(*nbufs)++];
652 ent->
name = dent->d_name;
661 #ifdef HAVE_DIRENT_TYPES
662 switch (dent->d_type) {
699 if (
req->ptr == NULL)
709 for (
i = 0;
i <
req->result; ++
i) {
780 saved_data =
loop->data;
782 loop->data = saved_data;
800 if (
loop != default_loop)
int uv_udp_recv_stop(uv_udp_t *handle)
int uv__udp_check_before_send(uv_udp_t *handle, const struct sockaddr *addr)
char * uv_strerror_r(int err, char *buf, size_t buflen)
UV_EXTERN int uv_inet_pton(int af, const char *src, void *dst)
void *(* uv_calloc_func)(size_t count, size_t size)
void *(* uv_realloc_func)(void *ptr, size_t size)
void uv_free_cpu_info(uv_cpu_info_t *cpu_infos, int count)
static const char * uv__unknown_err_code(int err)
void uv_print_all_handles(uv_loop_t *loop, FILE *stream)
void uv_os_free_environ(uv_env_item_t *envitems, int count)
void uv__loop_close(uv_loop_t *loop)
uv_loop_t * uv_default_loop(void)
int uv__udp_is_connected(uv_udp_t *handle)
#define UV_ERR_NAME_GEN(name, _)
const char * uv_err_name(int err)
return memset(p, 0, total)
static void uv__print_handles(uv_loop_t *loop, int only_active, FILE *stream)
uv_loop_t * uv_loop_new(void)
int uv_tcp_connect(uv_connect_t *req, uv_tcp_t *handle, const struct sockaddr *addr, uv_connect_cb cb)
void uv_walk(uv_loop_t *loop, uv_walk_cb walk_cb, void *arg)
size_t uv_handle_size(uv_handle_type type)
void * uv__malloc(size_t size)
@ UV_HANDLE_UDP_CONNECTED
int uv_fs_event_getpath(uv_fs_event_t *handle, char *buffer, size_t *size)
static int copy(grpc_slice_buffer *input, grpc_slice_buffer *output)
int uv_udp_connect(uv_udp_t *handle, const struct sockaddr *addr)
uv_dirent_type_t uv__fs_get_dirent_type(uv__dirent_t *dent)
struct dirent uv__dirent_t
static void alloc_cb(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
static void send_cb(uv_udp_send_t *req, int status)
int uv_udp_send(uv_udp_send_t *req, uv_udp_t *handle, const uv_buf_t bufs[], unsigned int nbufs, const struct sockaddr *addr, uv_udp_send_cb send_cb)
#define UV_STRERROR_GEN_R(name, msg)
void(* uv_walk_cb)(uv_handle_t *handle, void *arg)
int uv__udp_recv_stop(uv_udp_t *handle)
size_t uv_loop_size(void)
int uv_udp_bind(uv_udp_t *handle, const struct sockaddr *addr, unsigned int flags)
#define QUEUE_DATA(ptr, type, field)
#define uv__handle_ref(h)
#define uv__handle_unref(h)
#define UV_HANDLE_TYPE_MAP(XX)
void uv_ref(uv_handle_t *handle)
size_t uv_req_size(uv_req_type type)
void(* uv_alloc_cb)(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
void uv_unref(uv_handle_t *handle)
void(* uv_free_func)(void *ptr)
static uv_dirent_t dirents[1]
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
int uv_tcp_bind(uv_tcp_t *handle, const struct sockaddr *addr, unsigned int flags)
int uv__udp_bind(uv_udp_t *handle, const struct sockaddr *addr, unsigned int addrlen, unsigned int flags)
void uv_print_active_handles(uv_loop_t *loop, FILE *stream)
int uv__udp_disconnect(uv_udp_t *handle)
int uv_ip6_addr(const char *ip, int port, struct sockaddr_in6 *addr)
char * uv__strdup(const char *s)
uv_realloc_func local_realloc
int uv_send_buffer_size(uv_handle_t *handle, int *value)
unsigned __int64 uint64_t
static unsigned int * uv__get_nbufs(uv_fs_t *req)
int uv_fs_scandir_next(uv_fs_t *req, uv_dirent_t *ent)
UV_EXTERN int uv_udp_getpeername(const uv_udp_t *handle, struct sockaddr *name, int *namelen)
void uv_stop(uv_loop_t *loop)
uint64_t uv_now(const uv_loop_t *loop)
int uv__udp_connect(uv_udp_t *handle, const struct sockaddr *addr, unsigned int addrlen)
void * uv__calloc(size_t count, size_t size)
void(* uv_udp_send_cb)(uv_udp_send_t *req, int status)
#define UV_ERR_NAME_GEN_R(name, _)
struct uv_loop_s uv_loop_t
UV_EXTERN int uv_loop_init(uv_loop_t *loop)
static void recv_cb(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struct sockaddr *addr, unsigned flags)
void(* uv_udp_recv_cb)(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struct sockaddr *addr, unsigned flags)
int uv__udp_send(uv_udp_send_t *req, uv_udp_t *handle, const uv_buf_t bufs[], unsigned int nbufs, const struct sockaddr *addr, unsigned int addrlen, uv_udp_send_cb send_cb)
int uv_udp_try_send(uv_udp_t *handle, const uv_buf_t bufs[], unsigned int nbufs, const struct sockaddr *addr)
void uv_loop_delete(uv_loop_t *loop)
void * uv__realloc(void *ptr, size_t size)
uv_buf_t uv_buf_init(char *base, unsigned int len)
void * uv__reallocf(void *ptr, size_t size)
int uv_replace_allocator(uv_malloc_func malloc_func, uv_realloc_func realloc_func, uv_calloc_func calloc_func, uv_free_func free_func)
void(* uv_connect_cb)(uv_connect_t *req, int status)
#define uv__has_active_reqs(loop)
int uv_loop_close(uv_loop_t *loop)
int uv_ip4_addr(const char *ip, int port, struct sockaddr_in *addr)
int uv__tcp_connect(uv_connect_t *req, uv_tcp_t *handle, const struct sockaddr *addr, unsigned int addrlen, uv_connect_cb cb)
int uv__udp_recv_start(uv_udp_t *handle, uv_alloc_cb alloc_cb, uv_udp_recv_cb recv_cb)
int uv__udp_try_send(uv_udp_t *handle, const uv_buf_t bufs[], unsigned int nbufs, const struct sockaddr *addr, unsigned int addrlen)
static void walk_cb(uv_handle_t *handle, void *arg)
uv_calloc_func local_calloc
const char * uv_strerror(int err)
void uv__fs_scandir_cleanup(uv_fs_t *req)
UV_EXTERN int uv_inet_ntop(int af, const void *src, char *dst, size_t size)
int uv_recv_buffer_size(uv_handle_t *handle, int *value)
#define QUEUE_FOREACH(q, h)
int uv__socket_sockopt(uv_handle_t *handle, int optname, int *value)
void *(* uv_malloc_func)(size_t size)
static uv_loop_t default_loop_struct
int uv__tcp_bind(uv_tcp_t *tcp, const struct sockaddr *addr, unsigned int addrlen, unsigned int flags)
void uv__fs_readdir_cleanup(uv_fs_t *req)
int uv_ip4_name(const struct sockaddr_in *src, char *dst, size_t size)
char * uv__strndup(const char *s, size_t n)
struct ares_in6_addr sin6_addr
#define UV_STRERROR_GEN(name, msg)
int uv_loop_configure(uv_loop_t *loop, uv_loop_option option,...)
int uv_udp_recv_start(uv_udp_t *handle, uv_alloc_cb alloc_cb, uv_udp_recv_cb recv_cb)
#define uv__fs_scandir_free
size_t uv__count_bufs(const uv_buf_t bufs[], unsigned int nbufs)
static uv_loop_t * default_loop_ptr
static uv__allocator_t uv__allocator
int uv_ip6_name(const struct sockaddr_in6 *src, char *dst, size_t size)
char * uv_err_name_r(int err, char *buf, size_t buflen)
int uv__loop_configure(uv_loop_t *loop, uv_loop_option option, va_list ap)
#define QUEUE_INSERT_TAIL(h, q)
#define UV_REQ_TYPE_MAP(XX)
OPENSSL_EXPORT pem_password_cb * cb
int uv_has_ref(const uv_handle_t *handle)
uv_malloc_func local_malloc
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:49