test_mblock ok
parent
0fc9297155
commit
bb57593f14
|
|
@ -436,7 +436,7 @@ int get_processes(struct fast_process_info **processes, int *count)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i < len)
|
if (i < len) //not digital string
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ extern "C" {
|
||||||
|
|
||||||
#ifdef OS_LINUX
|
#ifdef OS_LINUX
|
||||||
typedef struct fast_process_info {
|
typedef struct fast_process_info {
|
||||||
int field_count;
|
int field_count; //field count in /proc/$pid/stat
|
||||||
int pid;
|
int pid;
|
||||||
char comm[128];
|
char comm[128];
|
||||||
char state;
|
char state;
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ int main(int argc, char *argv[])
|
||||||
stats[i].f_ffree);
|
stats[i].f_ffree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OS_LINUX
|
||||||
{
|
{
|
||||||
FastProcessInfo *processes;
|
FastProcessInfo *processes;
|
||||||
get_processes(&processes, &count);
|
get_processes(&processes, &count);
|
||||||
|
|
@ -93,7 +94,12 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
printf("%d %d %c %s\n", processes[i].field_count, processes[i].pid, processes[i].state, processes[i].comm);
|
printf("%d %d %c %s\n", processes[i].field_count, processes[i].pid, processes[i].state, processes[i].comm);
|
||||||
}
|
}
|
||||||
|
if (processes != NULL)
|
||||||
|
{
|
||||||
|
free(processes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//iniPrintItems(&iniContext);
|
//iniPrintItems(&iniContext);
|
||||||
iniFreeContext(&iniContext);
|
iniFreeContext(&iniContext);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue