diff --git a/src/unix/core.c b/src/unix/core.c index 88e9bfc8..706c89eb 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -38,18 +38,22 @@ #include /* PATH_MAX */ #include /* writev */ +#ifdef __linux__ +# include +#endif + #ifdef __sun # include # include #endif -#if defined(__APPLE__) -#include /* _NSGetExecutablePath */ +#ifdef __APPLE__ +# include /* _NSGetExecutablePath */ #endif -#if defined(__FreeBSD__) -#include -#include +#ifdef __FreeBSD__ +# include +# include #endif static uv_loop_t default_loop_struct; @@ -734,6 +738,9 @@ int uv__close(int fd) { int uv__nonblock(int fd, int set) { +#if FIONBIO + return ioctl(fd, FIONBIO, &set); +#else int flags; if ((flags = fcntl(fd, F_GETFL)) == -1) { @@ -751,6 +758,7 @@ int uv__nonblock(int fd, int set) { } return 0; +#endif }