That function is meant more for user programs, and should still be rarely used, since it's not portable. Instead, we already know the number of arguments. We just call __lc_fast_syscallN, which also sets errno.
24 lines
557 B
C++
24 lines
557 B
C++
#include <luna/pstat.h>
|
|
#include <luna/syscall.h>
|
|
#include <sys/syscall.h>
|
|
|
|
extern "C"
|
|
{
|
|
pid_t pstat(pid_t pid, struct pstat* buf)
|
|
{
|
|
return __lc_fast_syscall2(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";
|
|
}
|
|
}
|
|
} |