summaryrefslogtreecommitdiff
path: root/lib/fcntl.in.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-06-01 16:58:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-06-01 16:58:38 -0700
commiteed652d649d28e9dafdb01f9c7425d7d28899e0d (patch)
tree07fbdfd51e4877c85a23b996dc244ff7f21a0d57 /lib/fcntl.in.h
parentb9928bbace87a54feffa5fc21eab791f658406b9 (diff)
downloademacs-eed652d649d28e9dafdb01f9c7425d7d28899e0d.tar.gz
Merge from gnulib.
This incorporates: 2014-06-02 acl: apply pure attribute to two functions 2014-06-01 gnulib-common.m4: add _GL_UNUSED_LABEL 2014-05-31 dup2, fcntl, fcntl-h: port to AIX 7.1 2014-05-30 ftoastr: work around compiler bug in IBM xlc 12.1 * lib/acl-internal.h, lib/fcntl.in.h, lib/ftoastr.h: * m4/dup2.m4, m4/fcntl.m4, m4/gnulib-common.m4: Update from gnulib.
Diffstat (limited to 'lib/fcntl.in.h')
-rw-r--r--lib/fcntl.in.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index 99f75e60fd4..e23b4b2bcdd 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -186,6 +186,22 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
/* Fix up the O_* macros. */
+/* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT
+ to values outside 'int' range, so omit these misdefinitions.
+ But avoid namespace pollution on non-AIX systems. */
+#ifdef _AIX
+# include <limits.h>
+# if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX)
+# undef O_CLOEXEC
+# endif
+# if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX)
+# undef O_NOFOLLOW
+# endif
+# if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX)
+# undef O_TTY_INIT
+# endif
+#endif
+
#if !defined O_DIRECT && defined O_DIRECTIO
/* Tru64 spells it 'O_DIRECTIO'. */
# define O_DIRECT O_DIRECTIO