Next | What's a file? | 14 |
int fd = open("blookus", O_RDONLY);
So the kernel has the directory open already
It scans through the directory looking for blookus
... MAKE_SLIDES 802886 blookus 142857 Makefile 802887 ...
If it doesn't find it, the result is EEXIST
Otherwise, it has the inode for blookus
It checks the permissions in the inode
If no good, the result is EACCESS
Otherwise, it saves the inode
Makes a new entry in the file pointer table with offset 0
Makes a new entry in the open file table
It uses the first free slot, say #37
Then the open call returns the value 37
Next | Copyright © 2007 M. J. Dominus |