From 4c47fcd787fe3c5672b553001beb56b2ffc97f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 6 Mar 2014 15:21:25 +0100 Subject: [PATCH] freebsd: use accept4, introduced in version 10 --- src/unix/core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/unix/core.c b/src/unix/core.c index 936d8950..a409f5dd 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -61,6 +61,12 @@ # include #endif +#if __FreeBSD__ >= 10 +# define uv__accept4 accept4 +# define UV__SOCK_NONBLOCK SOCK_NONBLOCK +# define UV__SOCK_CLOEXEC SOCK_CLOEXEC +#endif + static void uv__run_pending(uv_loop_t* loop); /* Verify that uv_buf_t is ABI-compatible with struct iovec. */ @@ -371,7 +377,7 @@ int uv__accept(int sockfd) { assert(sockfd >= 0); while (1) { -#if defined(__linux__) +#if defined(__linux__) || __FreeBSD__ >= 10 static int no_accept4; if (no_accept4)