summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-01-27 11:37:46 +0100
committerBruno Haible <bruno@clisp.org>2019-01-27 11:37:46 +0100
commitfa3e028aab95578dacf9bf42733c123865b82654 (patch)
tree0c306fcccf4f0923e0e8ef193ca08dc747813778
parent70152b70539454073fbcd503daeed368b1059f43 (diff)
downloadgnulib-fa3e028aab95578dacf9bf42733c123865b82654.tar.gz
relocatable-prog: Use Linux code on Android.
* lib/progreloc.c: Treat Android like Linux.
-rw-r--r--ChangeLog5
-rw-r--r--lib/progreloc.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 80aeb34f13..82fc48fa87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-27 Bruno Haible <bruno@clisp.org>
+
+ relocatable-prog: Use Linux code on Android.
+ * lib/progreloc.c: Treat Android like Linux.
+
2019-01-26 Bruno Haible <bruno@clisp.org>
getloadavg: Add support for Android.
diff --git a/lib/progreloc.c b/lib/progreloc.c
index 5cec3106c7..1c4db0c6f1 100644
--- a/lib/progreloc.c
+++ b/lib/progreloc.c
@@ -102,7 +102,7 @@ extern char * canonicalize_file_name (const char *name);
#if ENABLE_RELOCATABLE
-#if defined __linux__ || defined __CYGWIN__
+#if defined __linux__ || defined __ANDROID__ || defined __CYGWIN__
/* File descriptor of the executable.
(Only used to verify that we find the correct executable.) */
static int executable_fd = -1;
@@ -118,7 +118,7 @@ maybe_executable (const char *filename)
return false;
#endif
-#if defined __linux__ || defined __CYGWIN__
+#if defined __linux__ || defined __ANDROID__ || defined __CYGWIN__
if (executable_fd >= 0)
{
/* If we already have an executable_fd, check that filename points to
@@ -180,7 +180,7 @@ find_executable (const char *argv0)
return xstrdup (location);
#else /* Unix */
-# ifdef __linux__
+# if defined __linux__ || defined __ANDROID__
/* The executable is accessible as /proc/<pid>/exe. In newer Linux
versions, also as /proc/self/exe. Linux >= 2.1 provides a symlink
to the true pathname; older Linux versions give only device and ino,