Luna/kernel/src/sys/exit.cpp

15 lines
279 B
C++
Raw Normal View History

#include "sys/Syscall.h"
#include "thread/Scheduler.h"
Result<u64> sys_exit(Registers*, SyscallArgs args)
{
u8 status = (u8)args[0];
Thread* current = Scheduler::current();
current->status = status;
current->state = ThreadState::Exited;
kernel_yield();
}