Compare commits
2 Commits
17671fd435
...
09a615bd99
Author | SHA1 | Date | |
---|---|---|---|
09a615bd99 | |||
acdc2d3ad7 |
@ -17,8 +17,8 @@ pid_t get_current_max_threads()
|
|||||||
|
|
||||||
void display_process(struct pstat* pstatbuf)
|
void display_process(struct pstat* pstatbuf)
|
||||||
{
|
{
|
||||||
printf("%ld %ld %s %s (%ld ms)\n", pstatbuf->pt_pid, pstatbuf->pt_ppid, pstatbuf->pt_name, pstatname(pstatbuf),
|
printf("%d %d %ld %ld %s %s (%ld ms)\n", pstatbuf->pt_uid, pstatbuf->pt_gid, pstatbuf->pt_pid, pstatbuf->pt_ppid,
|
||||||
pstatbuf->pt_time);
|
pstatbuf->pt_name, pstatname(pstatbuf), pstatbuf->pt_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
int try_pstat(pid_t pid, struct pstat* pstatbuf)
|
int try_pstat(pid_t pid, struct pstat* pstatbuf)
|
||||||
|
@ -615,6 +615,8 @@ struct pstat
|
|||||||
char pt_name[128];
|
char pt_name[128];
|
||||||
int pt_state;
|
int pt_state;
|
||||||
long pt_time;
|
long pt_time;
|
||||||
|
uid_t pt_uid;
|
||||||
|
gid_t pt_gid;
|
||||||
};
|
};
|
||||||
|
|
||||||
void sys_pstat(Context* context, long pid, struct pstat* buf)
|
void sys_pstat(Context* context, long pid, struct pstat* buf)
|
||||||
@ -647,6 +649,8 @@ void sys_pstat(Context* context, long pid, struct pstat* buf)
|
|||||||
kpstat->pt_ppid = task->ppid;
|
kpstat->pt_ppid = task->ppid;
|
||||||
kpstat->pt_state = (int)task->state;
|
kpstat->pt_state = (int)task->state;
|
||||||
kpstat->pt_time = (long)task->cpu_time;
|
kpstat->pt_time = (long)task->cpu_time;
|
||||||
|
kpstat->pt_uid = task->uid;
|
||||||
|
kpstat->pt_gid = task->gid;
|
||||||
strlcpy(kpstat->pt_name, task->name, sizeof(kpstat->pt_name));
|
strlcpy(kpstat->pt_name, task->name, sizeof(kpstat->pt_name));
|
||||||
release_user_ref(kpstat);
|
release_user_ref(kpstat);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ struct pstat
|
|||||||
char pt_name[128];
|
char pt_name[128];
|
||||||
int pt_state;
|
int pt_state;
|
||||||
long pt_time;
|
long pt_time;
|
||||||
|
uid_t pt_uid;
|
||||||
|
gid_t pt_gid;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PT_IDLE 0
|
#define PT_IDLE 0
|
||||||
|
@ -57,8 +57,8 @@ extern char* program_invocation_name;
|
|||||||
extern "C" void initialize_libc(int, char** argv)
|
extern "C" void initialize_libc(int, char** argv)
|
||||||
{
|
{
|
||||||
check_for_file(STDIN_FILENO, &stdin, "/dev/kbd", "r");
|
check_for_file(STDIN_FILENO, &stdin, "/dev/kbd", "r");
|
||||||
check_for_file(STDOUT_FILENO, &stdout, "/dev/console", "w");
|
check_for_file(STDOUT_FILENO, &stdout, "/dev/console", "a");
|
||||||
check_for_file(STDERR_FILENO, &stderr, "/dev/console", "w");
|
check_for_file(STDERR_FILENO, &stderr, "/dev/console", "a");
|
||||||
|
|
||||||
if (argv) program_invocation_name = argv[0];
|
if (argv) program_invocation_name = argv[0];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user