[rpcsx-os] shm: do abort on unknown shm open

This commit is contained in:
DH 2023-07-30 00:34:05 +03:00
parent f65697769b
commit 99a3a4005b

View file

@ -2,6 +2,7 @@
#include "orbis/KernelAllocator.hpp"
#include "orbis/error/ErrorCode.hpp"
#include "orbis/file.hpp"
#include "orbis/thread/Thread.hpp"
#include "orbis/utils/Logs.hpp"
#include <fcntl.h>
#include <sys/mman.h>
@ -31,10 +32,20 @@ orbis::ErrorCode ShmDevice::open(orbis::Ref<orbis::File> *file,
// TODO
realFlags |= O_CREAT;
size = 0x4000;
} else if (name == "/rpcsx-vmicDdShmAin") {
// TODO
realFlags |= O_CREAT;
size = 0x4000;
} else if (name == "/rpcsx-SceNpPlusLogger") {
realFlags |= O_CREAT;
size = 0x4400;
thread->where();
} else if (~flags & 0x200) {
ORBIS_LOG_ERROR("SHM: unknown shared memory", path);
thread->where();
std::abort();
}
realFlags |= O_CREAT; // TODO
int fd = shm_open(name.c_str(), realFlags, S_IRUSR | S_IWUSR);
if (fd < 0) {
std::printf("shm_open: error %u\n", errno);