mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-30 20:37:45 +00:00
UserspaceEmulator: Implement clock_settime syscall
This commit is contained in:
committed by
Andreas Kling
parent
700f213011
commit
b53664a8ef
@@ -508,6 +508,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
|
||||
return virt$gettimeofday(arg1);
|
||||
case SC_clock_gettime:
|
||||
return virt$clock_gettime(arg1, arg2);
|
||||
case SC_clock_settime:
|
||||
return virt$clock_settime(arg1, arg2);
|
||||
case SC_getrandom:
|
||||
return virt$getrandom(arg1, arg2, arg3);
|
||||
case SC_fork:
|
||||
@@ -767,6 +769,14 @@ int Emulator::virt$clock_gettime(int clockid, FlatPtr timespec)
|
||||
return rc;
|
||||
}
|
||||
|
||||
int Emulator::virt$clock_settime(uint32_t clock_id, FlatPtr user_ts)
|
||||
{
|
||||
struct timespec user_timespec;
|
||||
mmu().copy_from_vm(&user_timespec, user_ts, sizeof(user_timespec));
|
||||
int rc = syscall(SC_clock_settime, clock_id, &user_timespec);
|
||||
return rc;
|
||||
}
|
||||
|
||||
int Emulator::virt$set_mmap_name(FlatPtr)
|
||||
{
|
||||
// FIXME: Implement.
|
||||
|
||||
Reference in New Issue
Block a user