mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-03-06 21:47:32 +00:00
Fixes timer syscall API
The glibc and kernel timer interfaces are sufficiently different enough that unwrapping this through glibc is impossible. Pass it directly through to the kernel.
This commit is contained in:
parent
4d98c890e7
commit
3679156dd7
@ -7,6 +7,7 @@
|
||||
#include <signal.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace FEX::HLE {
|
||||
@ -18,27 +19,27 @@ namespace FEX::HLE {
|
||||
});
|
||||
|
||||
REGISTER_SYSCALL_IMPL(timer_create, [](FEXCore::Core::InternalThreadState *Thread, clockid_t clockid, struct sigevent *sevp, timer_t *timerid) -> uint64_t {
|
||||
uint64_t Result = ::timer_create(clockid, sevp, timerid);
|
||||
uint64_t Result = ::syscall(SYS_timer_create, clockid, sevp, timerid);
|
||||
SYSCALL_ERRNO();
|
||||
});
|
||||
|
||||
REGISTER_SYSCALL_IMPL(timer_settime, [](FEXCore::Core::InternalThreadState *Thread, timer_t timerid, int flags, const struct itimerspec *new_value, struct itimerspec *old_value) -> uint64_t {
|
||||
uint64_t Result = ::timer_settime(timerid, flags, new_value, old_value);
|
||||
uint64_t Result = ::syscall(SYS_timer_settime, timerid, flags, new_value, old_value);
|
||||
SYSCALL_ERRNO();
|
||||
});
|
||||
|
||||
REGISTER_SYSCALL_IMPL(timer_gettime, [](FEXCore::Core::InternalThreadState *Thread, timer_t timerid, struct itimerspec *curr_value) -> uint64_t {
|
||||
uint64_t Result = ::timer_gettime(timerid, curr_value);
|
||||
uint64_t Result = ::syscall(SYS_timer_gettime, timerid, curr_value);
|
||||
SYSCALL_ERRNO();
|
||||
});
|
||||
|
||||
REGISTER_SYSCALL_IMPL(timer_getoverrun, [](FEXCore::Core::InternalThreadState *Thread, timer_t timerid) -> uint64_t {
|
||||
uint64_t Result = ::timer_getoverrun(timerid);
|
||||
uint64_t Result = ::syscall(SYS_timer_getoverrun, timerid);
|
||||
SYSCALL_ERRNO();
|
||||
});
|
||||
|
||||
REGISTER_SYSCALL_IMPL(timer_delete, [](FEXCore::Core::InternalThreadState *Thread, timer_t timerid) -> uint64_t {
|
||||
uint64_t Result = ::timer_delete(timerid);
|
||||
uint64_t Result = ::syscall(SYS_timer_delete, timerid);
|
||||
SYSCALL_ERRNO();
|
||||
});
|
||||
|
||||
|
@ -61,3 +61,6 @@ unlink_test
|
||||
mmap_test
|
||||
mremap_test
|
||||
semaphore_test
|
||||
splice_test
|
||||
sendfile_test
|
||||
timers_test
|
||||
|
Loading…
x
Reference in New Issue
Block a user