Luna/libc/src/sys/pstat.cpp

27 lines
593 B
C++
Raw Normal View History

#include <bits/errno-return.h>
#include <sys/pstat.h>
#include <sys/syscall.h>
#include <unistd.h>
extern "C"
{
pid_t pstat(pid_t pid, struct process* ps)
{
long rc = syscall(SYS_pstat, pid, ps);
__errno_return(rc, pid_t);
}
const char* ps_state_name(int state)
{
switch (state)
{
case PS_IDLE: return "Idle";
case PS_RUNNABLE: return "Running";
case PS_SLEEPING: return "Sleeping";
case PS_WAITING: return "Waiting";
case PS_ENDED: return "Zombie";
default: return "???";
}
}
}