Android: fixes binaries built via NDK running on Termux

This commit is contained in:
Carter Li
2026-10-07 14:29:42 +08:00
parent 9859b248ff
commit 35a35f066c
2 changed files with 11 additions and 2 deletions
+5
View File
@@ -333,7 +333,12 @@ static void getCwd(FFPlatform* platform) {
void ffPlatformInitImpl(FFPlatform* platform) {
platform->pid = (uint32_t) getpid();
platform->uid = getuid();
#if !__ANDROID__
struct passwd* pwd = getpwuid(platform->uid);
#else
// On Android, /etc/passwd is empty, and getpwuid() will return `/data` for pw_dir
struct passwd* pwd = nullptr;
#endif
struct utsname uts;
if (uname(&uts) < 0) {