Rizin
unix-like reverse engineering framework and cli tools
unix.h File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <termios.h>
#include <pwd.h>
#include <semaphore.h>
#include <sys/param.h>
#include <pthread.h>
#include <signal.h>
#include "uv/threadpool.h"

Go to the source code of this file.

Classes

struct  uv__io_s
 
struct  uv_buf_t
 
struct  _uv_barrier
 
struct  uv_barrier_t
 
struct  uv_lib_t
 

Macros

#define NI_MAXHOST   1025
 
#define NI_MAXSERV   32
 
#define UV_IO_PRIVATE_PLATFORM_FIELDS   /* empty */
 
#define UV_PLATFORM_SEM_T   sem_t
 
#define UV_PLATFORM_LOOP_FIELDS   /* empty */
 
#define UV_PLATFORM_FS_EVENT_FIELDS   /* empty */
 
#define UV_STREAM_PRIVATE_PLATFORM_FIELDS   /* empty */
 
#define UV_ONCE_INIT   PTHREAD_ONCE_INIT
 
#define UV_DIR_PRIVATE_FIELDS    DIR* dir;
 
#define UV_DYNAMIC   /* empty */
 
#define UV_LOOP_PRIVATE_FIELDS
 
#define UV_REQ_TYPE_PRIVATE   /* empty */
 
#define UV_REQ_PRIVATE_FIELDS   /* empty */
 
#define UV_PRIVATE_REQ_TYPES   /* empty */
 
#define UV_WRITE_PRIVATE_FIELDS
 
#define UV_CONNECT_PRIVATE_FIELDS    void* queue[2]; \
 
#define UV_SHUTDOWN_PRIVATE_FIELDS   /* empty */
 
#define UV_UDP_SEND_PRIVATE_FIELDS
 
#define UV_HANDLE_PRIVATE_FIELDS
 
#define UV_STREAM_PRIVATE_FIELDS
 
#define UV_TCP_PRIVATE_FIELDS   /* empty */
 
#define UV_UDP_PRIVATE_FIELDS
 
#define UV_PIPE_PRIVATE_FIELDS    const char* pipe_fname; /* strdup'ed */
 
#define UV_POLL_PRIVATE_FIELDS    uv__io_t io_watcher;
 
#define UV_PREPARE_PRIVATE_FIELDS
 
#define UV_CHECK_PRIVATE_FIELDS
 
#define UV_IDLE_PRIVATE_FIELDS
 
#define UV_ASYNC_PRIVATE_FIELDS
 
#define UV_TIMER_PRIVATE_FIELDS
 
#define UV_GETADDRINFO_PRIVATE_FIELDS
 
#define UV_GETNAMEINFO_PRIVATE_FIELDS
 
#define UV_PROCESS_PRIVATE_FIELDS
 
#define UV_FS_PRIVATE_FIELDS
 
#define UV_WORK_PRIVATE_FIELDS    struct uv__work work_req;
 
#define UV_TTY_PRIVATE_FIELDS
 
#define UV_SIGNAL_PRIVATE_FIELDS
 
#define UV_FS_EVENT_PRIVATE_FIELDS
 
#define UV_FS_O_APPEND   0
 
#define UV_FS_O_CREAT   0
 
#define UV_FS_O_DIRECT   0
 
#define UV_FS_O_DIRECTORY   0
 
#define UV_FS_O_DSYNC   0
 
#define UV_FS_O_EXCL   0
 
#define UV_FS_O_EXLOCK   0
 
#define UV_FS_O_NOATIME   0
 
#define UV_FS_O_NOCTTY   0
 
#define UV_FS_O_NOFOLLOW   0
 
#define UV_FS_O_NONBLOCK   0
 
#define UV_FS_O_RDONLY   0
 
#define UV_FS_O_RDWR   0
 
#define UV_FS_O_SYMLINK   0
 
#define UV_FS_O_SYNC   0
 
#define UV_FS_O_TRUNC   0
 
#define UV_FS_O_WRONLY   0
 
#define UV_FS_O_FILEMAP   0
 
#define UV_FS_O_RANDOM   0
 
#define UV_FS_O_SHORT_LIVED   0
 
