>From 881edc83d5cdf29b7697353db5e6800a6deb46d5 Mon Sep 17 00:00:00 2001
From: Bruno Haible
Date: Fri, 25 Jan 2019 00:03:12 +0100
Subject: [PATCH 3/7] renameat: Fix compilation error on Android 4.3.
* lib/stdio.in.h: Include when module 'renameat' is in use.
* doc/posix-functions/renameat.texi: Mention the issue.
---
ChangeLog | 6 ++++++
doc/posix-functions/renameat.texi | 25 +++++++++++++++----------
lib/stdio.in.h | 7 +++++++
3 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5606681..fad53ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2019-01-24 Bruno Haible
+ renameat: Fix compilation error on Android 4.3.
+ * lib/stdio.in.h: Include when module 'renameat' is in use.
+ * doc/posix-functions/renameat.texi: Mention the issue.
+
+2019-01-24 Bruno Haible
+
fchownat: Fix compilation error on Android 4.3.
* lib/unistd.in.h: Include when module 'fchownat' is in
use.
diff --git a/doc/posix-functions/renameat.texi b/doc/posix-functions/renameat.texi
index 1411e2e..bbd1110 100644
--- a/doc/posix-functions/renameat.texi
+++ b/doc/posix-functions/renameat.texi
@@ -9,6 +9,21 @@ Gnulib module: renameat
Portability problems fixed by Gnulib:
@itemize
@item
+This function is missing on some platforms:
+glibc 2.3.6, Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8,
+AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 8, Cygwin 1.5.x, mingw, MSVC 14,
+Interix 3.5, BeOS.
+But the replacement function is not safe to be used in libraries and is not
+multithread-safe.
address@hidden
+This function is declared in @code{}, not in @code{},
+on some platforms:
+NetBSD 7.0, Solaris 11.4.
address@hidden
+This function is declared in @code{}, not in @code{},
+on some platforms:
+Android 4.3.
address@hidden
This function does not reject trailing slashes on non-directories on
some platforms, as in @code{renameat(fd,"file",fd,"new/")}:
Solaris 11.4.
@@ -16,16 +31,6 @@ Solaris 11.4.
This function ignores trailing slashes on symlinks on some platforms,
such that @code{renameat(fd,"link/",fd,"new")} corrupts @file{link}:
Solaris 9.
address@hidden
-This function is declared in @code{} instead of @code{}
-on some platforms:
-NetBSD 7.0, Solaris 11.4.
address@hidden
-This function is missing on some platforms:
-glibc 2.3.6, Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8,
-AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 8, Cygwin 1.5.x, mingw, MSVC 14,
-Interix 3.5, BeOS.
-But the replacement function is not safe to be used in libraries and is not multithread-safe.
@end itemize
Portability problems not fixed by Gnulib:
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index c7acb66..98c8093 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -118,6 +118,13 @@
# include
#endif
+/* Android 4.3 declares renameat in , not in . */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
+ && ! defined __GLIBC__
+# include
+#endif
+
/* MSVC declares 'perror' in , not in . We must include
it before we #define perror rpl_perror. */
/* But in any case avoid namespace pollution on glibc systems. */
--
2.7.4