Ecila comes back through the mirror
Originally written by
- When all I/O requests came from the disk (or earlier - if all data was in
the cache), the read request copies the data to the user buffer(s).
read() will copy into a single buffer.
readv will copy into multiple buffers.
- Note: it is allowed to return only partial data!
- To simplify the code handling reads in the kernel (or the driver)
- To simplify handling of signals received in the middle of the system
- Thus: always check how many bytes were actually read, and don't assume
a premature return is an error!
- (the same is true for writes too!).