summaryrefslogtreecommitdiff
path: root/lib/fcntl.in.h
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-04-08 10:22:00 -0600
committerEric Blake <eblake@redhat.com>2011-04-08 10:59:24 -0600
commitb277764ab1e0a68b1db0bf254ea4dbe8e16c0603 (patch)
tree7c3697fca585441b78ab1410b186b6d30a25685a /lib/fcntl.in.h
parente7f37a2118b1a1384951d8ac8c58fe3ae1a7fd71 (diff)
downloadgnulib-b277764ab1e0a68b1db0bf254ea4dbe8e16c0603.tar.gz
fcntl-h: fix O_ACCMODE on cygwin
* doc/posix-headers/fcntl.texi (fcntl.h): Document the bug. * lib/fcntl.in.h (O_ACCMODE): Fix it. Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'lib/fcntl.in.h')
-rw-r--r--lib/fcntl.in.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index b6521d6719..971316fc05 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -256,6 +256,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