perf: fast path answers Steam's pre-2.33 stat calls and stays off without the patched proot (#466)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-09 03:14:29 +00:00
1 parent d6ba3d27d8
commit 7c758c817f
3 files changed
+36 -4

No files matched your search

@@ -24,8 +24,15 @@ object ProotFastPath {
/** MAX_BINDS in fastpath.c: past it the library turns itself off, so the session keeps it off. */
const val MAX_BINDS = 256
/**
* Only the app's own proot (libproot.so, built with patches/0014) lets the trampoline through.
* The runtime's fallback copy (LinuxRuntime.prootBinary) is Termux's, which traps those calls
* too and translates their host paths a second time: every lookup then fails inside the
* process and goes to proot anyway, paying for both.
*/
fun enabled(context: Context): Boolean =
SessionPrefs.prootFastPath(context) && !SessionPrefs.prootNoSeccomp(context)
SessionPrefs.prootFastPath(context) && !SessionPrefs.prootNoSeccomp(context) &&
LinuxRuntime.prootBinary(context).parent == context.applicationInfo.nativeLibraryDir
/** The key for this rootfs and these binds, or null when the library cannot be told them. */
fun key(root: File, binds: List<String>): String? {