MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / QueryInterpreterInstalled

Function QueryInterpreterInstalled

Source/Tools/FEXLoader/FEXLoader.cpp:153–163  ·  view source on GitHub ↗

* @brief Queries if FEX is installed as a binfmt_misc interpreter * * @param ExecutedWithFD If FEXInterpreter was executed using a binfmt_misc FD handle from the kernel * @param Portable Portability information about FEX being run in portable mode * * @return true if the binfmt_misc handlers are installed and being used */

Source from the content-addressed store, hash-verified

151 * @return true if the binfmt_misc handlers are installed and being used
152 */
153bool QueryInterpreterInstalled(bool ExecutedWithFD, const FEX::Config::PortableInformation& Portable) {
154 if (Portable.IsPortable) {
155 // Don't use binfmt interpreter even if it's installed
156 return false;
157 }
158
159 // Check if FEX's binfmt_misc handlers are both installed.
160 // The explicit check can be omitted if FEX was executed from an FD,
161 // since this only happens if the kernel launched FEX through binfmt_misc
162 return ExecutedWithFD || (access("/proc/sys/fs/binfmt_misc/FEX-x86", F_OK) == 0 && access("/proc/sys/fs/binfmt_misc/FEX-x86_64", F_OK) == 0);
163}
164
165namespace FEX::TSO {
166void SetupTSOEmulation(FEXCore::Context::Context* CTX) {

Callers 1

mainFunction · 0.85

Calls 1

accessFunction · 0.85

Tested by

no test coverage detected