#define UV_FS_O_SEQUENTIAL   0
 
#define UV_FS_O_TEMPORARY   0
 

Typedefs

typedef void(* uv__io_cb) (struct uv_loop_s *loop, struct uv__io_s *w, unsigned int events)
 
typedef struct uv__io_s uv__io_t
 
typedef struct uv_buf_t uv_buf_t
 
typedef int uv_file
 
typedef int uv_os_sock_t
 
typedef int uv_os_fd_t
 
typedef pid_t uv_pid_t
 
typedef pthread_once_t uv_once_t
 
typedef pthread_t uv_thread_t
 
typedef pthread_mutex_t uv_mutex_t
 
typedef pthread_rwlock_t uv_rwlock_t
 
typedef UV_PLATFORM_SEM_T uv_sem_t
 
typedef pthread_cond_t uv_cond_t
 
typedef pthread_key_t uv_key_t
 
typedef gid_t uv_gid_t
 
typedef uid_t uv_uid_t
 
typedef struct dirent uv__dirent_t
 

Macro Definition Documentation

◆ NI_MAXHOST

#define NI_MAXHOST   1025

Definition at line 77 of file unix.h.

◆ NI_MAXSERV

#define NI_MAXSERV   32

Definition at line 81 of file unix.h.

◆ UV_ASYNC_PRIVATE_FIELDS

#define UV_ASYNC_PRIVATE_FIELDS
Value:
uv_async_cb async_cb; \
void* queue[2]; \
int pending; \
void(* uv_async_cb)(uv_async_t *handle)
Definition: uv.h:322
uv_pipe_t queue
Definition: worker.c:9

Definition at line 327 of file unix.h.

◆ UV_CHECK_PRIVATE_FIELDS

#define UV_CHECK_PRIVATE_FIELDS
Value:
uv_check_cb check_cb; \
void* queue[2]; \
void(* uv_check_cb)(uv_check_t *handle)
Definition: uv.h:324

Definition at line 319 of file unix.h.

◆ UV_CONNECT_PRIVATE_FIELDS

#define UV_CONNECT_PRIVATE_FIELDS    void* queue[2]; \

Definition at line 270 of file unix.h.

◆ UV_DIR_PRIVATE_FIELDS

#define UV_DIR_PRIVATE_FIELDS    DIR* dir;

Definition at line 173 of file unix.h.

◆ UV_DYNAMIC

#define UV_DYNAMIC   /* empty */

Definition at line 216 of file unix.h.

◆ UV_FS_EVENT_PRIVATE_FIELDS

#define UV_FS_EVENT_PRIVATE_FIELDS
Value:
UV_PLATFORM_FS_EVENT_FIELDS \
void(* uv_fs_event_cb)(uv_fs_event_t *handle, const char *filename, int events, int status)
Definition: uv.h:369
static const char * cb[]
Definition: z80_tab.h:176

Definition at line 395 of file unix.h.

◆ UV_FS_O_APPEND

#define UV_FS_O_APPEND   0

Definition at line 403 of file unix.h.

◆ UV_FS_O_CREAT

#define UV_FS_O_CREAT   0

Definition at line 408 of file unix.h.

◆ UV_FS_O_DIRECT

#define UV_FS_O_DIRECT   0

Definition at line 426 of file unix.h.

◆ UV_FS_O_DIRECTORY

#define UV_FS_O_DIRECTORY   0

Definition at line 432 of file unix.h.

◆ UV_FS_O_DSYNC

#define UV_FS_O_DSYNC   0

Definition at line 437 of file unix.h.

◆ UV_FS_O_EXCL

#define UV_FS_O_EXCL   0

Definition at line 442 of file unix.h.

◆ UV_FS_O_EXLOCK

#define UV_FS_O_EXLOCK   0

Definition at line 447 of file unix.h.

◆ UV_FS_O_FILEMAP

#define UV_FS_O_FILEMAP   0

Definition at line 501 of file unix.h.

◆ UV_FS_O_NOATIME

#define UV_FS_O_NOATIME   0

Definition at line 452 of file unix.h.

◆ UV_FS_O_NOCTTY

#define UV_FS_O_NOCTTY   0

