Luna/libs/libc/src/luna/pstat.cpp
apio 189986d23f libc: Rename pstname() to pstatname()
To avoid confusion with ptsname().
2022-10-22 14:30:41 +02:00

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";
}
}
}