Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道该__flbf函数可以告诉我在 Linux 中流是否是行缓冲的,但是如何确定流是否已完全缓冲?
__flbf
您不能使用__flbf和的组合__fbufsize来查看文件是无缓冲的、行缓冲的还是块缓冲的?
__fbufsize
喜欢
if (__flbf(some_file)) printf("File is line buffered\n"); else if (__fbufsize(some_file) == 0) printf("File is unbuffered\n"); else printf("File is block (aka fully) buffered\n");