diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2014-03-06 20:29:21 +0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-05-02 22:54:08 +0400 |
commit | 00890e43fb935c8bc5dc150f0f2c96bc465d8a4d (patch) | |
tree | 5daed744d3129f93fc4a5bc02024f679d534c2e5 /src | |
parent | a960d1707a0038bfa5546c669b5b63c35bdb75c5 (diff) |
constants: export O_NONBLOCK
Signed-off-by: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_constants.cc | 9 |
1 files changed, 8 insertions, 1 deletions
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 <unistd.h> #endif -#include <fcntl.h> #include <signal.h> #include <sys/types.h> #include <sys/stat.h> +// O_NONBLOCK is not exported, unless _XOPEN_SOURCE is set +#define _XOPEN_SOURCE 500 +#include <fcntl.h> + #if HAVE_OPENSSL # include <openssl/ssl.h> #endif @@ -110,6 +113,10 @@ void DefineConstants(Handle<Object> 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 |