Files
FEX-Emu--FEX/Source/Tests/LinuxSyscalls/Syscalls/SHM.cpp
T
Ryan Houdek 76877e08bc Linux: Add some comments claiming shmctl and msqctl is incorrect on x86
These aren't correctly handled, so they will get garbage data for now
2021-08-30 02:25:48 -07:00

29 lines
785 B
C++

/*
$info$
tags: LinuxSyscalls|syscalls-shared
$end_info$
*/
#include "Tests/LinuxSyscalls/Syscalls.h"
#include "Tests/LinuxSyscalls/x64/Syscalls.h"
#include "Tests/LinuxSyscalls/x32/Syscalls.h"
#include <stddef.h>
#include <stdint.h>
#include <sys/shm.h>
namespace FEX::HLE {
void RegisterSHM() {
REGISTER_SYSCALL_IMPL(shmget, [](FEXCore::Core::CpuStateFrame *Frame, key_t key, size_t size, int shmflg) -> uint64_t {
uint64_t Result = shmget(key, size, shmflg);
SYSCALL_ERRNO();
});
// XXX: shmid_ds is definitely not correct for 32-bit
REGISTER_SYSCALL_IMPL(shmctl, [](FEXCore::Core::CpuStateFrame *Frame, int shmid, int cmd, struct shmid_ds *buf) -> uint64_t {
uint64_t Result = ::shmctl(shmid, cmd, buf);
SYSCALL_ERRNO();
});
}
}