>From 3842cd1d67868fdd3a5aeeaa37e6a8f0d7818c3f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 25 Jan 2019 00:08:52 +0100 Subject: [PATCH 4/7] unlinkat: Fix compilation error on Android 4.3. * lib/unistd.in.h: Include when module 'unlinkat' is in use also on Android. * doc/posix-functions/unlinkat.texi: Mention the issue. --- ChangeLog | 7 +++++++ doc/posix-functions/unlinkat.texi | 8 ++++---- lib/unistd.in.h | 6 ++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index fad53ae..baa8590 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2019-01-24 Bruno Haible + unlinkat: Fix compilation error on Android 4.3. + * lib/unistd.in.h: Include when module 'unlinkat' is in use + also on Android. + * doc/posix-functions/unlinkat.texi: Mention the issue. + +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. diff --git a/doc/posix-functions/unlinkat.texi b/doc/posix-functions/unlinkat.texi index de9d517..fb4e69f 100644 --- a/doc/posix-functions/unlinkat.texi +++ b/doc/posix-functions/unlinkat.texi @@ -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{}, not in @code{}, +on some platforms: +Cygwin 1.7.1, Android 4.3. address@hidden 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. address@hidden -Some platforms declare this function in @code{fcntl.h} instead of address@hidden: -Cygwin 1.7.1. @end itemize Portability problems not fixed by Gnulib: diff --git a/lib/unistd.in.h b/lib/unistd.in.h index eb2534e..0ff7396 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -68,9 +68,11 @@ # include #endif -/* Cygwin 1.7.1 declares unlinkat in , not in . */ +/* Cygwin 1.7.1 and Android 4.3 declare unlinkat in , not in + . */ /* 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 #endif -- 2.7.4