Skip to content

Commit 00890e4

Browse files
committed
constants: export O_NONBLOCK
Signed-off-by: Fedor Indutny <fedor@indutny.com>
1 parent a960d17 commit 00890e4

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/node_constants.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@
2727
#if !defined(_MSC_VER)
2828
#include <unistd.h>
2929
#endif
30-
#include <fcntl.h>
3130
#include <signal.h>
3231
#include <sys/types.h>
3332
#include <sys/stat.h>
3433

34+
// O_NONBLOCK is not exported, unless _XOPEN_SOURCE is set
35+
#define _XOPEN_SOURCE 500
36+
#include <fcntl.h>
37+
3538
#if HAVE_OPENSSL
3639
# include <openssl/ssl.h>
3740
#endif
@@ -110,6 +113,10 @@ void DefineConstants(Handle<Object> target) {
110113
NODE_DEFINE_CONSTANT(target, O_DIRECT);
111114
#endif
112115

116+
#ifdef O_NONBLOCK
117+
NODE_DEFINE_CONSTANT(target, O_NONBLOCK);
118+
#endif
119+
113120
#ifdef S_IRWXU
114121
NODE_DEFINE_CONSTANT(target, S_IRWXU);
115122
#endif

0 commit comments

Comments
 (0)