diff --git a/src/node_constants.cc b/src/node_constants.cc index 2aea278cb69..d364fb2df49 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -27,11 +27,14 @@ #if !defined(_MSC_VER) #include #endif -#include #include #include #include +// O_NONBLOCK is not exported, unless _XOPEN_SOURCE is set +#define _XOPEN_SOURCE 500 +#include + #if HAVE_OPENSSL # include #endif @@ -110,6 +113,10 @@ void DefineConstants(Handle target) { NODE_DEFINE_CONSTANT(target, O_DIRECT); #endif +#ifdef O_NONBLOCK + NODE_DEFINE_CONSTANT(target, O_NONBLOCK); +#endif + #ifdef S_IRWXU NODE_DEFINE_CONSTANT(target, S_IRWXU); #endif