mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 22:30:07 -05:00
libuv 2018-01-19 (63de1eca)
Code extracted from:
https://github.com/libuv/libuv.git
at commit 63de1ecad3252d3e9ed2fe960c21d9387615fa45 (v1.x).
This commit is contained in:
committed by
Brad King
parent
362435f02a
commit
f4a26c748b
@@ -23,6 +23,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#endif
|
||||
|
||||
#define PTHREAD_BARRIER_SERIAL_THREAD 0x12345
|
||||
#define UV__PTHREAD_BARRIER_FALLBACK 1
|
||||
|
||||
/*
|
||||
* To maintain ABI compatibility with
|
||||
|
||||
@@ -416,4 +416,16 @@
|
||||
# define UV__EHOSTDOWN (-4031)
|
||||
#endif
|
||||
|
||||
#if defined(EREMOTEIO) && !defined(_WIN32)
|
||||
# define UV__EREMOTEIO (-EREMOTEIO)
|
||||
#else
|
||||
# define UV__EREMOTEIO (-4030)
|
||||
#endif
|
||||
|
||||
#if defined(ENOTTY) && !defined(_WIN32)
|
||||
# define UV__ENOTTY (-ENOTTY)
|
||||
#else
|
||||
# define UV__ENOTTY (-4029)
|
||||
#endif
|
||||
|
||||
#endif /* UV_ERRNO_H_ */
|
||||
|
||||
@@ -27,4 +27,7 @@
|
||||
#define UV_PLATFORM_LOOP_FIELDS \
|
||||
void* ep; \
|
||||
|
||||
#define UV_PLATFORM_FS_EVENT_FIELDS \
|
||||
char rfis_rftok[8]; \
|
||||
|
||||
#endif /* UV_MVS_H */
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
# include "uv-linux.h"
|
||||
#elif defined (__MVS__)
|
||||
# include "uv-os390.h"
|
||||
#elif defined(_PASE)
|
||||
# include "uv-posix.h"
|
||||
#elif defined(_AIX)
|
||||
# include "uv-aix.h"
|
||||
#elif defined(__sun)
|
||||
@@ -123,6 +125,7 @@ typedef struct 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;
|
||||
|
||||
#define UV_ONCE_INIT PTHREAD_ONCE_INIT
|
||||
|
||||
@@ -365,4 +368,97 @@ typedef struct {
|
||||
uv_fs_event_cb cb; \
|
||||
UV_PLATFORM_FS_EVENT_FIELDS \
|
||||
|
||||
/* fs open() flags supported on this platform: */
|
||||
#if defined(O_APPEND)
|
||||
# define UV_FS_O_APPEND O_APPEND
|
||||
#else
|
||||
# define UV_FS_O_APPEND 0
|
||||
#endif
|
||||
#if defined(O_CREAT)
|
||||
# define UV_FS_O_CREAT O_CREAT
|
||||
#else
|
||||
# define UV_FS_O_CREAT 0
|
||||
#endif
|
||||
#if defined(O_DIRECT)
|
||||
# define UV_FS_O_DIRECT O_DIRECT
|
||||
#else
|
||||
# define UV_FS_O_DIRECT 0
|
||||
#endif
|
||||
#if defined(O_DIRECTORY)
|
||||
# define UV_FS_O_DIRECTORY O_DIRECTORY
|
||||
#else
|
||||
# define UV_FS_O_DIRECTORY 0
|
||||
#endif
|
||||
#if defined(O_DSYNC)
|
||||
# define UV_FS_O_DSYNC O_DSYNC
|
||||
#else
|
||||
# define UV_FS_O_DSYNC 0
|
||||
#endif
|
||||
#if defined(O_EXCL)
|
||||
# define UV_FS_O_EXCL O_EXCL
|
||||
#else
|
||||
# define UV_FS_O_EXCL 0
|
||||
#endif
|
||||
#if defined(O_EXLOCK)
|
||||
# define UV_FS_O_EXLOCK O_EXLOCK
|
||||
#else
|
||||
# define UV_FS_O_EXLOCK 0
|
||||
#endif
|
||||
#if defined(O_NOATIME)
|
||||
# define UV_FS_O_NOATIME O_NOATIME
|
||||
#else
|
||||
# define UV_FS_O_NOATIME 0
|
||||
#endif
|
||||
#if defined(O_NOCTTY)
|
||||
# define UV_FS_O_NOCTTY O_NOCTTY
|
||||
#else
|
||||
# define UV_FS_O_NOCTTY 0
|
||||
#endif
|
||||
#if defined(O_NOFOLLOW)
|
||||
# define UV_FS_O_NOFOLLOW O_NOFOLLOW
|
||||
#else
|
||||
# define UV_FS_O_NOFOLLOW 0
|
||||
#endif
|
||||
#if defined(O_NONBLOCK)
|
||||
# define UV_FS_O_NONBLOCK O_NONBLOCK
|
||||
#else
|
||||
# define UV_FS_O_NONBLOCK 0
|
||||
#endif
|
||||
#if defined(O_RDONLY)
|
||||
# define UV_FS_O_RDONLY O_RDONLY
|
||||
#else
|
||||
# define UV_FS_O_RDONLY 0
|
||||
#endif
|
||||
#if defined(O_RDWR)
|
||||
# define UV_FS_O_RDWR O_RDWR
|
||||
#else
|
||||
# define UV_FS_O_RDWR 0
|
||||
#endif
|
||||
#if defined(O_SYMLINK)
|
||||
# define UV_FS_O_SYMLINK O_SYMLINK
|
||||
#else
|
||||
# define UV_FS_O_SYMLINK 0
|
||||
#endif
|
||||
#if defined(O_SYNC)
|
||||
# define UV_FS_O_SYNC O_SYNC
|
||||
#else
|
||||
# define UV_FS_O_SYNC 0
|
||||
#endif
|
||||
#if defined(O_TRUNC)
|
||||
# define UV_FS_O_TRUNC O_TRUNC
|
||||
#else
|
||||
# define UV_FS_O_TRUNC 0
|
||||
#endif
|
||||
#if defined(O_WRONLY)
|
||||
# define UV_FS_O_WRONLY O_WRONLY
|
||||
#else
|
||||
# define UV_FS_O_WRONLY 0
|
||||
#endif
|
||||
|
||||
/* fs open() flags supported on other platforms: */
|
||||
#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
|
||||
|
||||
#endif /* UV_UNIX_H */
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#define UV_VERSION_MAJOR 1
|
||||
#define UV_VERSION_MINOR 11
|
||||
#define UV_VERSION_MINOR 19
|
||||
#define UV_VERSION_PATCH 1
|
||||
#define UV_VERSION_IS_RELEASE 0
|
||||
#define UV_VERSION_SUFFIX "dev"
|
||||
|
||||
+27
-1
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0502
|
||||
# define _WIN32_WINNT 0x0600
|
||||
#endif
|
||||
|
||||
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
|
||||
@@ -222,6 +222,7 @@ typedef struct uv_buf_t {
|
||||
typedef int uv_file;
|
||||
typedef SOCKET uv_os_sock_t;
|
||||
typedef HANDLE uv_os_fd_t;
|
||||
typedef int uv_pid_t;
|
||||
|
||||
typedef HANDLE uv_thread_t;
|
||||
|
||||
@@ -648,3 +649,28 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
|
||||
#ifndef X_OK
|
||||
#define X_OK 1
|
||||
#endif
|
||||
|
||||
/* fs open() flags supported on this platform: */
|
||||
#define UV_FS_O_APPEND _O_APPEND
|
||||
#define UV_FS_O_CREAT _O_CREAT
|
||||
#define UV_FS_O_EXCL _O_EXCL
|
||||
#define UV_FS_O_RANDOM _O_RANDOM
|
||||
#define UV_FS_O_RDONLY _O_RDONLY
|
||||
#define UV_FS_O_RDWR _O_RDWR
|
||||
#define UV_FS_O_SEQUENTIAL _O_SEQUENTIAL
|
||||
#define UV_FS_O_SHORT_LIVED _O_SHORT_LIVED
|
||||
#define UV_FS_O_TEMPORARY _O_TEMPORARY
|
||||
#define UV_FS_O_TRUNC _O_TRUNC
|
||||
#define UV_FS_O_WRONLY _O_WRONLY
|
||||
|
||||
/* fs open() flags supported on other platforms (or mapped on this platform): */
|
||||
#define UV_FS_O_DIRECT 0x02000000 /* FILE_FLAG_NO_BUFFERING */
|
||||
#define UV_FS_O_DIRECTORY 0
|
||||
#define UV_FS_O_DSYNC 0x04000000 /* FILE_FLAG_WRITE_THROUGH */
|
||||
#define UV_FS_O_EXLOCK 0x10000000 /* EXCLUSIVE SHARING MODE */
|
||||
#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_SYMLINK 0
|
||||
#define UV_FS_O_SYNC 0x08000000 /* FILE_FLAG_WRITE_THROUGH */
|
||||
|
||||
+61
-2
@@ -140,6 +140,8 @@ 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") \
|
||||
|
||||
#define UV_HANDLE_TYPE_MAP(XX) \
|
||||
XX(ASYNC, async) \
|
||||
@@ -423,7 +425,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);
|
||||
|
||||
@@ -463,6 +475,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);
|
||||
|
||||
@@ -640,6 +654,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);
|
||||
|
||||
|
||||
/*
|
||||
@@ -708,6 +724,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 {
|
||||
@@ -719,7 +736,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);
|
||||
@@ -958,6 +976,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*);
|
||||
|
||||
|
||||
/*
|
||||
@@ -1034,6 +1053,7 @@ 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);
|
||||
|
||||
typedef struct {
|
||||
long tv_sec;
|
||||
@@ -1065,6 +1085,8 @@ 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);
|
||||
|
||||
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);
|
||||
@@ -1111,7 +1133,8 @@ typedef enum {
|
||||
UV_FS_READLINK,
|
||||
UV_FS_CHOWN,
|
||||
UV_FS_FCHOWN,
|
||||
UV_FS_REALPATH
|
||||
UV_FS_REALPATH,
|
||||
UV_FS_COPYFILE
|
||||
} uv_fs_type;
|
||||
|
||||
/* uv_fs_t is a subclass of uv_req_t. */
|
||||
@@ -1127,6 +1150,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,
|
||||
@@ -1156,6 +1185,18 @@ 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
|
||||
|
||||
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,
|
||||
@@ -1389,6 +1430,21 @@ 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);
|
||||
|
||||
#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);
|
||||
@@ -1408,6 +1464,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);
|
||||
@@ -1480,6 +1537,8 @@ struct uv_loop_s {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user