summaryrefslogtreecommitdiff
path: root/Utilities/cmlibuv/include/uv.h
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:10 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:20:10 +0900
commitf58f7a233a9b66287e1a0fad0d149e3202a098b4 (patch)
treecc0cea82fae3f153df9299b27650e17c58da1125 /Utilities/cmlibuv/include/uv.h
parent46f8b5215bbbfcf4bc0caed1daf52b678fd2b976 (diff)
downloadcmake-f58f7a233a9b66287e1a0fad0d149e3202a098b4.tar.gz
cmake-f58f7a233a9b66287e1a0fad0d149e3202a098b4.tar.bz2
cmake-f58f7a233a9b66287e1a0fad0d149e3202a098b4.zip
Imported Upstream version 3.18.0upstream/3.18.0
Diffstat (limited to 'Utilities/cmlibuv/include/uv.h')
-rw-r--r--Utilities/cmlibuv/include/uv.h139
1 files changed, 126 insertions, 13 deletions
diff --git a/Utilities/cmlibuv/include/uv.h b/Utilities/cmlibuv/include/uv.h
index eb80bfbc2..6f32b4877 100644
--- a/Utilities/cmlibuv/include/uv.h
+++ b/Utilities/cmlibuv/include/uv.h
@@ -31,6 +31,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)
@@ -147,6 +151,7 @@ extern "C" {
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) \
@@ -176,6 +181,7 @@ extern "C" {
XX(WORK, work) \
XX(GETADDRINFO, getaddrinfo) \
XX(GETNAMEINFO, getnameinfo) \
+ XX(RANDOM, random) \
typedef enum {
#define XX(code, _) UV_ ## code = UV__ ## code,
@@ -233,13 +239,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
@@ -260,6 +269,8 @@ typedef void* (*uv_realloc_func)(void* ptr, size_t size);
typedef void* (*uv_calloc_func)(size_t count, size_t size);
typedef void (*uv_free_func)(void* ptr);
+UV_EXTERN void uv_library_shutdown(void);
+
UV_EXTERN int uv_replace_allocator(uv_malloc_func malloc_func,
uv_realloc_func realloc_func,
uv_calloc_func calloc_func,
@@ -327,6 +338,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;
@@ -561,6 +576,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,
@@ -595,7 +611,17 @@ enum uv_udp_flags {
* (provided they all set the flag) but only the last one to bind will receive
* any traffic, in effect "stealing" the port from the previous listener.
*/
- UV_UDP_REUSEADDR = 4
+ UV_UDP_REUSEADDR = 4,
+ /*
+ * Indicates that the message was received by recvmmsg, so the buffer provided
+ * must not be freed by the recv_cb callback.
+ */
+ UV_UDP_MMSG_CHUNK = 8,
+
+ /*
+ * Indicates that recvmmsg should be used, if available.
+ */
+ UV_UDP_RECVMMSG = 256
};
typedef void (*uv_udp_send_cb)(uv_udp_send_t* req, int status);
@@ -647,6 +673,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,
@@ -691,10 +722,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++" {
@@ -1042,11 +1088,11 @@ 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;
+ uint64_t user; /* milliseconds */
+ uint64_t nice; /* milliseconds */
+ uint64_t sys; /* milliseconds */
+ uint64_t idle; /* milliseconds */
+ uint64_t irq; /* milliseconds */
};
struct uv_cpu_info_s {
@@ -1087,6 +1133,17 @@ struct uv_utsname_s {
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,
@@ -1149,12 +1206,22 @@ 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
+#if defined(__PASE__)
+/* On IBM i PASE, the highest process priority is -10 */
+# define UV_PRIORITY_LOW 39 // RUNPTY(99)
+# define UV_PRIORITY_BELOW_NORMAL 15 // RUNPTY(50)
+# define UV_PRIORITY_NORMAL 0 // RUNPTY(20)
+# define UV_PRIORITY_ABOVE_NORMAL -4 // RUNTY(12)
+# define UV_PRIORITY_HIGH -7 // RUNPTY(6)
+# define UV_PRIORITY_HIGHEST -10 // RUNPTY(1)
+#else
+# 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
+#endif
UV_EXTERN int uv_os_getpriority(uv_pid_t pid, int* priority);
UV_EXTERN int uv_os_setpriority(uv_pid_t pid, int priority);
@@ -1168,6 +1235,13 @@ 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);
@@ -1223,7 +1297,10 @@ typedef enum {
UV_FS_LCHOWN,
UV_FS_OPENDIR,
UV_FS_READDIR,
- UV_FS_CLOSEDIR
+ UV_FS_CLOSEDIR,
+ UV_FS_STATFS,
+ UV_FS_MKSTEMP,
+ UV_FS_LUTIME
} uv_fs_type;
struct uv_dir_s {
@@ -1248,6 +1325,7 @@ struct uv_fs_s {
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 int uv_fs_get_system_error(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*);
@@ -1314,6 +1392,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,
@@ -1392,6 +1474,12 @@ UV_EXTERN int uv_fs_futime(uv_loop_t* loop,
double atime,
double mtime,
uv_fs_cb cb);
+UV_EXTERN int uv_fs_lutime(uv_loop_t* loop,
+ uv_fs_t* req,
+ const char* path,
+ double atime,
+ double mtime,
+ uv_fs_cb cb);
UV_EXTERN int uv_fs_lstat(uv_loop_t* loop,
uv_fs_t* req,
const char* path,
@@ -1451,6 +1539,10 @@ UV_EXTERN int uv_fs_lchown(uv_loop_t* loop,
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 {
@@ -1556,6 +1648,26 @@ 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)
@@ -1582,6 +1694,7 @@ 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);