1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 00:07:34 +00:00

UserspaceEmulator: Add the usleep() syscall

This commit is contained in:
Andreas Kling 2020-07-16 21:38:01 +02:00
parent 27aa2e5841
commit b17d175379
2 changed files with 8 additions and 0 deletions

View file

@ -226,6 +226,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
dbgprintf("Syscall: %s (%x)\n", Syscall::to_string((Syscall::Function)function), function);
#endif
switch (function) {
case SC_usleep:
return virt$usleep(arg1);
case SC_shbuf_create:
return virt$shbuf_create(arg1, arg2);
case SC_shbuf_allow_pid:
@ -327,6 +329,11 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
}
}
int Emulator::virt$usleep(useconds_t us)
{
return syscall(SC_usleep, us);
}
int Emulator::virt$shbuf_create(int size, FlatPtr buffer)
{
u8* host_data = nullptr;