Ecila comes back through the mirror
- 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).
- A
read()
will copy into a single buffer.
- A
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
call.
- 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!).
Originally written by
guy keren