硬盘读写缓冲设置

http://hi.baidu.com/chongxing01/blog/item/dbf1778b55f61d1ac9fc7aaa.html

11.5.1 缓冲

 http://book.51cto.com/art/200904/121083.htm

 

setvbuf 设定缓冲函数

setvbuf ( pFile , NULL , _IOFBF , 1024 ); 

if (setvbuf(input, bufr, _IOFBF, 512) != 0)

printf("failed to set up buffer for input file\n"); 

 

Buffer size in bytes. Allowable range: 2 <= size <= INT_MAX (2147483647). Internally, the value supplied for size is rounded down to the nearest multiple of 2.

 

the default BUFSIZ

 

BUFSIZ(stdio.h)----> _IO_BUFSIZ(libio.h)---->G_BUFSIZ(_G_config.h)---->8192(8K)

 

 

 

 

posted @ 2013-10-24 15:34  田涛@武汉  阅读(175)  评论(0编辑  收藏  举报