diff options
author | Brad King <brad.king@kitware.com> | 2020-04-06 15:58:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-04-06 15:58:14 (GMT) |
commit | 722d6b41053c6f143e10468d2ea25146a3dcf7a5 (patch) | |
tree | 1cd58dcc2f2a255d6cc388f45d4883b0757d262a /Utilities/cmlibuv/src/unix/internal.h | |
parent | 21c5a311c60da34d4e66a1d1a778106110f9b5d2 (diff) | |
parent | 394b07af40e1bdbdca0033e53ca803585454da18 (diff) | |
download | CMake-722d6b41053c6f143e10468d2ea25146a3dcf7a5.zip CMake-722d6b41053c6f143e10468d2ea25146a3dcf7a5.tar.gz CMake-722d6b41053c6f143e10468d2ea25146a3dcf7a5.tar.bz2 |
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv:
libuv 2020-04-06 (d21f5aea)
Diffstat (limited to 'Utilities/cmlibuv/src/unix/internal.h')
-rw-r--r-- | Utilities/cmlibuv/src/unix/internal.h | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/Utilities/cmlibuv/src/unix/internal.h b/Utilities/cmlibuv/src/unix/internal.h index b43c0b1..2276b78 100644 --- a/Utilities/cmlibuv/src/unix/internal.h +++ b/Utilities/cmlibuv/src/unix/internal.h @@ -25,11 +25,13 @@ #include "uv-common.h" #include <assert.h> +#include <limits.h> /* _POSIX_PATH_MAX, PATH_MAX */ #include <stdlib.h> /* abort */ #include <string.h> /* strrchr */ -#include <fcntl.h> /* O_CLOEXEC, may be */ +#include <fcntl.h> /* O_CLOEXEC and O_NONBLOCK, if supported. */ #include <stdio.h> #include <errno.h> +#include <sys/socket.h> #if defined(__STRICT_ANSI__) # define inline __inline @@ -60,6 +62,14 @@ # include <AvailabilityMacros.h> #endif +#if defined(_POSIX_PATH_MAX) +# define UV__PATH_MAX _POSIX_PATH_MAX +#elif defined(PATH_MAX) +# define UV__PATH_MAX PATH_MAX +#else +# define UV__PATH_MAX 8192 +#endif + #if defined(CMAKE_BOOTSTRAP) # undef pthread_atfork # define pthread_atfork(prepare, parent, child) \ @@ -271,6 +281,12 @@ uv_handle_type uv__handle_type(int fd); FILE* uv__open_file(const char* path); int uv__getpwuid_r(uv_passwd_t* pwd); +/* random */ +int uv__random_devurandom(void* buf, size_t buflen); +int uv__random_getrandom(void* buf, size_t buflen); +int uv__random_getentropy(void* buf, size_t buflen); +int uv__random_readpath(const char* path, void* buf, size_t buflen); +int uv__random_sysctl(void* buf, size_t buflen); #if defined(__APPLE__) && !defined(CMAKE_BOOTSTRAP) int uv___stream_fd(const uv_stream_t* handle); @@ -279,13 +295,12 @@ int uv___stream_fd(const uv_stream_t* handle); #define uv__stream_fd(handle) ((handle)->io_watcher.fd) #endif /* defined(__APPLE__) */ -#ifdef UV__O_NONBLOCK -# define UV__F_NONBLOCK UV__O_NONBLOCK +#ifdef O_NONBLOCK +# define UV__F_NONBLOCK O_NONBLOCK #else # define UV__F_NONBLOCK 1 #endif -int uv__make_socketpair(int fds[2], int flags); int uv__make_pipe(int fds[2], int flags); #if defined(__APPLE__) @@ -323,4 +338,27 @@ int uv__getsockpeername(const uv_handle_t* handle, struct sockaddr* name, int* namelen); +#if defined(__linux__) || \ + defined(__FreeBSD__) || \ + defined(__FreeBSD_kernel__) +#define HAVE_MMSG 1 +struct uv__mmsghdr { + struct msghdr msg_hdr; + unsigned int msg_len; +}; + +int uv__recvmmsg(int fd, + struct uv__mmsghdr* mmsg, + unsigned int vlen, + unsigned int flags, + struct timespec* timeout); +int uv__sendmmsg(int fd, + struct uv__mmsghdr* mmsg, + unsigned int vlen, + unsigned int flags); +#else +#define HAVE_MMSG 0 +#endif + + #endif /* UV_UNIX_INTERNAL_H_ */ |