#include #include #include #include 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 "???"; } } }