Luna/kernel/src/sys/usleep.cpp
apio 7f8a8cdcaf
All checks were successful
continuous-integration/drone/push Build is passing
kernel, libc: Add an usleep() system call and use that to implement usleep() and sleep() in libc
2023-01-22 15:00:20 +01:00

13 lines
222 B
C++

#include "sys/Syscall.h"
#include "thread/Scheduler.h"
#include <sys/types.h>
Result<u64> sys_usleep(Registers*, SyscallArgs args)
{
useconds_t us = (useconds_t)args[0];
kernel_sleep(us / 1000);
return 0;
}