diff --git a/configure.ac b/configure.ac index f5f4e77173..9c4e697de5 100755 --- a/configure.ac +++ b/configure.ac @@ -3618,6 +3618,11 @@ case $host in ;; esac +AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")], + [[#include + #include ]]) + + AC_CHECK_FUNCS([geteuid \ getpass_r \ getppid \ diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 5593a3b5c2..9696a07d08 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -800,4 +800,11 @@ endings either CRLF or LF so 't' is appropriate. #define CURL_SA_FAMILY_T unsigned short #endif +/* Some versions of the Android SDK is missing the declaration */ +#if defined(HAVE_GETPWUID_R) && defined(HAVE_DECL_GETPWUID_R_MISSING) +struct passwd; +int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, + size_t buflen, struct passwd **result); +#endif + #endif /* HEADER_CURL_SETUP_H */