mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
Add a "sleep" syscall that sleeps for N seconds.
This commit is contained in:
parent
c6f2890d8e
commit
5978185242
11 changed files with 37 additions and 12 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <ELFLoader/ExecSpace.h>
|
||||
#include "MemoryManager.h"
|
||||
#include "errno.h"
|
||||
#include "i8253.h"
|
||||
|
||||
//#define DEBUG_IO
|
||||
//#define TASK_DEBUG
|
||||
|
@ -719,6 +720,14 @@ int Task::sys$kill(pid_t pid, int sig)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int Task::sys$sleep(unsigned seconds)
|
||||
{
|
||||
if (!seconds)
|
||||
return 0;
|
||||
sleep(seconds * TICKS_PER_SECOND);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uid_t Task::sys$getuid()
|
||||
{
|
||||
return m_uid;
|
||||
|
@ -773,12 +782,6 @@ void sleep(DWORD ticks)
|
|||
yield();
|
||||
}
|
||||
|
||||
void Task::sys$sleep(DWORD ticks)
|
||||
{
|
||||
ASSERT(this == current);
|
||||
sleep(ticks);
|
||||
}
|
||||
|
||||
Task* Task::kernelTask()
|
||||
{
|
||||
ASSERT(s_kernelTask);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue