Next | What's a file? | 10 |
char buf[20]; int br = read(3, buf, 20);
Then the kernel does something real interesting to figure out which disk block to read
It reads the block
It extracts the right number of bytes ( number_read ) from the block
It sticks the bytes into buf
It advances the offset in the file pointer by number_read
It arranges that number_read will be returned into br
Writing is exactly the same, only backwards
Next | Copyright © 2007 M. J. Dominus |