summaryrefslogtreecommitdiff
path: root/filecntl.h
diff options
context:
space:
mode:
Diffstat (limited to 'filecntl.h')
-rw-r--r--filecntl.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/filecntl.h b/filecntl.h
index c0b20811..cf5054de 100644
--- a/filecntl.h
+++ b/filecntl.h
@@ -33,4 +33,13 @@
#define SET_CLOSE_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_CLOEXEC))
#define SET_OPEN_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_NCLOEXEC))
+/* How to open a file in non-blocking mode, the Posix.1 way. */
+#if !defined (O_NONBLOCK)
+# if defined (O_NDELAY)
+# define O_NONBLOCK O_NDELAY
+# else
+# define O_NONBLOCK 0
+# endif
+#endif
+
#endif /* ! _FILECNTL_H_ */