mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
Add gettimeofday() syscall and LibC wrappers gettimeofday() and time().
This only has second accuracy right now, I'll work out subseconds later.
This commit is contained in:
parent
5978185242
commit
dc6f57f19c
20 changed files with 188 additions and 8 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "MemoryManager.h"
|
||||
#include "errno.h"
|
||||
#include "i8253.h"
|
||||
#include "RTC.h"
|
||||
|
||||
//#define DEBUG_IO
|
||||
//#define TASK_DEBUG
|
||||
|
@ -728,6 +729,15 @@ int Task::sys$sleep(unsigned seconds)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int Task::sys$gettimeofday(timeval* tv)
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
auto now = RTC::now();
|
||||
tv->tv_sec = now;
|
||||
tv->tv_usec = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uid_t Task::sys$getuid()
|
||||
{
|
||||
return m_uid;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue