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

Kernel+LibC+UE: Implement sleep() via sys$clock_nanosleep()

This doesn't need to be its own syscall either. :^)
This commit is contained in:
Andreas Kling 2020-08-30 13:21:24 +02:00
parent cc5403f77b
commit 57dd3b66c5
6 changed files with 4 additions and 56 deletions

View file

@ -332,7 +332,10 @@ char* getwd(char* buf)
int sleep(unsigned seconds)
{
return syscall(SC_sleep, seconds);
struct timespec ts = { seconds, 0 };
if (clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts) < 0)
return ts.tv_sec;
return 0;
}
int usleep(useconds_t usec)