Files
FEX-Emu--FEX/Source/Tests/LinuxSyscalls/Syscalls/Semaphore.cpp
T
Ryan Houdek 3cc59bc68e LinuxSyscalls: Switches to a bunch of raw syscalls
For older and Termux build environments these helper libc functions
don't exist.
2022-03-01 03:49:31 -08:00

29 lines
729 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 <FEXCore/IR/IR.h>
#include <FEXHeaderUtils/Syscalls.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
namespace FEX::HLE {
void RegisterSemaphore() {
using namespace FEXCore::IR;
REGISTER_SYSCALL_IMPL_PASS_FLAGS(semget, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY,
[](FEXCore::Core::CpuStateFrame *Frame, key_t key, int nsems, int semflg) -> uint64_t {
uint64_t Result = ::syscall(SYSCALL_DEF(semget), key, nsems, semflg);
SYSCALL_ERRNO();
});
}
}