Rizin
unix-like reverse engineering framework and cli tools
|
#include "uv.h"
#include "uv-common.h"
#include <assert.h>
#include <errno.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <net/if.h>
#include <sys/un.h>
Go to the source code of this file.
Classes | |
struct | uv__allocator_t |
Macros | |
#define | XX(uc, lc) case UV_##uc: return sizeof(uv_##lc##_t); |
#define | UV_ERR_NAME_GEN_R(name, _) |
#define | UV_ERR_NAME_GEN(name, _) case UV_ ## name: return #name; |
#define | UV_STRERROR_GEN_R(name, msg) |
#define | UV_STRERROR_GEN(name, msg) case UV_ ## name: return msg; |
#define | X(uc, lc) case UV_##uc: type = #lc; break; |
#define | uv__fs_scandir_free free |
Variables | |
static uv__allocator_t | uv__allocator |
static uv_loop_t | default_loop_struct |
static uv_loop_t * | default_loop_ptr |
#define uv__fs_scandir_free free |
Definition at line 632 of file uv-common.c.
Definition at line 188 of file uv-common.c.
Definition at line 175 of file uv-common.c.
Definition at line 211 of file uv-common.c.
Definition at line 198 of file uv-common.c.
#define X | ( | uc, | |
lc | |||
) | case UV_##uc: type = #lc; break; |
#define XX | ( | uc, | |
lc | |||
) | case UV_##uc: return sizeof(uv_##lc##_t); |
Definition at line 131 of file uv-common.c.
Definition at line 92 of file uv-common.c.
References count, uv__allocator_t::local_calloc, and uv__allocator.
Referenced by uv__interface_addresses_v6(), uv__pipe_write_ipc(), uv_cpu_info(), uv_fs_poll_start(), uv_interface_addresses(), uv_loop_init(), and uv_os_environ().
Definition at line 573 of file uv-common.c.
References bufs, bytes, and i.
Referenced by uv__send(), uv__tty_try_write(), uv__udp_run_completed(), uv__udp_send(), uv__write_req_size(), uv_tcp_write(), uv_try_write(), and uv_write2().
void uv__free | ( | void * | ptr | ) |
Definition at line 81 of file uv-common.c.
References uv__allocator_t::local_free, and uv__allocator.
Referenced by child_fork(), eof_timer_close_cb(), epoll_queue_close(), freeifaddrs(), freeResultList(), fs__closedir(), fs__create_junction(), fs__opendir(), fs__readdir(), fs__realpath_handle(), fs__scandir(), fs__sendfile(), fs__statfs(), getNetlinkResponse(), make_program_args(), make_program_env(), maybe_free_watcher_list(), os390_readlink(), scandir(), search_path_join_test(), timer_close_cb(), uv__convert_utf16_to_utf8(), uv__convert_utf8_to_utf16(), uv__custom_sem_destroy(), uv__custom_sem_init(), uv__dlerror(), uv__fd_hash_remove(), uv__fs_closedir(), uv__fs_opendir(), uv__fs_read(), uv__fs_readdir(), uv__fs_readdir_cleanup(), uv__fs_readlink(), uv__fs_realpath(), uv__fs_write_all(), uv__getaddrinfo_done(), uv__getpwuid_r(), uv__inotify_fork(), uv__io_fork(), uv__loop_close(), uv__loops_remove(), uv__pipe_close(), uv__pipe_getname(), uv__pipe_write_ipc(), uv__platform_loop_delete(), uv__process_title_cleanup(), uv__realloc(), uv__reallocf(), uv__search_path(), uv__stdio_destroy(), uv__stream_close(), uv__thread_start(), uv__threadpool_cleanup(), uv__udp_run_completed(), uv__write_callbacks(), uv__write_req_finish(), uv_accept(), uv_barrier_destroy(), uv_barrier_init(), uv_chdir(), uv_cpu_info(), uv_cwd(), uv_dlclose(), uv_exepath(), uv_free_cpu_info(), uv_free_interface_addresses(), uv_freeaddrinfo(), uv_fs_event_endgame(), uv_fs_event_start(), uv_fs_event_stop(), uv_fs_poll_start(), uv_fs_req_cleanup(), uv_getaddrinfo(), uv_interface_addresses(), uv_loop_delete(), uv_loop_init(), uv_loop_new(), uv_os_environ(), uv_os_free_environ(), uv_os_free_passwd(), uv_os_getenv(), uv_os_setenv(), uv_os_tmpdir(), uv_os_unsetenv(), uv_pipe_accept(), uv_pipe_bind(), uv_pipe_chmod(), uv_pipe_cleanup(), uv_pipe_connect(), uv_pipe_endgame(), uv_process_fs_event_req(), uv_process_pipe_write_req(), uv_set_process_title(), uv_spawn(), uv_split_path(), uv_tcp_endgame(), uv_thread_create_ex(), uv_try_write(), and uv_uptime().
uv_dirent_type_t uv__fs_get_dirent_type | ( | uv__dirent_t * | dent | ) |
Definition at line 688 of file uv-common.c.
References type, UV__DT_BLOCK, UV__DT_CHAR, UV__DT_DIR, UV__DT_FIFO, UV__DT_FILE, UV__DT_LINK, UV__DT_SOCKET, UV_DIRENT_BLOCK, UV_DIRENT_CHAR, UV_DIRENT_DIR, UV_DIRENT_FIFO, UV_DIRENT_FILE, UV_DIRENT_LINK, UV_DIRENT_SOCKET, and UV_DIRENT_UNKNOWN.
Referenced by fs__readdir(), uv__fs_readdir(), and uv_fs_scandir_next().
void uv__fs_readdir_cleanup | ( | uv_fs_t * | req | ) |
Definition at line 724 of file uv-common.c.
References uv_dir_s::dirents, i, uv_dirent_s::name, NULL, req, and uv__free().
Referenced by uv_fs_req_cleanup().
void uv__fs_scandir_cleanup | ( | uv_fs_t * | req | ) |
Definition at line 635 of file uv-common.c.
References int, NULL, req, uv__fs_scandir_free, and uv__get_nbufs().
Referenced by uv_fs_req_cleanup().
Definition at line 617 of file uv-common.c.
References req.
Referenced by uv__fs_scandir_cleanup(), and uv_fs_scandir_next().
void* uv__malloc | ( | size_t | size | ) |
Definition at line 75 of file uv-common.c.
References uv__allocator_t::local_malloc, NULL, and uv__allocator.
Referenced by eof_timer_init(), epoll_create1(), fs__capture_path(), fs__create_junction(), fs__opendir(), fs__realpath_handle(), fs__scandir(), fs__sendfile(), fs__statfs(), fs__wide_to_utf8(), getNetlinkResponse(), init_threads(), interpretAddr(), interpretLink(), make_program_args(), make_program_env(), newListItem(), os390_readlink(), scandir(), search_path_join_test(), uv__build_coalesced_write_req(), uv__convert_utf16_to_utf8(), uv__convert_utf8_to_utf16(), uv__custom_sem_init(), uv__fd_hash_add(), uv__fs_opendir(), uv__fs_readlink(), uv__fs_realpath(), uv__fs_statfs(), uv__getaddrinfo_done(), uv__getpwuid_r(), uv__interface_addresses_v6(), uv__pipe_getname(), uv__pipe_queue_ipc_xfer_info(), uv__stdio_create(), uv__strdup(), uv__stream_queue_fd(), uv__strndup(), uv__udp_send(), uv_barrier_init(), uv_chdir(), uv_cpu_info(), uv_cwd(), uv_exepath(), uv_fs_event_start(), uv_fs_read(), uv_fs_write(), uv_getaddrinfo(), uv_interface_addresses(), uv_loop_init(), uv_loop_new(), uv_os_getenv(), uv_os_tmpdir(), uv_pipe_bind(), uv_pipe_chmod(), uv_pipe_connect(), uv_process_fs_event_req(), uv_relative_path(), uv_set_process_title(), uv_setup_args(), uv_spawn(), uv_split_path(), uv_tcp_listen(), uv_thread_create_ex(), uv_uptime(), uv_utf8_to_utf16_alloc(), and uv_write2().
void uv__metrics_set_provider_entry_time | ( | uv_loop_t * | loop | ) |
Definition at line 899 of file uv-common.c.
References flags, uv__loop_metrics_s::lock, loop, uv__loop_metrics_s::provider_entry_time, uv__get_internal_fields, uv__get_loop_metrics, uv_hrtime(), UV_METRICS_IDLE_TIME, uv_mutex_lock(), and uv_mutex_unlock().
Referenced by uv__io_poll(), uv__poll(), and uv__poll_wine().
void uv__metrics_update_idle_time | ( | uv_loop_t * | loop | ) |
Definition at line 872 of file uv-common.c.
References flags, uv__loop_metrics_s::lock, loop, uv__loop_metrics_s::provider_entry_time, uv__loop_metrics_s::provider_idle_time, uv__get_internal_fields, uv__get_loop_metrics, uv_hrtime(), UV_METRICS_IDLE_TIME, uv_mutex_lock(), and uv_mutex_unlock().
Referenced by uv__io_poll(), uv__poll(), uv__poll_wine(), and uv_run().
Definition at line 505 of file uv-common.c.
References h, uv_loop_s::handle_queue, loop, NULL, QUEUE_DATA, QUEUE_FOREACH, type, uv__is_active, uv_default_loop(), UV_HANDLE_ACTIVE, UV_HANDLE_INTERNAL, UV_HANDLE_REF, UV_HANDLE_TYPE_MAP, and X.
Referenced by uv_print_active_handles(), and uv_print_all_handles().
void* uv__realloc | ( | void * | ptr, |
size_t | size | ||
) |
Definition at line 96 of file uv-common.c.
References uv__allocator_t::local_realloc, NULL, uv__allocator, and uv__free().
Referenced by fs__scandir(), scandir(), uv__loops_add(), uv__loops_remove(), uv__reallocf(), and uv__stream_queue_fd().
void* uv__reallocf | ( | void * | ptr, |
size_t | size | ||
) |
Definition at line 103 of file uv-common.c.
References NULL, uv__free(), and uv__realloc().
Referenced by fs__statfs(), maybe_resize(), uv__fs_readlink(), uv__pollfds_maybe_resize(), and uv_exepath().
char* uv__strdup | ( | const char * | s | ) |
Definition at line 55 of file uv-common.c.
References len, regress::m, memcpy(), NULL, s, and uv__malloc().
Referenced by uv__dlerror(), uv__fs_readdir(), uv__inotify_fork(), uv__interface_addresses_v6(), uv__search_path(), uv__unknown_err_code(), uv_cpu_info(), uv_fs_event_start(), uv_fs_mkdtemp(), uv_fs_mkstemp(), uv_interface_addresses(), uv_os_environ(), uv_pipe_bind(), uv_set_process_title(), and uv_setup_args().
Definition at line 63 of file uv-common.c.
References len, regress::m, memcpy(), n, NULL, s, and uv__malloc().
Referenced by read_models().
Definition at line 407 of file uv-common.c.
References addr, addrlen, AF_INET, AF_INET6, AF_UNIX, handle, NULL, and UV_HANDLE_UDP_CONNECTED.
Referenced by uv_udp_send(), and uv_udp_try_send().
Definition at line 393 of file uv-common.c.
References addr, addrlen, handle, and uv_udp_getpeername().
Referenced by uv_udp_open().
Definition at line 165 of file uv-common.c.
References err, NULL, snprintf, and uv__strdup().
Referenced by uv_err_name(), and uv_strerror().
Definition at line 157 of file uv-common.c.
References len.
Referenced by alloc_buffer(), echo_read(), main(), on_new_connection(), on_open(), on_type(), uv__build_coalesced_write_req(), uv__pipe_read_data(), uv__pipe_write_ipc(), uv__read(), uv__udp_recvmsg(), uv_process_tcp_read_req(), uv_process_tty_read_raw_req(), uv_process_udp_recv_req(), uv_tcp_queue_read(), uv_tty_queue_read_line(), uv_udp_queue_recv(), and write_data().
uv_loop_t* uv_default_loop | ( | void | ) |
Definition at line 763 of file uv-common.c.
References default_loop_ptr, default_loop_struct, NULL, and uv_loop_init().
Referenced by idle_cb(), main(), on_open(), on_read(), on_write(), and uv__print_handles().
Definition at line 189 of file uv-common.c.
References err, uv__unknown_err_code(), UV_ERR_NAME_GEN, and UV_ERRNO_MAP.
Referenced by echo_read(), echo_write(), main(), on_connect(), on_new_connection(), on_read(), and on_resolved().
Definition at line 178 of file uv-common.c.
References buflen, err, snprintf, UV_ERR_NAME_GEN_R, and UV_ERRNO_MAP.
void uv_free_cpu_info | ( | uv_cpu_info_t * | cpu_infos, |
int | count | ||
) |
Definition at line 846 of file uv-common.c.
References count, i, and uv__free().
Referenced by setup_workers(), and uv_cpu_info().
int uv_fs_event_getpath | ( | uv_fs_event_t * | handle, |
char * | buffer, | ||
size_t * | size | ||
) |
Definition at line 592 of file uv-common.c.
References handle, memcpy(), and uv__is_active.
Referenced by run_command().
int uv_fs_scandir_next | ( | uv_fs_t * | req, |
uv_dirent_t * | ent | ||
) |
Definition at line 651 of file uv-common.c.
References assert(), dirent::d_name, uv_dirent_s::name, NULL, req, uv_dirent_s::type, uv__fs_get_dirent_type(), uv__fs_scandir_free, and uv__get_nbufs().
size_t uv_handle_size | ( | uv_handle_type | type | ) |
int uv_has_ref | ( | const uv_handle_t * | handle | ) |
int uv_ip4_addr | ( | const char * | ip, |
int | port, | ||
struct sockaddr_in * | addr | ||
) |
Definition at line 221 of file uv-common.c.
References addr, AF_INET, htons, ip, memset(), and uv_inet_pton().
Referenced by main(), uv_udp_set_membership(), uv_udp_set_multicast_interface(), uv_udp_set_source_membership(), and uv_winsock_init().
int uv_ip4_name | ( | const struct sockaddr_in * | src, |
char * | dst, | ||
size_t | size | ||
) |
Definition at line 267 of file uv-common.c.
References AF_INET, dst, src, and uv_inet_ntop().
Referenced by main(), on_read(), and on_resolved().
int uv_ip6_addr | ( | const char * | ip, |
int | port, | ||
struct sockaddr_in6 * | addr | ||
) |
Definition at line 232 of file uv-common.c.
References addr, AF_INET6, htons, ip, memcpy(), memset(), NULL, and uv_inet_pton().
Referenced by uv__udp_set_membership6(), uv__udp_set_source_membership6(), uv_udp_set_membership(), uv_udp_set_multicast_interface(), uv_udp_set_source_membership(), and uv_winsock_init().
int uv_ip6_name | ( | const struct sockaddr_in6 * | src, |
char * | dst, | ||
size_t | size | ||
) |
Definition at line 272 of file uv-common.c.
References AF_INET6, dst, src, and uv_inet_ntop().
Referenced by main().
void uv_library_shutdown | ( | void | ) |
Definition at line 859 of file uv-common.c.
References uv__load_relaxed, uv__process_title_cleanup(), uv__signal_cleanup(), uv__store_relaxed, and uv__threadpool_cleanup().
Definition at line 791 of file uv-common.c.
References uv_loop_s::data, default_loop_ptr, h, uv_loop_s::handle_queue, loop, memset(), NULL, QUEUE_DATA, QUEUE_FOREACH, uv__has_active_reqs, uv__loop_close(), and UV_HANDLE_INTERNAL.
Referenced by main(), and uv_loop_delete().
int uv_loop_configure | ( | uv_loop_t * | loop, |
uv_loop_option | option, | ||
... | |||
) |
Definition at line 746 of file uv-common.c.
References err, loop, and uv__loop_configure().
void uv_loop_delete | ( | uv_loop_t * | loop | ) |
Definition at line 821 of file uv-common.c.
References assert(), default_loop_ptr, err, loop, uv__free(), and uv_loop_close().
uv_loop_t* uv_loop_new | ( | void | ) |
Definition at line 775 of file uv-common.c.
References loop, NULL, uv__free(), uv__malloc(), and uv_loop_init().
size_t uv_loop_size | ( | void | ) |
Definition at line 152 of file uv-common.c.
Definition at line 914 of file uv-common.c.
References uv__loop_metrics_s::lock, loop, uv__loop_metrics_s::provider_entry_time, uv__loop_metrics_s::provider_idle_time, uv__get_loop_metrics, uv_hrtime(), uv_mutex_lock(), and uv_mutex_unlock().
Definition at line 567 of file uv-common.c.
References loop.
Referenced by poll_cb(), timer_cb(), and uv_fs_poll_start().
void uv_os_free_environ | ( | uv_env_item_t * | envitems, |
int | count | ||
) |
void uv_print_active_handles | ( | uv_loop_t * | loop, |
FILE * | stream | ||
) |
Definition at line 542 of file uv-common.c.
References loop, and uv__print_handles().
void uv_print_all_handles | ( | uv_loop_t * | loop, |
FILE * | stream | ||
) |
Definition at line 537 of file uv-common.c.
References loop, and uv__print_handles().
int uv_recv_buffer_size | ( | uv_handle_t * | handle, |
int * | value | ||
) |
Definition at line 584 of file uv-common.c.
References handle, SO_RCVBUF, uv__socket_sockopt(), and value.
void uv_ref | ( | uv_handle_t * | handle | ) |
int uv_replace_allocator | ( | uv_malloc_func | malloc_func, |
uv_realloc_func | realloc_func, | ||
uv_calloc_func | calloc_func, | ||
uv_free_func | free_func | ||
) |
Definition at line 114 of file uv-common.c.
References uv__allocator_t::local_calloc, uv__allocator_t::local_free, uv__allocator_t::local_malloc, uv__allocator_t::local_realloc, NULL, and uv__allocator.
size_t uv_req_size | ( | uv_req_type | type | ) |
int uv_send_buffer_size | ( | uv_handle_t * | handle, |
int * | value | ||
) |
Definition at line 588 of file uv-common.c.
References handle, SO_SNDBUF, uv__socket_sockopt(), and value.
void uv_stop | ( | uv_loop_t * | loop | ) |
Definition at line 562 of file uv-common.c.
References loop, and uv_loop_s::stop_flag.
Referenced by idle_cb().
Definition at line 212 of file uv-common.c.
References err, uv__unknown_err_code(), UV_ERRNO_MAP, and UV_STRERROR_GEN.
Referenced by echo_write(), invoke_cgi_script(), main(), on_new_connection(), on_open(), on_read(), on_send(), on_type(), and on_write().
Definition at line 201 of file uv-common.c.
References buflen, err, snprintf, UV_ERRNO_MAP, and UV_STRERROR_GEN_R.
int uv_tcp_connect | ( | uv_connect_t * | req, |
uv_tcp_t * | handle, | ||
const struct sockaddr * | addr, | ||
uv_connect_cb | cb | ||
) |
Definition at line 345 of file uv-common.c.
References addr, addrlen, AF_INET, AF_INET6, cb, handle, req, and uv__tcp_connect().
Referenced by on_resolved().
Definition at line 365 of file uv-common.c.
References addr, addrlen, AF_INET, AF_INET6, handle, NULL, uv__udp_connect(), uv__udp_disconnect(), and UV_HANDLE_UDP_CONNECTED.
Definition at line 321 of file uv-common.c.
References AF_UNSPEC, handle, loop, and uv_udp_init_ex().
Referenced by main().
Definition at line 296 of file uv-common.c.
References AF_INET, AF_INET6, AF_UNSPEC, domain, flags, handle, loop, uv__udp_init_ex(), UV_HANDLE_UDP_RECVMMSG, and UV_UDP_RECVMMSG.
Referenced by uv_udp_init().
int uv_udp_recv_start | ( | uv_udp_t * | handle, |
uv_alloc_cb | alloc_cb, | ||
uv_udp_recv_cb | recv_cb | ||
) |
Definition at line 468 of file uv-common.c.
References handle, NULL, and uv__udp_recv_start().
Referenced by main().
Definition at line 478 of file uv-common.c.
References handle, and uv__udp_recv_stop().
Referenced by on_read(), uv_process_udp_recv_req(), and uv_udp_close().
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 | ||
) |
Definition at line 438 of file uv-common.c.
References addr, addrlen, bufs, handle, req, uv__udp_check_before_send(), and uv__udp_send().
Referenced by main().
int uv_udp_try_send | ( | uv_udp_t * | handle, |
const uv_buf_t | bufs[], | ||
unsigned int | nbufs, | ||
const struct sockaddr * | addr | ||
) |
Definition at line 454 of file uv-common.c.
References addr, addrlen, bufs, handle, uv__udp_check_before_send(), and uv__udp_try_send().
void uv_unref | ( | uv_handle_t * | handle | ) |
Definition at line 552 of file uv-common.c.
References handle, and uv__handle_unref.
Referenced by eof_timer_init(), and main().
void uv_walk | ( | uv_loop_t * | loop, |
uv_walk_cb | walk_cb, | ||
void * | arg | ||
) |
Definition at line 486 of file uv-common.c.
References h, uv_loop_s::handle_queue, loop, queue, QUEUE_DATA, QUEUE_EMPTY, QUEUE_HEAD, QUEUE_INSERT_TAIL, QUEUE_MOVE, QUEUE_REMOVE, and UV_HANDLE_INTERNAL.
|
static |
Definition at line 760 of file uv-common.c.
Referenced by uv_default_loop(), uv_loop_close(), and uv_loop_delete().
|
static |
Definition at line 759 of file uv-common.c.
Referenced by uv_default_loop().
|
static |
Definition at line 48 of file uv-common.c.
Referenced by uv__calloc(), uv__free(), uv__malloc(), uv__realloc(), and uv_replace_allocator().