Reputation: 23
I know the __flbf
function can tell me if a stream is line buffered or not in Linux, but how to determine if a stream is full buffered or not?
Upvotes: 2
Views: 141
Reputation: 409442
Can't you use a combination of __flbf
and __fbufsize
to see if the file is unbuffered, line buffered or block buffered?
Like
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");
Upvotes: 1