We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a960d17 commit 00890e4Copy full SHA for 00890e4
1 file changed
src/node_constants.cc
@@ -27,11 +27,14 @@
27
#if !defined(_MSC_VER)
28
#include <unistd.h>
29
#endif
30
-#include <fcntl.h>
31
#include <signal.h>
32
#include <sys/types.h>
33
#include <sys/stat.h>
34
+// O_NONBLOCK is not exported, unless _XOPEN_SOURCE is set
35
+#define _XOPEN_SOURCE 500
36
+#include <fcntl.h>
37
+
38
#if HAVE_OPENSSL
39
# include <openssl/ssl.h>
40
@@ -110,6 +113,10 @@ void DefineConstants(Handle<Object> target) {
110
113
NODE_DEFINE_CONSTANT(target, O_DIRECT);
111
114
112
115
116
+#ifdef O_NONBLOCK
117
+ NODE_DEFINE_CONSTANT(target, O_NONBLOCK);
118
+#endif
119
120
#ifdef S_IRWXU
121
NODE_DEFINE_CONSTANT(target, S_IRWXU);
122
0 commit comments