Browse Source

test mytop

master
10195501441 3 years ago
parent
commit
bf8b8a79ec
1 changed files with 8 additions and 13 deletions
  1. +8
    -13
      yeeshell.c

+ 8
- 13
yeeshell.c View File

@ -400,22 +400,17 @@ int builtin_history(char **args)
int builtin_mytop() int builtin_mytop()
{ {
pid_t pid; pid_t pid;
int cputimemode = 1;
if ((pid = fork()) < 0)
{
printf("fork error\n");
return -1;
}
getkinfo();
mytop_memory();
get_procs();
if (prev_proc == NULL)
if (pid == 0)
{ {
int cputimemode = 1;
getkinfo();
mytop_memory();
get_procs(); get_procs();
if (prev_proc == NULL)
get_procs();
print_procs(prev_proc, proc, cputimemode);
exit(1);
} }
print_procs(prev_proc, proc, cputimemode);
exit(0);
} }
void mytop_memory() void mytop_memory()

Loading…
Cancel
Save