23.12.03 최초 작성
/system/system_server.c
: 일정 시간 간격마다 현재 작업 공간의 용량 출력void *disk_service_thread(){
printf("Disk service thread started!\n");
FILE* apipe;
char buf[1024];
char cmd[]="df -h ./";
while(1){
posix_sleep_ms(60, 0);
apipe = popen(cmd, "r");
if (apipe == NULL) {
perror("popen");
exit(0);
}
while (fgets(buf, 1024, apipe) != NULL) {
printf("%s", buf);
}
pclose(apipe);
posix_sleep_ms(10, 0);
}
}