|
@ -1,4 +1,4 @@ |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
#include <stdio.h> |
|
|
#include <stdio.h> |
|
|
#include <unistd.h> |
|
|
#include <unistd.h> |
|
|
#include <pwd.h> |
|
|
#include <pwd.h> |
|
@ -116,7 +116,7 @@ void parse_file(pid_t pid) |
|
|
p->p_endpoint = endpt; |
|
|
p->p_endpoint = endpt; |
|
|
p->p_pid = pid; |
|
|
p->p_pid = pid; |
|
|
//读入名字 状态 阻塞状态 动态优先级 进程时间 高周期 低周期 |
|
|
//读入名字 状态 阻塞状态 动态优先级 进程时间 高周期 低周期 |
|
|
if (fscanf(fp, " %255s %c %d %d %lu %*u %lu %lu", |
|
|
|
|
|
|
|
|
if (fscanf(fp, " %255s %c %d %d %ld %*u %lu %lu", |
|
|
name, &state, &p->p_blocked, &p->p_priority, |
|
|
name, &state, &p->p_blocked, &p->p_priority, |
|
|
&p->p_user_time, &cycles_hi, &cycles_lo) != 7) { |
|
|
&p->p_user_time, &cycles_hi, &cycles_lo) != 7) { |
|
|
|
|
|
|
|
@ -335,3 +335,6 @@ void mytop() |
|
|
print_procs(prev_proc,proc,1); |
|
|
print_procs(prev_proc,proc,1); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
*/ |
|
|
|
|
|
void mytop() |
|
|
|
|
|
{} |