chore: remove vendored libuv dependency and all associated files
The entire deps/libuv directory is deleted, including its .gitignore, .mailmap, AUTHORS, CONTRIBUTING.md, ChangeLog, LICENSE, and MAINTAINERS.md files, as part of upgrading to a separately managed libuv dependency.
This commit is contained in:
Vendored
+305
-20
@@ -27,6 +27,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(BUILDING_UV_SHARED) && defined(USING_UV_SHARED)
|
||||
#error "Define either BUILDING_UV_SHARED or USING_UV_SHARED, not both."
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Windows - set up dll import/export decorators. */
|
||||
# if defined(BUILDING_UV_SHARED)
|
||||
@@ -45,21 +49,21 @@ extern "C" {
|
||||
# define UV_EXTERN /* nothing */
|
||||
#endif
|
||||
|
||||
#include "uv-errno.h"
|
||||
#include "uv-version.h"
|
||||
#include "uv/errno.h"
|
||||
#include "uv/version.h"
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1600
|
||||
# include "stdint-msvc2008.h"
|
||||
# include "uv/stdint-msvc2008.h"
|
||||
#else
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include "uv-win.h"
|
||||
# include "uv/win.h"
|
||||
#else
|
||||
# include "uv-unix.h"
|
||||
# include "uv/unix.h"
|
||||
#endif
|
||||
|
||||
/* Expand this list if necessary. */
|
||||
@@ -140,6 +144,10 @@ extern "C" {
|
||||
XX(ENXIO, "no such device or address") \
|
||||
XX(EMLINK, "too many links") \
|
||||
XX(EHOSTDOWN, "host is down") \
|
||||
XX(EREMOTEIO, "remote I/O error") \
|
||||
XX(ENOTTY, "inappropriate ioctl for device") \
|
||||
XX(EFTYPE, "inappropriate file type or format") \
|
||||
XX(EILSEQ, "illegal byte sequence") \
|
||||
|
||||
#define UV_HANDLE_TYPE_MAP(XX) \
|
||||
XX(ASYNC, async) \
|
||||
@@ -169,6 +177,7 @@ extern "C" {
|
||||
XX(WORK, work) \
|
||||
XX(GETADDRINFO, getaddrinfo) \
|
||||
XX(GETNAMEINFO, getnameinfo) \
|
||||
XX(RANDOM, random) \
|
||||
|
||||
typedef enum {
|
||||
#define XX(code, _) UV_ ## code = UV__ ## code,
|
||||
@@ -199,6 +208,7 @@ typedef enum {
|
||||
/* Handle types. */
|
||||
typedef struct uv_loop_s uv_loop_t;
|
||||
typedef struct uv_handle_s uv_handle_t;
|
||||
typedef struct uv_dir_s uv_dir_t;
|
||||
typedef struct uv_stream_s uv_stream_t;
|
||||
typedef struct uv_tcp_s uv_tcp_t;
|
||||
typedef struct uv_udp_s uv_udp_t;
|
||||
@@ -225,12 +235,16 @@ typedef struct uv_connect_s uv_connect_t;
|
||||
typedef struct uv_udp_send_s uv_udp_send_t;
|
||||
typedef struct uv_fs_s uv_fs_t;
|
||||
typedef struct uv_work_s uv_work_t;
|
||||
typedef struct uv_random_s uv_random_t;
|
||||
|
||||
/* None of the above. */
|
||||
typedef struct uv_env_item_s uv_env_item_t;
|
||||
typedef struct uv_cpu_info_s uv_cpu_info_t;
|
||||
typedef struct uv_interface_address_s uv_interface_address_t;
|
||||
typedef struct uv_dirent_s uv_dirent_t;
|
||||
typedef struct uv_passwd_s uv_passwd_t;
|
||||
typedef struct uv_utsname_s uv_utsname_t;
|
||||
typedef struct uv_statfs_s uv_statfs_t;
|
||||
|
||||
typedef enum {
|
||||
UV_LOOP_BLOCK_SIGNAL
|
||||
@@ -274,6 +288,7 @@ UV_EXTERN void uv_loop_delete(uv_loop_t*);
|
||||
UV_EXTERN size_t uv_loop_size(void);
|
||||
UV_EXTERN int uv_loop_alive(const uv_loop_t* loop);
|
||||
UV_EXTERN int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...);
|
||||
UV_EXTERN int uv_loop_fork(uv_loop_t* loop);
|
||||
|
||||
UV_EXTERN int uv_run(uv_loop_t*, uv_run_mode mode);
|
||||
UV_EXTERN void uv_stop(uv_loop_t*);
|
||||
@@ -317,6 +332,10 @@ typedef void (*uv_getnameinfo_cb)(uv_getnameinfo_t* req,
|
||||
int status,
|
||||
const char* hostname,
|
||||
const char* service);
|
||||
typedef void (*uv_random_cb)(uv_random_t* req,
|
||||
int status,
|
||||
void* buf,
|
||||
size_t buflen);
|
||||
|
||||
typedef struct {
|
||||
long tv_sec;
|
||||
@@ -366,7 +385,10 @@ typedef enum {
|
||||
UV_EXTERN int uv_translate_sys_error(int sys_errno);
|
||||
|
||||
UV_EXTERN const char* uv_strerror(int err);
|
||||
UV_EXTERN char* uv_strerror_r(int err, char* buf, size_t buflen);
|
||||
|
||||
UV_EXTERN const char* uv_err_name(int err);
|
||||
UV_EXTERN char* uv_err_name_r(int err, char* buf, size_t buflen);
|
||||
|
||||
|
||||
#define UV_REQ_FIELDS \
|
||||
@@ -375,8 +397,7 @@ UV_EXTERN const char* uv_err_name(int err);
|
||||
/* read-only */ \
|
||||
uv_req_type type; \
|
||||
/* private */ \
|
||||
void* active_queue[2]; \
|
||||
void* reserved[4]; \
|
||||
void* reserved[6]; \
|
||||
UV_REQ_PRIVATE_FIELDS \
|
||||
|
||||
/* Abstract base class of all requests. */
|
||||
@@ -422,7 +443,17 @@ struct uv_handle_s {
|
||||
};
|
||||
|
||||
UV_EXTERN size_t uv_handle_size(uv_handle_type type);
|
||||
UV_EXTERN uv_handle_type uv_handle_get_type(const uv_handle_t* handle);
|
||||
UV_EXTERN const char* uv_handle_type_name(uv_handle_type type);
|
||||
UV_EXTERN void* uv_handle_get_data(const uv_handle_t* handle);
|
||||
UV_EXTERN uv_loop_t* uv_handle_get_loop(const uv_handle_t* handle);
|
||||
UV_EXTERN void uv_handle_set_data(uv_handle_t* handle, void* data);
|
||||
|
||||
UV_EXTERN size_t uv_req_size(uv_req_type type);
|
||||
UV_EXTERN void* uv_req_get_data(const uv_req_t* req);
|
||||
UV_EXTERN void uv_req_set_data(uv_req_t* req, void* data);
|
||||
UV_EXTERN uv_req_type uv_req_get_type(const uv_req_t* req);
|
||||
UV_EXTERN const char* uv_req_type_name(uv_req_type type);
|
||||
|
||||
UV_EXTERN int uv_is_active(const uv_handle_t* handle);
|
||||
|
||||
@@ -462,6 +493,8 @@ struct uv_stream_s {
|
||||
UV_STREAM_FIELDS
|
||||
};
|
||||
|
||||
UV_EXTERN size_t uv_stream_get_write_queue_size(const uv_stream_t* stream);
|
||||
|
||||
UV_EXTERN int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb);
|
||||
UV_EXTERN int uv_accept(uv_stream_t* server, uv_stream_t* client);
|
||||
|
||||
@@ -489,7 +522,7 @@ UV_EXTERN int uv_try_write(uv_stream_t* handle,
|
||||
struct uv_write_s {
|
||||
UV_REQ_FIELDS
|
||||
uv_write_cb cb;
|
||||
uv_stream_t* send_handle;
|
||||
uv_stream_t* send_handle; /* TODO: make private and unix-only in v2.x. */
|
||||
uv_stream_t* handle;
|
||||
UV_WRITE_PRIVATE_FIELDS
|
||||
};
|
||||
@@ -537,6 +570,7 @@ UV_EXTERN int uv_tcp_getsockname(const uv_tcp_t* handle,
|
||||
UV_EXTERN int uv_tcp_getpeername(const uv_tcp_t* handle,
|
||||
struct sockaddr* name,
|
||||
int* namelen);
|
||||
UV_EXTERN int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb);
|
||||
UV_EXTERN int uv_tcp_connect(uv_connect_t* req,
|
||||
uv_tcp_t* handle,
|
||||
const struct sockaddr* addr,
|
||||
@@ -611,7 +645,11 @@ UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock);
|
||||
UV_EXTERN int uv_udp_bind(uv_udp_t* handle,
|
||||
const struct sockaddr* addr,
|
||||
unsigned int flags);
|
||||
UV_EXTERN int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr);
|
||||
|
||||
UV_EXTERN int uv_udp_getpeername(const uv_udp_t* handle,
|
||||
struct sockaddr* name,
|
||||
int* namelen);
|
||||
UV_EXTERN int uv_udp_getsockname(const uv_udp_t* handle,
|
||||
struct sockaddr* name,
|
||||
int* namelen);
|
||||
@@ -619,6 +657,11 @@ UV_EXTERN int uv_udp_set_membership(uv_udp_t* handle,
|
||||
const char* multicast_addr,
|
||||
const char* interface_addr,
|
||||
uv_membership membership);
|
||||
UV_EXTERN int uv_udp_set_source_membership(uv_udp_t* handle,
|
||||
const char* multicast_addr,
|
||||
const char* interface_addr,
|
||||
const char* source_addr,
|
||||
uv_membership membership);
|
||||
UV_EXTERN int uv_udp_set_multicast_loop(uv_udp_t* handle, int on);
|
||||
UV_EXTERN int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl);
|
||||
UV_EXTERN int uv_udp_set_multicast_interface(uv_udp_t* handle,
|
||||
@@ -639,6 +682,8 @@ UV_EXTERN int uv_udp_recv_start(uv_udp_t* handle,
|
||||
uv_alloc_cb alloc_cb,
|
||||
uv_udp_recv_cb recv_cb);
|
||||
UV_EXTERN int uv_udp_recv_stop(uv_udp_t* handle);
|
||||
UV_EXTERN size_t uv_udp_get_send_queue_size(const uv_udp_t* handle);
|
||||
UV_EXTERN size_t uv_udp_get_send_queue_count(const uv_udp_t* handle);
|
||||
|
||||
|
||||
/*
|
||||
@@ -661,10 +706,25 @@ typedef enum {
|
||||
UV_TTY_MODE_IO
|
||||
} uv_tty_mode_t;
|
||||
|
||||
typedef enum {
|
||||
/*
|
||||
* The console supports handling of virtual terminal sequences
|
||||
* (Windows10 new console, ConEmu)
|
||||
*/
|
||||
UV_TTY_SUPPORTED,
|
||||
/* The console cannot process the virtual terminal sequence. (Legacy
|
||||
* console)
|
||||
*/
|
||||
UV_TTY_UNSUPPORTED
|
||||
} uv_tty_vtermstate_t;
|
||||
|
||||
|
||||
UV_EXTERN int uv_tty_init(uv_loop_t*, uv_tty_t*, uv_file fd, int readable);
|
||||
UV_EXTERN int uv_tty_set_mode(uv_tty_t*, uv_tty_mode_t mode);
|
||||
UV_EXTERN int uv_tty_reset_mode(void);
|
||||
UV_EXTERN int uv_tty_get_winsize(uv_tty_t*, int* width, int* height);
|
||||
UV_EXTERN void uv_tty_set_vterm_state(uv_tty_vtermstate_t state);
|
||||
UV_EXTERN int uv_tty_get_vterm_state(uv_tty_vtermstate_t* state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C++" {
|
||||
@@ -707,6 +767,7 @@ UV_EXTERN int uv_pipe_getpeername(const uv_pipe_t* handle,
|
||||
UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t* handle, int count);
|
||||
UV_EXTERN int uv_pipe_pending_count(uv_pipe_t* handle);
|
||||
UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle);
|
||||
UV_EXTERN int uv_pipe_chmod(uv_pipe_t* handle, int flags);
|
||||
|
||||
|
||||
struct uv_poll_s {
|
||||
@@ -718,7 +779,8 @@ struct uv_poll_s {
|
||||
enum uv_poll_event {
|
||||
UV_READABLE = 1,
|
||||
UV_WRITABLE = 2,
|
||||
UV_DISCONNECT = 4
|
||||
UV_DISCONNECT = 4,
|
||||
UV_PRIORITIZED = 8
|
||||
};
|
||||
|
||||
UV_EXTERN int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd);
|
||||
@@ -847,7 +909,13 @@ typedef enum {
|
||||
* flags may be specified to create a duplex data stream.
|
||||
*/
|
||||
UV_READABLE_PIPE = 0x10,
|
||||
UV_WRITABLE_PIPE = 0x20
|
||||
UV_WRITABLE_PIPE = 0x20,
|
||||
|
||||
/*
|
||||
* Open the child pipe handle in overlapped mode on Windows.
|
||||
* On Unix it is silently ignored.
|
||||
*/
|
||||
UV_OVERLAPPED_PIPE = 0x40
|
||||
} uv_stdio_flags;
|
||||
|
||||
typedef struct uv_stdio_container_s {
|
||||
@@ -934,12 +1002,23 @@ enum uv_process_flags {
|
||||
* the child's process handle.
|
||||
*/
|
||||
UV_PROCESS_DETACHED = (1 << 3),
|
||||
/*
|
||||
* Hide the subprocess window that would normally be created. This option is
|
||||
* only meaningful on Windows systems. On Unix it is silently ignored.
|
||||
*/
|
||||
UV_PROCESS_WINDOWS_HIDE = (1 << 4),
|
||||
/*
|
||||
* Hide the subprocess console window that would normally be created. This
|
||||
* option is only meaningful on Windows systems. On Unix it is silently
|
||||
* ignored.
|
||||
*/
|
||||
UV_PROCESS_WINDOWS_HIDE = (1 << 4)
|
||||
UV_PROCESS_WINDOWS_HIDE_CONSOLE = (1 << 5),
|
||||
/*
|
||||
* Hide the subprocess GUI window that would normally be created. This
|
||||
* option is only meaningful on Windows systems. On Unix it is silently
|
||||
* ignored.
|
||||
*/
|
||||
UV_PROCESS_WINDOWS_HIDE_GUI = (1 << 6)
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -957,6 +1036,7 @@ UV_EXTERN int uv_spawn(uv_loop_t* loop,
|
||||
const uv_process_options_t* options);
|
||||
UV_EXTERN int uv_process_kill(uv_process_t*, int signum);
|
||||
UV_EXTERN int uv_kill(int pid, int signum);
|
||||
UV_EXTERN uv_pid_t uv_process_get_pid(const uv_process_t*);
|
||||
|
||||
|
||||
/*
|
||||
@@ -978,16 +1058,18 @@ UV_EXTERN int uv_queue_work(uv_loop_t* loop,
|
||||
UV_EXTERN int uv_cancel(uv_req_t* req);
|
||||
|
||||
|
||||
struct uv_cpu_times_s {
|
||||
uint64_t user;
|
||||
uint64_t nice;
|
||||
uint64_t sys;
|
||||
uint64_t idle;
|
||||
uint64_t irq;
|
||||
};
|
||||
|
||||
struct uv_cpu_info_s {
|
||||
char* model;
|
||||
int speed;
|
||||
struct uv_cpu_times_s {
|
||||
uint64_t user;
|
||||
uint64_t nice;
|
||||
uint64_t sys;
|
||||
uint64_t idle;
|
||||
uint64_t irq;
|
||||
} cpu_times;
|
||||
struct uv_cpu_times_s cpu_times;
|
||||
};
|
||||
|
||||
struct uv_interface_address_s {
|
||||
@@ -1012,6 +1094,27 @@ struct uv_passwd_s {
|
||||
char* homedir;
|
||||
};
|
||||
|
||||
struct uv_utsname_s {
|
||||
char sysname[256];
|
||||
char release[256];
|
||||
char version[256];
|
||||
char machine[256];
|
||||
/* This struct does not contain the nodename and domainname fields present in
|
||||
the utsname type. domainname is a GNU extension. Both fields are referred
|
||||
to as meaningless in the docs. */
|
||||
};
|
||||
|
||||
struct uv_statfs_s {
|
||||
uint64_t f_type;
|
||||
uint64_t f_bsize;
|
||||
uint64_t f_blocks;
|
||||
uint64_t f_bfree;
|
||||
uint64_t f_bavail;
|
||||
uint64_t f_files;
|
||||
uint64_t f_ffree;
|
||||
uint64_t f_spare[4];
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
UV_DIRENT_UNKNOWN,
|
||||
UV_DIRENT_FILE,
|
||||
@@ -1033,12 +1136,19 @@ UV_EXTERN int uv_get_process_title(char* buffer, size_t size);
|
||||
UV_EXTERN int uv_set_process_title(const char* title);
|
||||
UV_EXTERN int uv_resident_set_memory(size_t* rss);
|
||||
UV_EXTERN int uv_uptime(double* uptime);
|
||||
UV_EXTERN uv_os_fd_t uv_get_osfhandle(int fd);
|
||||
UV_EXTERN int uv_open_osfhandle(uv_os_fd_t os_fd);
|
||||
|
||||
typedef struct {
|
||||
long tv_sec;
|
||||
long tv_usec;
|
||||
} uv_timeval_t;
|
||||
|
||||
typedef struct {
|
||||
int64_t tv_sec;
|
||||
int32_t tv_usec;
|
||||
} uv_timeval64_t;
|
||||
|
||||
typedef struct {
|
||||
uv_timeval_t ru_utime; /* user CPU time used */
|
||||
uv_timeval_t ru_stime; /* system CPU time used */
|
||||
@@ -1064,6 +1174,18 @@ UV_EXTERN int uv_os_homedir(char* buffer, size_t* size);
|
||||
UV_EXTERN int uv_os_tmpdir(char* buffer, size_t* size);
|
||||
UV_EXTERN int uv_os_get_passwd(uv_passwd_t* pwd);
|
||||
UV_EXTERN void uv_os_free_passwd(uv_passwd_t* pwd);
|
||||
UV_EXTERN uv_pid_t uv_os_getpid(void);
|
||||
UV_EXTERN uv_pid_t uv_os_getppid(void);
|
||||
|
||||
#define UV_PRIORITY_LOW 19
|
||||
#define UV_PRIORITY_BELOW_NORMAL 10
|
||||
#define UV_PRIORITY_NORMAL 0
|
||||
#define UV_PRIORITY_ABOVE_NORMAL -7
|
||||
#define UV_PRIORITY_HIGH -14
|
||||
#define UV_PRIORITY_HIGHEST -20
|
||||
|
||||
UV_EXTERN int uv_os_getpriority(uv_pid_t pid, int* priority);
|
||||
UV_EXTERN int uv_os_setpriority(uv_pid_t pid, int priority);
|
||||
|
||||
UV_EXTERN int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count);
|
||||
UV_EXTERN void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count);
|
||||
@@ -1073,6 +1195,32 @@ UV_EXTERN int uv_interface_addresses(uv_interface_address_t** addresses,
|
||||
UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t* addresses,
|
||||
int count);
|
||||
|
||||
struct uv_env_item_s {
|
||||
char* name;
|
||||
char* value;
|
||||
};
|
||||
|
||||
UV_EXTERN int uv_os_environ(uv_env_item_t** envitems, int* count);
|
||||
UV_EXTERN void uv_os_free_environ(uv_env_item_t* envitems, int count);
|
||||
UV_EXTERN int uv_os_getenv(const char* name, char* buffer, size_t* size);
|
||||
UV_EXTERN int uv_os_setenv(const char* name, const char* value);
|
||||
UV_EXTERN int uv_os_unsetenv(const char* name);
|
||||
|
||||
#ifdef MAXHOSTNAMELEN
|
||||
# define UV_MAXHOSTNAMESIZE (MAXHOSTNAMELEN + 1)
|
||||
#else
|
||||
/*
|
||||
Fallback for the maximum hostname size, including the null terminator. The
|
||||
Windows gethostname() documentation states that 256 bytes will always be
|
||||
large enough to hold the null-terminated hostname.
|
||||
*/
|
||||
# define UV_MAXHOSTNAMESIZE 256
|
||||
#endif
|
||||
|
||||
UV_EXTERN int uv_os_gethostname(char* buffer, size_t* size);
|
||||
|
||||
UV_EXTERN int uv_os_uname(uv_utsname_t* buffer);
|
||||
|
||||
|
||||
typedef enum {
|
||||
UV_FS_UNKNOWN = -1,
|
||||
@@ -1104,9 +1252,23 @@ typedef enum {
|
||||
UV_FS_READLINK,
|
||||
UV_FS_CHOWN,
|
||||
UV_FS_FCHOWN,
|
||||
UV_FS_REALPATH
|
||||
UV_FS_REALPATH,
|
||||
UV_FS_COPYFILE,
|
||||
UV_FS_LCHOWN,
|
||||
UV_FS_OPENDIR,
|
||||
UV_FS_READDIR,
|
||||
UV_FS_CLOSEDIR,
|
||||
UV_FS_STATFS,
|
||||
UV_FS_MKSTEMP
|
||||
} uv_fs_type;
|
||||
|
||||
struct uv_dir_s {
|
||||
uv_dirent_t* dirents;
|
||||
size_t nentries;
|
||||
void* reserved[4];
|
||||
UV_DIR_PRIVATE_FIELDS
|
||||
};
|
||||
|
||||
/* uv_fs_t is a subclass of uv_req_t. */
|
||||
struct uv_fs_s {
|
||||
UV_REQ_FIELDS
|
||||
@@ -1120,6 +1282,12 @@ struct uv_fs_s {
|
||||
UV_FS_PRIVATE_FIELDS
|
||||
};
|
||||
|
||||
UV_EXTERN uv_fs_type uv_fs_get_type(const uv_fs_t*);
|
||||
UV_EXTERN ssize_t uv_fs_get_result(const uv_fs_t*);
|
||||
UV_EXTERN void* uv_fs_get_ptr(const uv_fs_t*);
|
||||
UV_EXTERN const char* uv_fs_get_path(const uv_fs_t*);
|
||||
UV_EXTERN uv_stat_t* uv_fs_get_statbuf(uv_fs_t*);
|
||||
|
||||
UV_EXTERN void uv_fs_req_cleanup(uv_fs_t* req);
|
||||
UV_EXTERN int uv_fs_close(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
@@ -1149,6 +1317,30 @@ UV_EXTERN int uv_fs_write(uv_loop_t* loop,
|
||||
unsigned int nbufs,
|
||||
int64_t offset,
|
||||
uv_fs_cb cb);
|
||||
/*
|
||||
* This flag can be used with uv_fs_copyfile() to return an error if the
|
||||
* destination already exists.
|
||||
*/
|
||||
#define UV_FS_COPYFILE_EXCL 0x0001
|
||||
|
||||
/*
|
||||
* This flag can be used with uv_fs_copyfile() to attempt to create a reflink.
|
||||
* If copy-on-write is not supported, a fallback copy mechanism is used.
|
||||
*/
|
||||
#define UV_FS_COPYFILE_FICLONE 0x0002
|
||||
|
||||
/*
|
||||
* This flag can be used with uv_fs_copyfile() to attempt to create a reflink.
|
||||
* If copy-on-write is not supported, an error is returned.
|
||||
*/
|
||||
#define UV_FS_COPYFILE_FICLONE_FORCE 0x0004
|
||||
|
||||
UV_EXTERN int uv_fs_copyfile(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
const char* path,
|
||||
const char* new_path,
|
||||
int flags,
|
||||
uv_fs_cb cb);
|
||||
UV_EXTERN int uv_fs_mkdir(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
const char* path,
|
||||
@@ -1158,6 +1350,10 @@ UV_EXTERN int uv_fs_mkdtemp(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
const char* tpl,
|
||||
uv_fs_cb cb);
|
||||
UV_EXTERN int uv_fs_mkstemp(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
const char* tpl,
|
||||
uv_fs_cb cb);
|
||||
UV_EXTERN int uv_fs_rmdir(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
const char* path,
|
||||
@@ -1169,6 +1365,18 @@ UV_EXTERN int uv_fs_scandir(uv_loop_t* loop,
|
||||
uv_fs_cb cb);
|
||||
UV_EXTERN int uv_fs_scandir_next(uv_fs_t* req,
|
||||
uv_dirent_t* ent);
|
||||
UV_EXTERN int uv_fs_opendir(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
const char* path,
|
||||
uv_fs_cb cb);
|
||||
UV_EXTERN int uv_fs_readdir(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
uv_dir_t* dir,
|
||||
uv_fs_cb cb);
|
||||
UV_EXTERN int uv_fs_closedir(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
uv_dir_t* dir,
|
||||
uv_fs_cb cb);
|
||||
UV_EXTERN int uv_fs_stat(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
const char* path,
|
||||
@@ -1277,6 +1485,16 @@ UV_EXTERN int uv_fs_fchown(uv_loop_t* loop,
|
||||
uv_uid_t uid,
|
||||
uv_gid_t gid,
|
||||
uv_fs_cb cb);
|
||||
UV_EXTERN int uv_fs_lchown(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
const char* path,
|
||||
uv_uid_t uid,
|
||||
uv_gid_t gid,
|
||||
uv_fs_cb cb);
|
||||
UV_EXTERN int uv_fs_statfs(uv_loop_t* loop,
|
||||
uv_fs_t* req,
|
||||
const char* path,
|
||||
uv_fs_cb cb);
|
||||
|
||||
|
||||
enum uv_fs_event {
|
||||
@@ -1324,6 +1542,9 @@ UV_EXTERN int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle);
|
||||
UV_EXTERN int uv_signal_start(uv_signal_t* handle,
|
||||
uv_signal_cb signal_cb,
|
||||
int signum);
|
||||
UV_EXTERN int uv_signal_start_oneshot(uv_signal_t* handle,
|
||||
uv_signal_cb signal_cb,
|
||||
int signum);
|
||||
UV_EXTERN int uv_signal_stop(uv_signal_t* handle);
|
||||
|
||||
UV_EXTERN void uv_loadavg(double avg[3]);
|
||||
@@ -1379,6 +1600,41 @@ UV_EXTERN int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size
|
||||
UV_EXTERN int uv_inet_ntop(int af, const void* src, char* dst, size_t size);
|
||||
UV_EXTERN int uv_inet_pton(int af, const char* src, void* dst);
|
||||
|
||||
|
||||
struct uv_random_s {
|
||||
UV_REQ_FIELDS
|
||||
/* read-only */
|
||||
uv_loop_t* loop;
|
||||
/* private */
|
||||
int status;
|
||||
void* buf;
|
||||
size_t buflen;
|
||||
uv_random_cb cb;
|
||||
struct uv__work work_req;
|
||||
};
|
||||
|
||||
UV_EXTERN int uv_random(uv_loop_t* loop,
|
||||
uv_random_t* req,
|
||||
void *buf,
|
||||
size_t buflen,
|
||||
unsigned flags, /* For future extension; must be 0. */
|
||||
uv_random_cb cb);
|
||||
|
||||
#if defined(IF_NAMESIZE)
|
||||
# define UV_IF_NAMESIZE (IF_NAMESIZE + 1)
|
||||
#elif defined(IFNAMSIZ)
|
||||
# define UV_IF_NAMESIZE (IFNAMSIZ + 1)
|
||||
#else
|
||||
# define UV_IF_NAMESIZE (16 + 1)
|
||||
#endif
|
||||
|
||||
UV_EXTERN int uv_if_indextoname(unsigned int ifindex,
|
||||
char* buffer,
|
||||
size_t* size);
|
||||
UV_EXTERN int uv_if_indextoiid(unsigned int ifindex,
|
||||
char* buffer,
|
||||
size_t* size);
|
||||
|
||||
UV_EXTERN int uv_exepath(char* buffer, size_t* size);
|
||||
|
||||
UV_EXTERN int uv_cwd(char* buffer, size_t* size);
|
||||
@@ -1387,8 +1643,10 @@ UV_EXTERN int uv_chdir(const char* dir);
|
||||
|
||||
UV_EXTERN uint64_t uv_get_free_memory(void);
|
||||
UV_EXTERN uint64_t uv_get_total_memory(void);
|
||||
UV_EXTERN uint64_t uv_get_constrained_memory(void);
|
||||
|
||||
UV_EXTERN uint64_t uv_hrtime(void);
|
||||
UV_EXTERN void uv_sleep(unsigned int msec);
|
||||
|
||||
UV_EXTERN void uv_disable_stdio_inheritance(void);
|
||||
|
||||
@@ -1398,6 +1656,7 @@ UV_EXTERN int uv_dlsym(uv_lib_t* lib, const char* name, void** ptr);
|
||||
UV_EXTERN const char* uv_dlerror(const uv_lib_t* lib);
|
||||
|
||||
UV_EXTERN int uv_mutex_init(uv_mutex_t* handle);
|
||||
UV_EXTERN int uv_mutex_init_recursive(uv_mutex_t* handle);
|
||||
UV_EXTERN void uv_mutex_destroy(uv_mutex_t* handle);
|
||||
UV_EXTERN void uv_mutex_lock(uv_mutex_t* handle);
|
||||
UV_EXTERN int uv_mutex_trylock(uv_mutex_t* handle);
|
||||
@@ -1439,9 +1698,29 @@ UV_EXTERN void uv_key_delete(uv_key_t* key);
|
||||
UV_EXTERN void* uv_key_get(uv_key_t* key);
|
||||
UV_EXTERN void uv_key_set(uv_key_t* key, void* value);
|
||||
|
||||
UV_EXTERN int uv_gettimeofday(uv_timeval64_t* tv);
|
||||
|
||||
typedef void (*uv_thread_cb)(void* arg);
|
||||
|
||||
UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg);
|
||||
|
||||
typedef enum {
|
||||
UV_THREAD_NO_FLAGS = 0x00,
|
||||
UV_THREAD_HAS_STACK_SIZE = 0x01
|
||||
} uv_thread_create_flags;
|
||||
|
||||
struct uv_thread_options_s {
|
||||
unsigned int flags;
|
||||
size_t stack_size;
|
||||
/* More fields may be added at any time. */
|
||||
};
|
||||
|
||||
typedef struct uv_thread_options_s uv_thread_options_t;
|
||||
|
||||
UV_EXTERN int uv_thread_create_ex(uv_thread_t* tid,
|
||||
const uv_thread_options_t* params,
|
||||
uv_thread_cb entry,
|
||||
void* arg);
|
||||
UV_EXTERN uv_thread_t uv_thread_self(void);
|
||||
UV_EXTERN int uv_thread_join(uv_thread_t *tid);
|
||||
UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2);
|
||||
@@ -1464,12 +1743,17 @@ struct uv_loop_s {
|
||||
/* Loop reference counting. */
|
||||
unsigned int active_handles;
|
||||
void* handle_queue[2];
|
||||
void* active_reqs[2];
|
||||
union {
|
||||
void* unused[2];
|
||||
unsigned int count;
|
||||
} active_reqs;
|
||||
/* Internal flag to signal loop stop. */
|
||||
unsigned int stop_flag;
|
||||
UV_LOOP_PRIVATE_FIELDS
|
||||
};
|
||||
|
||||
UV_EXTERN void* uv_loop_get_data(const uv_loop_t*);
|
||||
UV_EXTERN void uv_loop_set_data(uv_loop_t*, void* data);
|
||||
|
||||
/* Don't export the private CPP symbols. */
|
||||
#undef UV_HANDLE_TYPE_PRIVATE
|
||||
@@ -1490,6 +1774,7 @@ struct uv_loop_s {
|
||||
#undef UV_SIGNAL_PRIVATE_FIELDS
|
||||
#undef UV_LOOP_PRIVATE_FIELDS
|
||||
#undef UV_LOOP_PRIVATE_PLATFORM_FIELDS
|
||||
#undef UV__ERR
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user