summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-10-18 23:33:40 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-10-18 23:33:40 -0700
commit821339c944eea52105777c5f52bdc3cf477b475c (patch)
tree373d674f6993de76acad4ac09eaf3fc457815bf1 /m4
parent265331858f3cd63f3ab593461ca4f2931780ba5e (diff)
Merge from gnulib.
This incorporates: 2014-10-18 readlinkat: port to AIX 7.1 2014-10-07 fcntl: fix error reporting by dupfd * lib/fcntl.c, lib/readlinkat.c, lib/unistd.in.h, m4/readlinkat.m4: * m4/unistd_h.m4: Update from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
Diffstat (limited to 'm4')
-rw-r--r--m4/gnulib-comp.m42
-rw-r--r--m4/readlinkat.m415
-rw-r--r--m4/unistd_h.m44
3 files changed, 18 insertions, 3 deletions
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 7b6b5c00f9..39ec8ae00e 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -322,7 +322,7 @@ AC_DEFUN([gl_INIT],
fi
gl_UNISTD_MODULE_INDICATOR([readlink])
gl_FUNC_READLINKAT
- if test $HAVE_READLINKAT = 0; then
+ if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then
AC_LIBOBJ([readlinkat])
fi
gl_UNISTD_MODULE_INDICATOR([readlinkat])
diff --git a/m4/readlinkat.m4 b/m4/readlinkat.m4
index 65c0689c11..f9ed9436af 100644
--- a/m4/readlinkat.m4
+++ b/m4/readlinkat.m4
@@ -1,4 +1,4 @@
-# serial 3
+# serial 4
# See if we need to provide readlinkat replacement.
dnl Copyright (C) 2009-2014 Free Software Foundation, Inc.
@@ -15,5 +15,18 @@ AC_DEFUN([gl_FUNC_READLINKAT],
AC_CHECK_FUNCS_ONCE([readlinkat])
if test $ac_cv_func_readlinkat = no; then
HAVE_READLINKAT=0
+ else
+ AC_CACHE_CHECK([whether readlinkat signature is correct],
+ [gl_cv_decl_readlinkat_works],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+ /* Check whether original declaration has correct type. */
+ ssize_t readlinkat (int, char const *, char *, size_t);]])],
+ [gl_cv_decl_readlinkat_works=yes],
+ [gl_cv_decl_readlinkat_works=no])])
+ if test "$gl_cv_decl_readlink_works" != yes; then
+ REPLACE_READLINKAT=1
+ fi
fi
])
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index 1fa197e694..d7346a0b05 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 67
+# unistd_h.m4 serial 68
dnl Copyright (C) 2006-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -173,9 +173,11 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE])
REPLACE_READ=0; AC_SUBST([REPLACE_READ])
REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK])
+ REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT])
REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR])
REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])
REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK])
+ REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT])
REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R])
REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK])
REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT])