Remove unused android filesystem helpers

We don't use neither opendir nor readdir nor closedir. Further there are
no callers for init_libc().

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2026-06-18 19:47:36 +02:00
parent 62e116340e
commit 3c0274c7cc
-35
View File
@@ -42,41 +42,6 @@
#include <fcntl.h>
#include <string>
#if OS_ANDROID
// The Crystax NDK seems to do weird things with opendir etc.
// To avoid that, load the symbols directly from the real libc
// and use them instead.
#include <dlfcn.h>
static void* libc;
static DIR* (*libc_opendir)(const char*);
static dirent* (*libc_readdir)(DIR*);
static int (*libc_closedir)(DIR*);
void init_libc()
{
if (libc)
return;
libc = dlopen("/system/lib/libc.so", RTLD_LAZY);
ENSURE(libc);
libc_opendir = (DIR*(*)(const char*))dlsym(libc, "opendir");
libc_readdir = (dirent*(*)(DIR*))dlsym(libc, "readdir");
libc_closedir = (int(*)(DIR*))dlsym(libc, "closedir");
ENSURE(libc_opendir && libc_readdir && libc_closedir);
}
#define opendir libc_opendir
#define readdir libc_readdir
#define closedir libc_closedir
#else
void init_libc() { }
#endif
int wopen(const OsPath& pathname, int oflag)
{
ENSURE(!(oflag & O_CREAT));