diff --git a/Source/Tests/VDSO_Emulation.cpp b/Source/Tests/VDSO_Emulation.cpp index d03cfa4b6..cb12a352a 100644 --- a/Source/Tests/VDSO_Emulation.cpp +++ b/Source/Tests/VDSO_Emulation.cpp @@ -12,6 +12,22 @@ #include #include +#ifdef TERMUX_BUILD +// getcpu doesn't exist in termux. Expectation is to use sched_getcpu. +#include +int getcpu(uint32_t *cpu, uint32_t *node) { + if (cpu) { + *cpu = ::sched_getcpu(); + } + if (node) { + // No node information + *node = 0; + } + + return 0; +} +#endif + namespace FEX::VDSO { using TimeType = decltype(::time)*; using GetTimeOfDayType = decltype(::gettimeofday)*;