initial handles design
This commit is contained in:
parent
c41b773677
commit
997dbddfce
|
@ -33,4 +33,8 @@ std::string MntPoints::getHostDirectory(const std::string& guest_directory) {
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
int HandleTable::createHandle() { return 0; }
|
||||||
|
void HandleTable::deleteHandle(int d) {}
|
||||||
|
File* HandleTable::getFile(int d) { return nullptr; }
|
||||||
|
File* HandleTable::getFile(const std::string& real_name) { return nullptr; }
|
||||||
} // namespace Core::FileSys
|
} // namespace Core::FileSys
|
|
@ -24,4 +24,18 @@ class MntPoints {
|
||||||
std::mutex m_mutex;
|
std::mutex m_mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct File {};
|
||||||
|
class HandleTable {
|
||||||
|
HandleTable() {}
|
||||||
|
virtual ~HandleTable() {}
|
||||||
|
int createHandle();
|
||||||
|
void deleteHandle(int d);
|
||||||
|
File* getFile(int d);
|
||||||
|
File* getFile(const std::string& real_name);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<File*> m_files;
|
||||||
|
std::mutex m_mutex;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Core::FileSys
|
} // namespace Core::FileSys
|
|
@ -12,7 +12,7 @@ int PS4_SYSV_ABI sceKernelOpen(const char* path, int flags, u16 mode) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PS4_SYSV_ABI open(const char* path, int flags, /* SceKernelMode*/ u16 mode) {
|
int PS4_SYSV_ABI posix_open(const char* path, int flags, /* SceKernelMode*/ u16 mode) {
|
||||||
LOG_INFO_IF(log_file_fs, "posix open redirect to sceKernelOpen\n");
|
LOG_INFO_IF(log_file_fs, "posix open redirect to sceKernelOpen\n");
|
||||||
int result = sceKernelOpen(path, flags, mode);
|
int result = sceKernelOpen(path, flags, mode);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
|
@ -23,7 +23,7 @@ int PS4_SYSV_ABI open(const char* path, int flags, /* SceKernelMode*/ u16 mode)
|
||||||
|
|
||||||
void fileSystemSymbolsRegister(SymbolsResolver* sym) {
|
void fileSystemSymbolsRegister(SymbolsResolver* sym) {
|
||||||
LIB_FUNCTION("1G3lF1Gg1k8", "libkernel", 1, "libkernel", 1, 1, sceKernelOpen);
|
LIB_FUNCTION("1G3lF1Gg1k8", "libkernel", 1, "libkernel", 1, 1, sceKernelOpen);
|
||||||
LIB_FUNCTION("wuCroIGjt2g", "libScePosix", 1, "libkernel", 1, 1, open);
|
LIB_FUNCTION("wuCroIGjt2g", "libScePosix", 1, "libkernel", 1, 1, posix_open);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Core::Libraries::LibKernel
|
} // namespace Core::Libraries::LibKernel
|
|
@ -6,7 +6,7 @@ namespace Core::Libraries::LibKernel {
|
||||||
int PS4_SYSV_ABI sceKernelOpen(const char *path, int flags, /* SceKernelMode*/ u16 mode);
|
int PS4_SYSV_ABI sceKernelOpen(const char *path, int flags, /* SceKernelMode*/ u16 mode);
|
||||||
|
|
||||||
// posix file system
|
// posix file system
|
||||||
int PS4_SYSV_ABI open(const char *path, int flags, /* SceKernelMode*/ u16 mode);
|
int PS4_SYSV_ABI posix_open(const char *path, int flags, /* SceKernelMode*/ u16 mode);
|
||||||
|
|
||||||
|
|
||||||
void fileSystemSymbolsRegister(SymbolsResolver *sym);
|
void fileSystemSymbolsRegister(SymbolsResolver *sym);
|
||||||
|
|
Loading…
Reference in New Issue