# HG changeset patch # User Bruno Haible # Date 1548585466 -3600 # Node ID db994b489ff2e937c53765dcdfcc1bb14a9387a6 # Parent dd38f4180e3f3455d98a3d78e4ab9e31bdf83f1e relocatable-prog: Use Linux code on Android. * lib/progreloc.c: Treat Android like Linux. diff -r dd38f4180e3f -r db994b489ff2 ChangeLog --- a/ChangeLog Sun Jan 27 04:57:32 2019 +0100 +++ b/ChangeLog Sun Jan 27 11:37:46 2019 +0100 @@ -1,3 +1,8 @@ +2019-01-27 Bruno Haible + + relocatable-prog: Use Linux code on Android. + * lib/progreloc.c: Treat Android like Linux. + 2019-01-26 Bruno Haible getloadavg: Add support for Android. diff -r dd38f4180e3f -r db994b489ff2 lib/progreloc.c --- a/lib/progreloc.c Sun Jan 27 04:57:32 2019 +0100 +++ b/lib/progreloc.c Sun Jan 27 11:37:46 2019 +0100 @@ -102,7 +102,7 @@ #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 @@ 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 @@ return xstrdup (location); #else /* Unix */ -# ifdef __linux__ +# if defined __linux__ || defined __ANDROID__ /* The executable is accessible as /proc//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,