fflush(), sync()
int fflush(FILE *stream);void sync(void); cache/buffer를 비우는 역할 layer: disk IO(1) - system call(2) - stdio(3) fflush() - library call- stdio 라이브러리에서 IO를 처리할 때 user level에서 사용하는 버퍼를 비우는 역할 (2,3 사이 버퍼를 비움)- 사용자 영역(user level)의 버퍼(라이브러리 수준에서 제공되는)를 커널의 버퍼로 이동시키는 역할을 한다.sync()- system call- 시스템(kernel)에서 disk를 사용할 때 kernel level에서 사용하는 버퍼(buffer cache)를 비우는 역할 (1,2 사이 버퍼를 비움)- 사용자 라이브러리 함수(fprintf, f..
Programming/C
2015. 5. 4. 00:14