summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-06-11 13:03:46 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-06-11 13:03:46 -0700
commit0071d45b616f0e533818e65cc7307fbe4bd2a282 (patch)
tree3b4a8ec6a3eeea42da96c764ff66bfe94eccf505 /lib
parentdf907af0ddfc4282a6184f1b516cd92dbdf0093f (diff)
downloademacs-0071d45b616f0e533818e65cc7307fbe4bd2a282.tar.gz
Backport fcntl.h AIX fix from the trunk.
This fixes a bug with the shell freezing. See: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17598#185 Merge from gnulib, incorporating: 2014-05-31 dup2, fcntl, fcntl-h: port to AIX 7.1 * lib/fcntl.in.h, m4/dup2.m4, m4/fcntl.m4: Update from gnulib.
Diffstat (limited to 'lib')
-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