Buffered I/O
The system calls we have discussed here are generally called “unbuffered I/O.” There is a little bit of buffering that happens in the kernel, probably no more than a couple of disk blocks, so that a physical I/O is not performed for every byte read or written. But for the most part, what you read and write is what you get in terms of physical I/O. If you want to read in large chunks of data and process the data out of that buffer, you will have to do the work yourself: refilling the buffer when it gets low, remembering your place in the buffer, handling reading and writing, and so on. Not hard work, just tedious.
The Standard C I/O functions are known as “buffered I/O.” The library handles the details of buffer allocation I/O in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access