Definition at line 457 of file unix.h.

◆ UV_FS_O_NOFOLLOW

#define UV_FS_O_NOFOLLOW   0

Definition at line 462 of file unix.h.

◆ UV_FS_O_NONBLOCK

#define UV_FS_O_NONBLOCK   0

Definition at line 467 of file unix.h.

◆ UV_FS_O_RANDOM

#define UV_FS_O_RANDOM   0

Definition at line 502 of file unix.h.

◆ UV_FS_O_RDONLY

#define UV_FS_O_RDONLY   0

Definition at line 472 of file unix.h.

◆ UV_FS_O_RDWR

#define UV_FS_O_RDWR   0

Definition at line 477 of file unix.h.

◆ UV_FS_O_SEQUENTIAL

#define UV_FS_O_SEQUENTIAL   0

Definition at line 504 of file unix.h.

◆ UV_FS_O_SHORT_LIVED

#define UV_FS_O_SHORT_LIVED   0

Definition at line 503 of file unix.h.

◆ UV_FS_O_SYMLINK

#define UV_FS_O_SYMLINK   0

Definition at line 482 of file unix.h.

◆ UV_FS_O_SYNC

#define UV_FS_O_SYNC   0

Definition at line 487 of file unix.h.

◆ UV_FS_O_TEMPORARY

#define UV_FS_O_TEMPORARY   0

Definition at line 505 of file unix.h.

◆ UV_FS_O_TRUNC

#define UV_FS_O_TRUNC   0

Definition at line 492 of file unix.h.

◆ UV_FS_O_WRONLY

#define UV_FS_O_WRONLY   0

Definition at line 497 of file unix.h.

◆ UV_FS_PRIVATE_FIELDS

#define UV_FS_PRIVATE_FIELDS
Value:
const char *new_path; \
uv_file file; \
int flags; \
mode_t mode; \
unsigned int nbufs; \
uv_buf_t* bufs; \
off_t off; \
uv_uid_t uid; \
uv_gid_t gid; \
double atime; \
double mtime; \
struct uv__work work_req; \
uv_buf_t bufsml[4]; \
const char int mode
Definition: ioapi.h:137
int off
Definition: pal.c:13
static struct sockaddr static addrlen static backlog const void static flags void flags
Definition: sfsocketcall.h:123
static char bufs[4][128]
Buffers for uint64_to_str() and uint64_to_nicestr()
Definition: util.c:18
static int file
Definition: z80asm.c:58

Definition at line 361 of file unix.h.

◆ UV_GETADDRINFO_PRIVATE_FIELDS

#define UV_GETADDRINFO_PRIVATE_FIELDS
Value:
struct uv__work work_req; \
uv_getaddrinfo_cb cb; \
struct addrinfo* hints; \
char* hostname; \
char* service; \
struct addrinfo* addrinfo; \
int retcode;

Definition at line 339 of file unix.h.

◆ UV_GETNAMEINFO_PRIVATE_FIELDS

#define UV_GETNAMEINFO_PRIVATE_FIELDS
Value:
struct uv__work work_req; \
uv_getnameinfo_cb getnameinfo_cb; \
struct sockaddr_storage storage; \
int flags; \
char host[NI_MAXHOST]; \
char service[NI_MAXSERV]; \
int retcode;
#define NI_MAXHOST
Definition: unix.h:77
#define NI_MAXSERV
Definition: unix.h:81

Definition at line 348 of file unix.h.

◆ UV_HANDLE_PRIVATE_FIELDS

#define UV_HANDLE_PRIVATE_FIELDS
Value:
uv_handle_t* next_closing; \
unsigned int flags; \

Definition at line 284 of file unix.h.

◆ UV_IDLE_PRIVATE_FIELDS

#define UV_IDLE_PRIVATE_FIELDS
Value:
void* queue[2]; \
void idle_cb(uv_idle_t *handle)
Definition: main.c:6
void(* uv_idle_cb)(uv_idle_t *handle)
Definition: uv.h:325

Definition at line 323 of file unix.h.

◆ UV_IO_PRIVATE_PLATFORM_FIELDS

#define UV_IO_PRIVATE_PLATFORM_FIELDS   /* empty */

