43 lines
863 B
C
43 lines
863 B
C
#include "src/filter.h"
|
|
#include "src/server.h"
|
|
#include "src/ProcessInfo.h"
|
|
#include "src/SystemInfo.h"
|
|
#include <stdio.h>
|
|
#include <sys/unistd.h>
|
|
#include <pthread.h>
|
|
|
|
#define DEBUG
|
|
|
|
int main() {
|
|
int rc;
|
|
pthread_t unix_domain_server;
|
|
|
|
freeProcInfoList();
|
|
|
|
//init
|
|
//get /data/data/dir
|
|
//get whitelist
|
|
//init Proc_List
|
|
//init Global_Info
|
|
int i = 0;
|
|
|
|
while (1) {
|
|
i++;
|
|
printf("\nloop:%d\n", i);
|
|
usleep(60000000 / UPDATE_FREQUENCY * 0.98);
|
|
//monitor Global_Info and decicde to kill some process
|
|
updateSystemInfo();
|
|
//monitor Proc_List
|
|
updateProcList();
|
|
}
|
|
|
|
//server
|
|
// rc = pthread_create(&unix_domain_server, NULL, (void *)&server, NULL);
|
|
// if (rc != 0) {
|
|
// perror("unix_domain_server thread fail");
|
|
// }
|
|
|
|
sleep(100);
|
|
return 0;
|
|
}
|