16 lines
332 B
C++
16 lines
332 B
C++
|
#include "sys/Syscall.h"
|
||
|
#include "thread/Scheduler.h"
|
||
|
|
||
|
Result<u64> sys_alarm(Registers*, SyscallArgs args)
|
||
|
{
|
||
|
unsigned int seconds = (unsigned int)args[0];
|
||
|
|
||
|
auto* current = Scheduler::current();
|
||
|
|
||
|
u64 time_left = current->alarm_ticks_left;
|
||
|
|
||
|
current->alarm_ticks_left = seconds * 1000;
|
||
|
|
||
|
return time_left * 1000;
|
||
|
}
|