summaryrefslogtreecommitdiff
path: root/Utilities/cmlibuv/include
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-06-18 07:45:53 -0400
committerBrad King <brad.king@kitware.com>2019-06-18 07:45:53 -0400
commit69b139cfca6c5eef64558070f533b6c898f410e0 (patch)
tree12d281e91cc1f71c56e2e1372589085df4df8265 /Utilities/cmlibuv/include
parentab63072381171e9c5a7164536f0912b8b3a4a313 (diff)
parentb4069b04ff63b327ff4881282200c3c73fded34d (diff)
downloadcmake-69b139cfca6c5eef64558070f533b6c898f410e0.tar.gz
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv: libuv 2019-06-10 (ee24ce90)
Diffstat (limited to 'Utilities/cmlibuv/include')
-rw-r--r--Utilities/cmlibuv/include/uv.h66
-rw-r--r--Utilities/cmlibuv/include/uv/unix.h19
-rw-r--r--Utilities/cmlibuv/include/uv/version.h2
-rw-r--r--Utilities/cmlibuv/include/uv/win.h5
4 files changed, 84 insertions, 8 deletions
diff --git a/Utilities/cmlibuv/include/uv.h b/Utilities/cmlibuv/include/uv.h
index e6dc7368ac..eb80bfbc2c 100644
--- a/Utilities/cmlibuv/include/uv.h
+++ b/Utilities/cmlibuv/include/uv.h
@@ -206,6 +206,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;
@@ -634,7 +635,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);
@@ -1112,6 +1117,11 @@ typedef struct {
} 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 */
uint64_t ru_maxrss; /* maximum resident set size */
@@ -1162,6 +1172,17 @@ 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);
@@ -1199,9 +1220,19 @@ typedef enum {
UV_FS_FCHOWN,
UV_FS_REALPATH,
UV_FS_COPYFILE,
- UV_FS_LCHOWN
+ UV_FS_LCHOWN,
+ UV_FS_OPENDIR,
+ UV_FS_READDIR,
+ UV_FS_CLOSEDIR
} 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
@@ -1294,6 +1325,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,
@@ -1536,6 +1579,7 @@ 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);
@@ -1589,9 +1633,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);
diff --git a/Utilities/cmlibuv/include/uv/unix.h b/Utilities/cmlibuv/include/uv/unix.h
index 3c1b363694..011abcf355 100644
--- a/Utilities/cmlibuv/include/uv/unix.h
+++ b/Utilities/cmlibuv/include/uv/unix.h
@@ -31,13 +31,14 @@
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
-#include <netdb.h>
+#include <netdb.h> /* MAXHOSTNAMELEN on Solaris */
#include <termios.h>
#include <pwd.h>
#if !defined(__MVS__)
#include <semaphore.h>
+#include <sys/param.h> /* MAXHOSTNAMELEN on Linux and the BSDs */
#endif
#include <pthread.h>
#include <signal.h>
@@ -50,8 +51,6 @@
# include "linux.h"
#elif defined (__MVS__)
# include "os390.h"
-#elif defined(__PASE__)
-# include "posix.h"
#elif defined(_AIX)
# include "aix.h"
#elif defined(__sun)
@@ -64,9 +63,12 @@
defined(__OpenBSD__) || \
defined(__NetBSD__)
# include "bsd.h"
-#elif defined(__CYGWIN__) || defined(__MSYS__)
+#elif defined(__PASE__) || \
+ defined(__CYGWIN__) || \
+ defined(__MSYS__) || \
+ defined(__GNU__)
# include "posix.h"
-#elif defined(__GNU__)
+#elif defined(__HAIKU__)
# include "posix.h"
#endif
@@ -149,7 +151,9 @@ typedef pthread_cond_t uv_cond_t;
typedef pthread_key_t uv_key_t;
/* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */
-#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD)
+#if defined(_AIX) || \
+ defined(__OpenBSD__) || \
+ !defined(PTHREAD_BARRIER_SERIAL_THREAD)
/* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */
struct _uv_barrier {
uv_mutex_t mutex;
@@ -178,6 +182,9 @@ typedef uid_t uv_uid_t;
typedef struct dirent uv__dirent_t;
+#define UV_DIR_PRIVATE_FIELDS \
+ DIR* dir;
+
#if defined(DT_UNKNOWN)
# define HAVE_DIRENT_TYPES
# if defined(DT_REG)
diff --git a/Utilities/cmlibuv/include/uv/version.h b/Utilities/cmlibuv/include/uv/version.h
index abc140a3bb..97f0bc2459 100644
--- a/Utilities/cmlibuv/include/uv/version.h
+++ b/Utilities/cmlibuv/include/uv/version.h
@@ -31,7 +31,7 @@
*/
#define UV_VERSION_MAJOR 1
-#define UV_VERSION_MINOR 24
+#define UV_VERSION_MINOR 29
#define UV_VERSION_PATCH 2
#define UV_VERSION_IS_RELEASE 0
#define UV_VERSION_SUFFIX "dev"
diff --git a/Utilities/cmlibuv/include/uv/win.h b/Utilities/cmlibuv/include/uv/win.h
index f3d3809f38..7f77cc2386 100644
--- a/Utilities/cmlibuv/include/uv/win.h
+++ b/Utilities/cmlibuv/include/uv/win.h
@@ -312,6 +312,11 @@ typedef struct uv__dirent_s {
char d_name[1];
} uv__dirent_t;
+#define UV_DIR_PRIVATE_FIELDS \
+ HANDLE dir_handle; \
+ WIN32_FIND_DATAW find_data; \
+ BOOL need_find_call;
+
#define HAVE_DIRENT_TYPES
#define UV__DT_DIR UV_DIRENT_DIR
#define UV__DT_FILE UV_DIRENT_FILE