24 lines
540 B
C++
24 lines
540 B
C++
#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)
|
|
{
|
|
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";
|
|
}
|
|
}
|
|
} |