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:
parent
cc5403f77b
commit
57dd3b66c5
6 changed files with 4 additions and 56 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue