2022-10-22 14:26:42 +02:00
|
|
|
#include <luna/pstat.h>
|
2022-10-27 17:42:00 +02:00
|
|
|
#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)
|
|
|
|
{
|
2022-10-27 17:42:00 +02:00
|
|
|
return __lc_fast_syscall2(SYS_pstat, pid, buf);
|
2022-10-22 14:26:42 +02:00
|
|
|
}
|
|
|
|
|
2022-10-22 14:30:41 +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";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|