summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/core.c
diff options
context:
space:
mode:
authorSaúl Ibarra Corretgé <saghul@gmail.com>2015-08-05 21:17:46 +0200
committerthefourtheye <thechargingvolcano@gmail.com>2015-09-02 03:16:47 -0400
commita1615949a591fc523048a09540a2d340ff1b3da8 (patch)
tree1cc576ea6104f1baf8f92c6a82f3ca2b45afaccd /deps/uv/src/unix/core.c
parente3740e452402892c1ce03bbbb4807e34f31558ad (diff)
downloadandroid-node-v8-a1615949a591fc523048a09540a2d340ff1b3da8.tar.gz
android-node-v8-a1615949a591fc523048a09540a2d340ff1b3da8.tar.bz2
android-node-v8-a1615949a591fc523048a09540a2d340ff1b3da8.zip
deps: upgrade libuv to 1.7.3
PR-URL: https://github.com/nodejs/node/pull/2310 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/uv/src/unix/core.c')
-rw-r--r--deps/uv/src/unix/core.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c
index 826b4113b2..e149357e07 100644
--- a/deps/uv/src/unix/core.c
+++ b/deps/uv/src/unix/core.c
@@ -35,7 +35,7 @@
#include <sys/un.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <limits.h> /* INT_MAX, PATH_MAX */
+#include <limits.h> /* INT_MAX, PATH_MAX, IOV_MAX */
#include <sys/uio.h> /* writev */
#include <sys/resource.h> /* getrusage */
#include <pwd.h>
@@ -55,13 +55,13 @@
# include <sys/ioctl.h>
#endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
# include <sys/sysctl.h>
# include <sys/filio.h>
# include <sys/ioctl.h>
# include <sys/wait.h>
# define UV__O_CLOEXEC O_CLOEXEC
-# if __FreeBSD__ >= 10
+# if defined(__FreeBSD__) && __FreeBSD__ >= 10
# define uv__accept4 accept4
# define UV__SOCK_NONBLOCK SOCK_NONBLOCK
# define UV__SOCK_CLOEXEC SOCK_CLOEXEC
@@ -199,6 +199,19 @@ void uv__make_close_pending(uv_handle_t* handle) {
handle->loop->closing_handles = handle;
}
+int uv__getiovmax(void) {
+#if defined(IOV_MAX)
+ return IOV_MAX;
+#elif defined(_SC_IOV_MAX)
+ static int iovmax = -1;
+ if (iovmax == -1)
+ iovmax = sysconf(_SC_IOV_MAX);
+ return iovmax;
+#else
+ return 1024;
+#endif
+}
+
static void uv__finish_close(uv_handle_t* handle) {
/* Note: while the handle is in the UV_CLOSING state now, it's still possible
@@ -477,7 +490,7 @@ int uv__close(int fd) {
#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \
- defined(_AIX)
+ defined(_AIX) || defined(__DragonFly__)
int uv__nonblock(int fd, int set) {
int r;
@@ -506,7 +519,8 @@ int uv__cloexec(int fd, int set) {
return 0;
}
-#else /* !(defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)) */
+#else /* !(defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \
+ defined(_AIX) || defined(__DragonFly__)) */
int uv__nonblock(int fd, int set) {
int flags;
@@ -569,7 +583,8 @@ int uv__cloexec(int fd, int set) {
return 0;
}
-#endif /* defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) */
+#endif /* defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \
+ defined(_AIX) || defined(__DragonFly__) */
/* This function is not execve-safe, there is a race window
@@ -907,7 +922,8 @@ int uv__open_cloexec(const char* path, int flags) {
int err;
int fd;
-#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD__ >= 9)
+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD__ >= 9) || \
+ defined(__DragonFly__)
static int no_cloexec;
if (!no_cloexec) {