Rizin
unix-like reverse engineering framework and cli tools
|
#include <assert.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include "uv.h"
#include "uv/tree.h"
#include "queue.h"
#include "strscpy.h"
Go to the source code of this file.
Classes | |
struct | uv__loop_metrics_s |
struct | uv__loop_internal_fields_s |
Typedefs | |
typedef struct uv__loop_metrics_s | uv__loop_metrics_t |
typedef struct uv__loop_internal_fields_s | uv__loop_internal_fields_t |
Definition at line 55 of file uv-common.h.
Definition at line 57 of file uv-common.h.
Definition at line 60 of file uv-common.h.
#define uv__active_handle_add | ( | h | ) |
Definition at line 240 of file uv-common.h.
#define uv__active_handle_rm | ( | h | ) |
Definition at line 246 of file uv-common.h.
Definition at line 48 of file uv-common.h.
#define uv__get_internal_fields | ( | loop | ) | ((uv__loop_internal_fields_t*) loop->internal_fields) |
Definition at line 336 of file uv-common.h.
#define uv__get_loop_metrics | ( | loop | ) | (&uv__get_internal_fields(loop)->loop_metrics) |
Definition at line 339 of file uv-common.h.
#define uv__handle_init | ( | loop_, | |
h, | |||
type_ | |||
) |
Definition at line 301 of file uv-common.h.
Definition at line 298 of file uv-common.h.
#define uv__handle_ref | ( | h | ) |
Definition at line 274 of file uv-common.h.
#define uv__handle_start | ( | h | ) |
Definition at line 258 of file uv-common.h.
#define uv__handle_stop | ( | h | ) |
Definition at line 266 of file uv-common.h.
#define uv__handle_unref | ( | h | ) |
Definition at line 283 of file uv-common.h.
Definition at line 237 of file uv-common.h.
#define uv__has_active_reqs | ( | loop | ) | ((loop)->active_reqs.count > 0) |
Definition at line 221 of file uv-common.h.
#define uv__has_ref | ( | h | ) | (((h)->flags & UV_HANDLE_REF) != 0) |
Definition at line 292 of file uv-common.h.
#define uv__is_active | ( | h | ) | (((h)->flags & UV_HANDLE_ACTIVE) != 0) |
Definition at line 252 of file uv-common.h.
#define uv__is_closing | ( | h | ) | (((h)->flags & (UV_HANDLE_CLOSING | UV_HANDLE_CLOSED)) != 0) |
Definition at line 255 of file uv-common.h.
Definition at line 67 of file uv-common.h.
Definition at line 329 of file uv-common.h.
Definition at line 224 of file uv-common.h.
Definition at line 230 of file uv-common.h.
#define UV_REQ_INIT | ( | req, | |
typ | |||
) |
Definition at line 322 of file uv-common.h.
typedef struct uv__loop_internal_fields_s uv__loop_internal_fields_t |
Definition at line 349 of file uv-common.h.
typedef struct uv__loop_metrics_s uv__loop_metrics_t |
Definition at line 349 of file uv-common.h.
anonymous enum |
Definition at line 72 of file uv-common.h.
enum uv__work_kind |
Enumerator | |
---|---|
UV__WORK_CPU | |
UV__WORK_FAST_IO | |
UV__WORK_SLOW_IO |
Definition at line 191 of file uv-common.h.
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_poll_close | ( | uv_fs_poll_t * | handle | ) |
Definition at line 164 of file fs-poll.c.
References handle, NULL, uv__make_close_pending(), and uv_fs_poll_stop().
Referenced by uv_close().
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 42 of file getaddrinfo.c.
References assert(), UV__ERR, and uv_translate_sys_error().
Referenced by uv__getaddrinfo_work(), and uv__getnameinfo_work().
void uv__loop_close | ( | uv_loop_t * | loop | ) |
Definition at line 165 of file loop.c.
References ARRAY_SIZE, assert(), i, uv_loop_s::internal_fields, uv__loop_metrics_s::lock, loop, uv__loop_internal_fields_s::loop_metrics, NULL, QUEUE_EMPTY, uv__async_stop(), uv__close(), uv__free(), uv__get_internal_fields, uv__handle_close, uv__handle_closing, uv__has_active_reqs, uv__loops_remove(), uv__platform_loop_delete(), uv__signal_loop_cleanup(), uv_mutex_destroy(), uv_mutex_lock(), uv_mutex_unlock(), and uv_rwlock_destroy().
Referenced by uv_loop_close().
int uv__loop_configure | ( | uv_loop_t * | loop, |
uv_loop_option | option, | ||
va_list | ap | ||
) |
Definition at line 211 of file loop.c.
References uv__loop_internal_fields_s::flags, loop, uv__get_internal_fields, UV_LOOP_BLOCK_SIGNAL, UV_LOOP_BLOCK_SIGPROF, and UV_METRICS_IDLE_TIME.
Referenced by uv_loop_configure().
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 141 of file timer.c.
References container_of, handle, INT_MAX, loop, NULL, and timer_heap().
Referenced by uv_backend_timeout().
void uv__process_title_cleanup | ( | void | ) |
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().
void uv__run_timers | ( | uv_loop_t * | loop | ) |
Definition at line 162 of file timer.c.
References container_of, handle, loop, NULL, timer_heap(), uv_timer_again(), and uv_timer_stop().
Referenced by uv_run().
void uv__signal_cleanup | ( | void | ) |
Definition at line 80 of file signal.c.
References uv__close(), and uv__signal_lock_pipefd.
Referenced by uv__signal_global_reinit(), and uv_library_shutdown().
int uv__socket_sockopt | ( | uv_handle_t * | handle, |
int | optname, | ||
int * | value | ||
) |
Definition at line 180 of file core.c.
References fd, handle, len, NULL, r, socket, SOL_SOCKET, UV__ERR, uv__stream_fd, uv_translate_sys_error(), and value.
Referenced by uv_recv_buffer_size(), and uv_send_buffer_size().
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().
int uv__tcp_bind | ( | uv_tcp_t * | tcp, |
const struct sockaddr * | addr, | ||
unsigned int | addrlen, | ||
unsigned int | flags | ||
) |
Definition at line 148 of file tcp.c.
References addr, addrlen, AF_INET6, bind, EADDRINUSE, EAFNOSUPPORT, EOPNOTSUPP, err, flags, handle, IPV6_V6ONLY, maybe_new_socket(), SO_REUSEADDR, SOL_SOCKET, UV__ERR, UV_HANDLE_BOUND, UV_HANDLE_IPV6, UV_TCP_IPV6ONLY, uv_tcp_try_bind(), and uv_translate_sys_error().
Referenced by uv_tcp_bind().
int uv__tcp_connect | ( | uv_connect_t * | req, |
uv_tcp_t * | handle, | ||
const struct sockaddr * | addr, | ||
unsigned int | addrlen, | ||
uv_connect_cb | cb | ||
) |
Definition at line 204 of file tcp.c.
References addr, addrlen, assert(), cb, ECONNREFUSED, EINPROGRESS, EINTR, EINVAL, err, handle, maybe_new_socket(), NULL, QUEUE_INIT, r, req, UV__ERR, uv__io_feed(), uv__io_start(), uv__req_init, uv__stream_fd, UV_HANDLE_READABLE, UV_HANDLE_WRITABLE, uv_tcp_try_connect(), and uv_translate_sys_error().
Referenced by uv_tcp_connect().
void uv__threadpool_cleanup | ( | void | ) |
Definition at line 163 of file threadpool.c.
References cond, default_threads, exit_message, i, mutex, nthreads, NULL, post(), threads, uv__free(), UV__WORK_CPU, uv_cond_destroy(), uv_mutex_destroy(), and uv_thread_join().
Referenced by uv_library_shutdown().
void uv__timer_close | ( | uv_timer_t * | handle | ) |
Definition at line 182 of file timer.c.
References handle, and uv_timer_stop().
Referenced by uv_close(), and uv_process_endgames().
int uv__udp_bind | ( | uv_udp_t * | handle, |
const struct sockaddr * | addr, | ||
unsigned int | addrlen, | ||
unsigned int | flags | ||
) |
Definition at line 508 of file udp.c.
References addr, addrlen, AF_INET6, bind, EAFNOSUPPORT, err, fd, flags, handle, IPV6_V6ONLY, SOCK_DGRAM, UV__ERR, uv__set_reuse(), uv__socket(), UV_HANDLE_BOUND, UV_HANDLE_IPV6, UV_UDP_IPV6ONLY, and UV_UDP_REUSEADDR.
Referenced by uv__udp_maybe_deferred_bind(), and uv_udp_bind().
Definition at line 606 of file udp.c.
References addr, addrlen, EINTR, err, handle, UV__ERR, uv__udp_maybe_deferred_bind(), uv_addr_ip4_any_, uv_addr_ip6_any_, UV_HANDLE_BOUND, UV_HANDLE_UDP_CONNECTED, uv_translate_sys_error(), and uv_udp_maybe_bind().
Referenced by uv_udp_connect().
Definition at line 629 of file udp.c.
References addr, AF_UNSPEC, EAFNOSUPPORT, EINTR, err, handle, memset(), r, UV__ERR, UV_HANDLE_UDP_CONNECTED, and uv_translate_sys_error().
Referenced by uv_udp_connect().
Definition at line 954 of file udp.c.
References AF_UNSPEC, domain, DWORD, err, fd, handle, loop, NULL, QUEUE_INIT, QUEUE_REMOVE, SOCK_DGRAM, socket, uv__handle_init, uv__io_init(), uv__socket(), uv__udp_io(), UV_REQ_INIT, uv_translate_sys_error(), and uv_udp_set_socket().
Referenced by uv_udp_init_ex().
Definition at line 393 of file uv-common.c.
References addr, addrlen, handle, and uv_udp_getpeername().
Referenced by uv_udp_open().
int uv__udp_recv_start | ( | uv_udp_t * | handle, |
uv_alloc_cb | alloccb, | ||
uv_udp_recv_cb | recv_cb | ||
) |
Definition at line 1297 of file udp.c.
References AF_INET, err, handle, INCREASE_ACTIVE_COUNT, loop, NULL, uv__handle_start, uv__io_active(), uv__io_start(), uv__udp_maybe_deferred_bind(), uv_addr_ip4_any_, UV_HANDLE_READ_PENDING, UV_HANDLE_READING, uv_translate_sys_error(), uv_udp_maybe_bind(), and uv_udp_queue_recv().
Referenced by uv_udp_recv_start().
Definition at line 1322 of file udp.c.
References DECREASE_ACTIVE_COUNT, handle, loop, and UV_HANDLE_READING.
Referenced by uv_udp_recv_stop().
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 | ||
) |
Definition at line 650 of file udp.c.
References addr, addrlen, AF_UNSPEC, ARRAY_SIZE, assert(), bufs, err, handle, memcpy(), NULL, QUEUE_EMPTY, QUEUE_INSERT_TAIL, req, uv__count_bufs(), uv__handle_start, uv__io_start(), uv__malloc(), uv__req_init, uv__req_unregister, uv__send(), uv__udp_maybe_deferred_bind(), uv__udp_sendmsg(), uv_addr_ip4_any_, uv_addr_ip6_any_, UV_HANDLE_BOUND, UV_HANDLE_UDP_PROCESSING, uv_translate_sys_error(), and uv_udp_maybe_bind().
Referenced by uv_udp_send().
int uv__udp_try_send | ( | uv_udp_t * | handle, |
const uv_buf_t | bufs[], | ||
unsigned int | nbufs, | ||
const struct sockaddr * | addr, | ||
unsigned int | addrlen | ||
) |
Definition at line 716 of file udp.c.
References addr, addrlen, assert(), bufs, bytes, DWORD, EAGAIN, EINTR, ENOBUFS, err, h, handle, memset(), NULL, uv__convert_to_localhost_if_unspecified(), UV__ERR, uv__udp_maybe_deferred_bind(), uv_addr_ip4_any_, uv_addr_ip6_any_, UV_HANDLE_BOUND, UV_HANDLE_UDP_CONNECTED, uv_translate_sys_error(), and uv_udp_maybe_bind().
Referenced by uv_udp_try_send().
void uv__work_done | ( | uv_async_t * | handle | ) |
Definition at line 295 of file threadpool.c.
References container_of, err, handle, loop, QUEUE_EMPTY, QUEUE_HEAD, QUEUE_MOVE, QUEUE_REMOVE, uv__cancelled(), uv_mutex_lock(), uv_mutex_unlock(), w, and wq.
Referenced by uv_loop_init().
void uv__work_submit | ( | uv_loop_t * | loop, |
struct uv__work * | w, | ||
enum uv__work_kind | kind, | ||
void(*)(struct uv__work *w) | work, | ||
void(*)(struct uv__work *w, int status) | done | ||
) |
Definition at line 256 of file threadpool.c.
References done, init_once(), loop, once, post(), uv_once(), w, and uv__work::work.
Referenced by uv_getaddrinfo(), uv_getnameinfo(), uv_queue_work(), and uv_random().