summaryrefslogtreecommitdiff
path: root/lib/stdio.in.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-01-25 00:03:12 +0100
committerBruno Haible <bruno@clisp.org>2019-01-25 02:14:26 +0100
commit1f9ed3993819c7be86c21a6593bba316bb1dfc64 (patch)
tree5b3c1fa15e9e85ca0416f7120273e4773c0acb53 /lib/stdio.in.h
parent3c136a2cc38d71083f123231a8b9ad4b01930789 (diff)
downloadgnulib-1f9ed3993819c7be86c21a6593bba316bb1dfc64.tar.gz
renameat: Fix compilation error on Android 4.3.
* lib/stdio.in.h: Include <sys/stat.h> when module 'renameat' is in use. * doc/posix-functions/renameat.texi: Mention the issue.
Diffstat (limited to 'lib/stdio.in.h')
-rw-r--r--lib/stdio.in.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index c7acb66b2e..98c8093189 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -118,6 +118,13 @@
# include <unistd.h>
#endif
+/* Android 4.3 declares renameat in <sys/stat.h>, not in <stdio.h>. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
+ && ! defined __GLIBC__
+# include <sys/stat.h>
+#endif
+
/* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>. We must include
it before we #define perror rpl_perror. */
/* But in any case avoid namespace pollution on glibc systems. */