strtol: remove dependency on wchar
[pspp] / lib / fcntl.in.h
index b6521d67192eb4fcc7c1ac404868631d87468482..ce7c8c016cb29f26d157aaff7402d276b929efe3 100644 (file)
@@ -218,6 +218,9 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
 # define O_NONBLOCK O_NDELAY
 #endif
 
+/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero
+   value of O_NONBLOCK.  Otherwise, O_NONBLOCK is defined (above) to O_NDELAY
+   or to 0 as fallback.  */
 #if @GNULIB_NONBLOCKING@
 # if O_NONBLOCK
 #  define GNULIB_defined_O_NONBLOCK 0
@@ -256,6 +259,11 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
 # define O_TTY_INIT 0
 #endif
 
+#if O_ACCMODE != (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+# undef O_ACCMODE
+# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+#endif
+
 /* For systems that distinguish between text and binary I/O.
    O_BINARY is usually declared in fcntl.h  */
 #if !defined O_BINARY && defined _O_BINARY