Luna/libs/libc/src/luna/pstat.cpp

24 lines
557 B
C++
Raw Normal View History

2022-10-22 14:26:42 +02:00
#include <luna/pstat.h>
#include <luna/syscall.h>
2022-10-22 14:26:42 +02:00
#include <sys/syscall.h>
extern "C"
{
pid_t pstat(pid_t pid, struct pstat* buf)
{
return __lc_fast_syscall2(SYS_pstat, pid, buf);
2022-10-22 14:26:42 +02:00
}
const char* pstatname(struct pstat* buf)
2022-10-22 14:26:42 +02:00
{
switch (buf->pt_state)
{
case PT_IDLE: return "Idle";
case PT_RUNNING: return "Running";
case PT_SLEEPING: return "Sleeping";
case PT_WAITING: return "Waiting";
case PT_ZOMBIE: return "Zombie";
default: return "Unknown";
}
}
}