Definition at line 85 of file unix.h.

◆ UV_LOOP_PRIVATE_FIELDS

#define UV_LOOP_PRIVATE_FIELDS

Definition at line 223 of file unix.h.

◆ UV_ONCE_INIT

#define UV_ONCE_INIT   PTHREAD_ONCE_INIT

Definition at line 133 of file unix.h.

◆ UV_PIPE_PRIVATE_FIELDS

#define UV_PIPE_PRIVATE_FIELDS    const char* pipe_fname; /* strdup'ed */

Definition at line 309 of file unix.h.

◆ UV_PLATFORM_FS_EVENT_FIELDS

#define UV_PLATFORM_FS_EVENT_FIELDS   /* empty */

Definition at line 115 of file unix.h.

◆ UV_PLATFORM_LOOP_FIELDS

#define UV_PLATFORM_LOOP_FIELDS   /* empty */

Definition at line 111 of file unix.h.

◆ UV_PLATFORM_SEM_T

#define UV_PLATFORM_SEM_T   sem_t

Definition at line 107 of file unix.h.

◆ UV_POLL_PRIVATE_FIELDS

#define UV_POLL_PRIVATE_FIELDS    uv__io_t io_watcher;

Definition at line 312 of file unix.h.

◆ UV_PREPARE_PRIVATE_FIELDS

#define UV_PREPARE_PRIVATE_FIELDS
Value:
uv_prepare_cb prepare_cb; \
void* queue[2]; \
void(* uv_prepare_cb)(uv_prepare_t *handle)
Definition: uv.h:323

Definition at line 315 of file unix.h.

◆ UV_PRIVATE_REQ_TYPES

#define UV_PRIVATE_REQ_TYPES   /* empty */

Definition at line 260 of file unix.h.

◆ UV_PROCESS_PRIVATE_FIELDS

#define UV_PROCESS_PRIVATE_FIELDS
Value:
void* queue[2]; \
int status; \
static const char struct stat static buf struct stat static buf static vhangup int status
Definition: sflib.h:145

Definition at line 357 of file unix.h.

◆ UV_REQ_PRIVATE_FIELDS

#define UV_REQ_PRIVATE_FIELDS   /* empty */

Definition at line 258 of file unix.h.

◆ UV_REQ_TYPE_PRIVATE

#define UV_REQ_TYPE_PRIVATE   /* empty */

Definition at line 256 of file unix.h.

◆ UV_SHUTDOWN_PRIVATE_FIELDS

#define UV_SHUTDOWN_PRIVATE_FIELDS   /* empty */

Definition at line 273 of file unix.h.

◆ UV_SIGNAL_PRIVATE_FIELDS

#define UV_SIGNAL_PRIVATE_FIELDS
Value:
/* RB_ENTRY(uv_signal_s) tree_entry; */ \
struct { \
struct uv_signal_s* rbe_left; \
struct uv_signal_s* rbe_right; \
struct uv_signal_s* rbe_parent; \
int rbe_color; \
} tree_entry; \
/* Use two counters here so we don have to fiddle with atomics. */ \
unsigned int caught_signals; \
unsigned int dispatched_signals;

Definition at line 383 of file unix.h.

◆ UV_STREAM_PRIVATE_FIELDS

#define UV_STREAM_PRIVATE_FIELDS
Value:
uv_connect_t *connect_req; \
uv_shutdown_t *shutdown_req; \
uv__io_t io_watcher; \
void* write_queue[2]; \
void* write_completed_queue[2]; \
uv_connection_cb connection_cb; \
int delayed_error; \
int accepted_fd; \
void* queued_fds; \
UV_STREAM_PRIVATE_PLATFORM_FIELDS \

Definition at line 288 of file unix.h.

◆ UV_STREAM_PRIVATE_PLATFORM_FIELDS

#define UV_STREAM_PRIVATE_PLATFORM_FIELDS   /* empty */

Definition at line 119 of file unix.h.

◆ UV_TCP_PRIVATE_FIELDS

#define UV_TCP_PRIVATE_FIELDS   /* empty */

Definition at line 300 of file unix.h.

◆ UV_TIMER_PRIVATE_FIELDS

