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

24 lines
540 B
C++
Raw Normal View History

2022-10-22 12:26:42 +00:00
#include <luna/pstat.h>
#include <sys/syscall.h>
#include <unistd.h>
extern "C"
{
pid_t pstat(pid_t pid, struct pstat* buf)
{
return syscall(SYS_pstat, pid, buf);
}
const char* pstatname(struct pstat* buf)
2022-10-22 12:26:42 +00: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";
}
}
}