Files
FEX-Emu--FEX/Source/Tests/LinuxSyscalls/EmulatedFiles/EmulatedFiles.h
T
Ryan Houdek 22377d9c2c Have EmulatedFiles support osrelease file
This was being checked by an application for kernel version. Which was
seeing too new of a kernel and using things that were unsupported.

Also removes the EmulatedMap which is an unnecessary lookup.
2021-01-10 02:14:44 -08:00

35 lines
1.0 KiB
C++

#pragma once
#include <FEXCore/Config/Config.h>
#include <cstdint>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <string>
namespace FEXCore {
class FD;
}
namespace FEXCore::Context {
struct Context;
}
namespace FEX::EmulatedFile {
class EmulatedFDManager {
public:
EmulatedFDManager(FEXCore::Context::Context *ctx);
~EmulatedFDManager();
int32_t OpenAt(int dirfs, const char *pathname, int flags, uint32_t mode);
private:
FEXCore::Context::Context *CTX;
std::string cpus_online{};
std::string cpu_info{};
using FDReadStringFunc = std::function<int32_t(FEXCore::Context::Context *ctx, int32_t fd, const char *pathname, int32_t flags, mode_t mode)>;
std::unordered_map<std::string, FDReadStringFunc> FDReadCreators;
static int32_t ProcAuxv(FEXCore::Context::Context* ctx, int32_t fd, const char* pathname, int32_t flags, mode_t mode);
FEXCore::Config::Value<uint64_t> ThreadsConfig{FEXCore::Config::CONFIG_EMULATED_CPU_CORES, 1};
};
}