#define UV_TIMER_PRIVATE_FIELDS
Value:
void* heap_node[3]; \
uint64_t timeout; \
uint64_t repeat; \
uint64_t start_id;
static void timer_cb(uv_timer_t *timer)
Definition: fs-poll.c:172
static void repeat(struct parse *, sopno, int, int)
Definition: regcomp.c:1155
uv_timer_t timeout
Definition: main.c:9
void(* uv_timer_cb)(uv_timer_t *handle)
Definition: uv.h:321

Definition at line 332 of file unix.h.

◆ UV_TTY_PRIVATE_FIELDS

#define UV_TTY_PRIVATE_FIELDS
Value:
int mode;
static struct termios orig_termios
Definition: tty.c:66

Definition at line 379 of file unix.h.

◆ UV_UDP_PRIVATE_FIELDS

#define UV_UDP_PRIVATE_FIELDS
Value:
uv_alloc_cb alloc_cb; \
uv_udp_recv_cb recv_cb; \
uv__io_t io_watcher; \
void* write_queue[2]; \
void* write_completed_queue[2]; \
void(* uv_alloc_cb)(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
Definition: uv.h:309

Definition at line 302 of file unix.h.

◆ UV_UDP_SEND_PRIVATE_FIELDS

#define UV_UDP_SEND_PRIVATE_FIELDS
Value:
void* queue[2]; \
struct sockaddr_storage addr; \
unsigned int nbufs; \
uv_buf_t* bufs; \
ssize_t status; \
uv_udp_send_cb send_cb; \
uv_buf_t bufsml[4]; \
static int addr
Definition: z80asm.c:58

Definition at line 275 of file unix.h.

◆ UV_WORK_PRIVATE_FIELDS

#define UV_WORK_PRIVATE_FIELDS    struct uv__work work_req;

Definition at line 376 of file unix.h.

◆ UV_WRITE_PRIVATE_FIELDS

#define UV_WRITE_PRIVATE_FIELDS
Value:
void* queue[2]; \
unsigned int write_index; \
uv_buf_t* bufs; \
unsigned int nbufs; \
int error; \
uv_buf_t bufsml[4]; \
void error(const char *msg)
Definition: untgz.c:593

Definition at line 262 of file unix.h.

Typedef Documentation

◆ uv__dirent_t

typedef struct dirent uv__dirent_t

Definition at line 169 of file unix.h.

◆ uv__io_cb

typedef void(* uv__io_cb) (struct uv_loop_s *loop, struct uv__io_s *w, unsigned int events)

Definition at line 91 of file unix.h.

◆ uv__io_t

typedef struct uv__io_s uv__io_t

Definition at line 91 of file unix.h.

◆ uv_buf_t

typedef struct uv_buf_t uv_buf_t

◆ uv_cond_t

typedef pthread_cond_t uv_cond_t

Definition at line 140 of file unix.h.

◆ uv_file

typedef int uv_file

Definition at line 128 of file unix.h.

◆ uv_gid_t

typedef gid_t uv_gid_t

Definition at line 168 of file unix.h.

◆ uv_key_t

typedef pthread_key_t uv_key_t

Definition at line 141 of file unix.h.

◆ uv_mutex_t

typedef pthread_mutex_t uv_mutex_t

Definition at line 137 of file unix.h.

◆ uv_once_t

typedef pthread_once_t uv_once_t

Definition at line 135 of file unix.h.

◆ uv_os_fd_t

typedef int uv_os_fd_t

Definition at line 130 of file unix.h.

◆ uv_os_sock_t

typedef int uv_os_sock_t

Definition at line 129 of file unix.h.

◆ uv_pid_t

typedef pid_t uv_pid_t

Definition at line 131 of file unix.h.

◆ uv_rwlock_t

typedef pthread_rwlock_t uv_rwlock_t

Definition at line 138 of file unix.h.

◆ uv_sem_t

Definition at line 139 of file unix.h.

◆ uv_thread_t

typedef pthread_t uv_thread_t

Definition at line 136 of file unix.h.

◆ uv_uid_t

typedef uid_t uv_uid_t

Definition at line 169 of file unix.h.