Resolve conflicts for functions introduced in Android API level 21.
+ * lib/unistd.in.h (dup3): Consider REPLACE_DUP3. Disable
+ _GL_CXXALIASWARN invocation on non-glibc systems.
+ * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_DUP3.
+ * modules/unistd (Makefile.am): Substitute REPLACE_DUP3.
+ * m4/dup3.m4 (gl_FUNC_DUP3): Conditionally set REPLACE_DUP3.
+
* lib/string.in.h (stpcpy): Consider REPLACE_STPCPY. Disable
_GL_CXXALIASWARN invocation on non-glibc systems.
* m4/string_h.m4 (gl_STRING_H_DEFAULTS): Initialize REPLACE_STPCPY.
Return newfd if successful, otherwise -1 and errno set.
See the Linux man page at
<https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
-# if @HAVE_DUP3@
+# if @REPLACE_DUP3@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dup3
# define dup3 rpl_dup3
# endif
_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
# else
+# if !@HAVE_DUP3@
_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
+# endif
_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (dup3);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef dup3
# if HAVE_RAW_DECL_DUP3
-# dup3.m4 serial 6
+# dup3.m4 serial 7
dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
gl_CHECK_FUNCS_ANDROID([dup3], [[#include <unistd.h>]])
if test $ac_cv_func_dup3 != yes; then
HAVE_DUP3=0
+ case "$gl_cv_onwards_func_dup3" in
+ future*) REPLACE_DUP3=1 ;;
+ esac
+ else
+ REPLACE_DUP3=1
fi
dnl Not needed yet, because dup3 is unconditionally replaced.
-# unistd_h.m4 serial 91
+# unistd_h.m4 serial 92
dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
REPLACE_COPY_FILE_RANGE=0; AC_SUBST([REPLACE_COPY_FILE_RANGE])
REPLACE_DUP=0; AC_SUBST([REPLACE_DUP])
REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2])
+ REPLACE_DUP3=0; AC_SUBST([REPLACE_DUP3])
REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL])
REPLACE_EXECLE=0; AC_SUBST([REPLACE_EXECLE])
REPLACE_EXECLP=0; AC_SUBST([REPLACE_EXECLP])
-e 's|@''REPLACE_COPY_FILE_RANGE''@|$(REPLACE_COPY_FILE_RANGE)|g' \
-e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+ -e 's|@''REPLACE_DUP3''@|$(REPLACE_DUP3)|g' \
-e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \
-e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \
-e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \