]> Savannah Git Hosting - gnulib.git/commitdiff
unlinkat: Fix compilation error on Android 4.3.
authorBruno Haible <bruno@clisp.org>
Thu, 24 Jan 2019 23:08:52 +0000 (00:08 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 25 Jan 2019 01:14:27 +0000 (02:14 +0100)
* lib/unistd.in.h: Include <fcntl.h> when module 'unlinkat' is in use
also on Android.
* doc/posix-functions/unlinkat.texi: Mention the issue.

ChangeLog
doc/posix-functions/unlinkat.texi
lib/unistd.in.h

index fad53aee9cfe125f0937a9d98aac4ff55d418646..baa85902977d554305983410245bf0595fcf5bc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-01-24  Bruno Haible  <bruno@clisp.org>
+
+       unlinkat: Fix compilation error on Android 4.3.
+       * lib/unistd.in.h: Include <fcntl.h> when module 'unlinkat' is in use
+       also on Android.
+       * doc/posix-functions/unlinkat.texi: Mention the issue.
+
 2019-01-24  Bruno Haible  <bruno@clisp.org>
 
        renameat: Fix compilation error on Android 4.3.
index de9d517cee598491c62b9032a45c2486c95a3ac3..fb4e69fc9da104131009131f60cfcac12a7c0327 100644 (file)
@@ -14,15 +14,15 @@ 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, 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.
 @item
+This function is declared in @code{<fcntl.h>}, not in @code{<unistd.h>},
+on some platforms:
+Cygwin 1.7.1, Android 4.3.
+@item
 On Mac OS X 10.10, in a writable HFS mount, @code{unlinkat(fd, "..", 0)} succeeds
 without doing anything.
 @item
 Some systems mistakenly succeed on @code{unlinkat(fd,"file/",flag)}:
 GNU/Hurd, Solaris 9.
-@item
-Some platforms declare this function in @code{fcntl.h} instead of
-@code{unistd.h}:
-Cygwin 1.7.1.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index eb2534e6037157a146b73242803d9351ac19d469..0ff7396b300fcdf5bb0cfbc836a5904f5e8fe722 100644 (file)
 # include <stdio.h>
 #endif
 
-/* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>.  */
+/* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in
+   <unistd.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
-#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \
+#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \
+    && (defined __CYGWIN__ || defined __ANDROID__) \
     && ! defined __GLIBC__
 # include <fcntl.h>
 #endif