>From 959415ca4a76b25f254082716a8222f6be140955 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Jan 2023 12:34:17 +0100 Subject: [PATCH 25/47] Resolve conflicts for functions introduced in Android API level 21. * m4/execvpe.m4 (gl_FUNC_EXECVPE): Conditionally set REPLACE_EXECVPE. * m4/linkat.m4 (gl_FUNC_LINKAT): Conditionally set REPLACE_LINKAT. * m4/readlinkat.m4 (gl_FUNC_READLINKAT): Conditionally set REPLACE_READLINKAT. * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Conditionally set REPLACE_SYMLINKAT. * m4/truncate.m4 (gl_FUNC_TRUNCATE): Conditionally set REPLACE_TRUNCATE. * lib/unistd.in.h (execvpe, linkat, readlinkat, symlinkat, truncate): Disable _GL_CXXALIASWARN invocation on non-glibc systems. --- ChangeLog | 10 ++++++++++ lib/unistd.in.h | 10 ++++++++++ m4/execvpe.m4 | 5 ++++- m4/linkat.m4 | 5 ++++- m4/readlinkat.m4 | 5 ++++- m4/symlinkat.m4 | 5 ++++- m4/truncate.m4 | 8 ++++---- 7 files changed, 40 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33b820b888..5479a8685e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,16 @@ Resolve conflicts for functions introduced in Android API level 21. + * m4/execvpe.m4 (gl_FUNC_EXECVPE): Conditionally set REPLACE_EXECVPE. + * m4/linkat.m4 (gl_FUNC_LINKAT): Conditionally set REPLACE_LINKAT. + * m4/readlinkat.m4 (gl_FUNC_READLINKAT): Conditionally set + REPLACE_READLINKAT. + * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Conditionally set + REPLACE_SYMLINKAT. + * m4/truncate.m4 (gl_FUNC_TRUNCATE): Conditionally set REPLACE_TRUNCATE. + * lib/unistd.in.h (execvpe, linkat, readlinkat, symlinkat, truncate): + Disable _GL_CXXALIASWARN invocation on non-glibc systems. + * m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Conditionally set REPLACE_MKNODAT. * lib/sys_stat.in.h (mknodat): Disable _GL_CXXALIASWARN invocation on non-glibc systems. diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 345b73945a..2a6d4ce743 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -875,7 +875,9 @@ _GL_FUNCDECL_SYS (execvpe, int, _GL_CXXALIAS_SYS (execvpe, int, (const char *program, char * const *argv, char * const *env)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (execvpe); +# endif #elif defined GNULIB_POSIXCHECK # undef execvpe # if HAVE_RAW_DECL_EXECVPE @@ -1681,7 +1683,9 @@ _GL_CXXALIAS_SYS (linkat, int, (int fd1, const char *path1, int fd2, const char *path2, int flag)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (linkat); +# endif #elif defined GNULIB_POSIXCHECK # undef linkat # if HAVE_RAW_DECL_LINKAT @@ -1963,7 +1967,9 @@ _GL_CXXALIAS_SYS (readlinkat, ssize_t, (int fd, char const *restrict file, char *restrict buf, size_t len)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (readlinkat); +# endif #elif defined GNULIB_POSIXCHECK # undef readlinkat # if HAVE_RAW_DECL_READLINKAT @@ -2140,7 +2146,9 @@ _GL_FUNCDECL_SYS (symlinkat, int, _GL_CXXALIAS_SYS (symlinkat, int, (char const *contents, int fd, char const *file)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (symlinkat); +# endif #elif defined GNULIB_POSIXCHECK # undef symlinkat # if HAVE_RAW_DECL_SYMLINKAT @@ -2170,7 +2178,9 @@ _GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length) # endif _GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (truncate); +# endif #elif defined GNULIB_POSIXCHECK # undef truncate # if HAVE_RAW_DECL_TRUNCATE diff --git a/m4/execvpe.m4 b/m4/execvpe.m4 index 6c0a0e9b7d..3f211049b8 100644 --- a/m4/execvpe.m4 +++ b/m4/execvpe.m4 @@ -1,4 +1,4 @@ -# execvpe.m4 serial 2 +# execvpe.m4 serial 3 dnl Copyright (C) 2020-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, @@ -18,6 +18,9 @@ AC_DEFUN([gl_FUNC_EXECVPE], gl_CHECK_FUNCS_ANDROID([execvpe], [[#include ]]) if test $ac_cv_func_execvpe != yes; then HAVE_EXECVPE=0 + case "$gl_cv_onwards_func_execvpe" in + future*) REPLACE_EXECVPE=1 ;; + esac fi ;; esac diff --git a/m4/linkat.m4 b/m4/linkat.m4 index 9b35fc14e3..032e89bb54 100644 --- a/m4/linkat.m4 +++ b/m4/linkat.m4 @@ -1,4 +1,4 @@ -# serial 15 +# serial 16 # See if we need to provide linkat replacement. dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. @@ -19,6 +19,9 @@ AC_DEFUN([gl_FUNC_LINKAT], gl_CHECK_FUNCS_ANDROID([linkat], [[#include ]]) if test $ac_cv_func_linkat = no; then HAVE_LINKAT=0 + case "$gl_cv_onwards_func_linkat" in + future*) REPLACE_LINKAT=1 ;; + esac else dnl OS X Yosemite has linkat() but it's not sufficient dnl to our needs since it doesn't support creating diff --git a/m4/readlinkat.m4 b/m4/readlinkat.m4 index 416f9c0d64..5c51356291 100644 --- a/m4/readlinkat.m4 +++ b/m4/readlinkat.m4 @@ -1,4 +1,4 @@ -# serial 7 +# serial 8 # See if we need to provide readlinkat replacement. dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. @@ -16,6 +16,9 @@ AC_DEFUN([gl_FUNC_READLINKAT], AC_REQUIRE([gl_FUNC_READLINK]) if test $ac_cv_func_readlinkat = no; then HAVE_READLINKAT=0 + case "$gl_cv_onwards_func_readlinkat" in + future*) REPLACE_READLINKAT=1 ;; + esac else AC_CACHE_CHECK([whether readlinkat signature is correct], [gl_cv_decl_readlinkat_works], diff --git a/m4/symlinkat.m4 b/m4/symlinkat.m4 index d12f91997c..dc3dd323aa 100644 --- a/m4/symlinkat.m4 +++ b/m4/symlinkat.m4 @@ -1,4 +1,4 @@ -# serial 11 +# serial 12 # See if we need to provide symlinkat replacement. dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. @@ -17,6 +17,9 @@ AC_DEFUN([gl_FUNC_SYMLINKAT], gl_CHECK_FUNCS_ANDROID([symlinkat], [[#include ]]) if test $ac_cv_func_symlinkat = no; then HAVE_SYMLINKAT=0 + case "$gl_cv_onwards_func_symlinkat" in + future*) REPLACE_SYMLINKAT=1 ;; + esac else AC_CACHE_CHECK([whether symlinkat handles trailing slash correctly], [gl_cv_func_symlinkat_works], diff --git a/m4/truncate.m4 b/m4/truncate.m4 index b047af34c9..fe9fdbf408 100644 --- a/m4/truncate.m4 +++ b/m4/truncate.m4 @@ -1,4 +1,4 @@ -# truncate.m4 serial 4 -*- Autoconf -*- +# truncate.m4 serial 5 -*- Autoconf -*- dnl Copyright (C) 2017-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, @@ -71,10 +71,10 @@ AC_DEFUN([gl_FUNC_TRUNCATE], fi else HAVE_DECL_TRUNCATE=0 - if test $ac_cv_func_truncate = yes; then + case "$gl_cv_onwards_func_truncate" in dnl Avoid a conflict with the 'truncate' in libc. - REPLACE_TRUNCATE=1 - fi + yes | future*) REPLACE_TRUNCATE=1 ;; + esac fi ]) -- 2.34.1