mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 17:27:34 +00:00
Kernel+LibC+UE: Implement usleep() via sys$clock_nanosleep()
This doesn't need to be its own syscall. Thanks @BenWiederhake for the idea. :^)
This commit is contained in:
parent
95ed363b15
commit
f857f3ce4c
5 changed files with 4 additions and 22 deletions
|
@ -29,17 +29,6 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
int Process::sys$usleep(useconds_t usec)
|
||||
{
|
||||
REQUIRE_PROMISE(stdio);
|
||||
if (!usec)
|
||||
return 0;
|
||||
u64 wakeup_time = Thread::current()->sleep(usec * TimeManagement::the().ticks_per_second() / 1000000);
|
||||
if (wakeup_time > g_uptime)
|
||||
return -EINTR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Process::sys$sleep(unsigned seconds)
|
||||
{
|
||||
REQUIRE_PROMISE(stdio);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue