Unit 3
In "The Design of the Unix Operating System" book-
SYSTEM CALLS FOR THE FILE SYSTEM - Chap 5 in text book - Pg 105- Pg 159
** File System Calls and Algorithms- Figure 5.1 - Pg 106
- Open- Pg 106- Pg 110
- Read- Pg 110- Pg 115
- Write- Pg 115- Pg 117
- File and Record Locking- Pg 117
- Adjusting the Position of File I/O- lseek- Pg 117
- Close- Pg 117 - Pg 119
- File Creation- Pg 119 - Pg 121
- Creation of Special Files- Pg 121 - Pg 123
- Changing Directory and Change Root- Pg 123 - Pg 124
- Change Owner and Change Mode- Pg 124
- stat and fstat- Pg 124 - Pg 125
- Pipes- Pg 125 - Pg 131
(Sub topics: The Pipe System Call- Pg 126, Opening a Named Pipe- 127, Reading and
Writing Pipes- 127, Closing Pipes- 129, Examples- 130)
- dup- Pg 131 - Pg 133
- Mounting And Unmounting File Systems- Pg 133 - Pg 142
(Sub topics: Crossing Mount Points in File Path Name- Pg 136, Unmounting a File
System- Pg 140)
- link- Pg 142 - Pg 146
- unlink- Pg 146 - Pg 151
(Sub topics: File System Consistency- Pg 147, Race Conditions- Pg 149)
- EXERCISES- Pg 154- 159
--
Solve below from syllabus- (if required)
o How does the command mkdir work? (Hint: When mkdir completes, what are the inode
numbers for “.” and “..”?)
o Simulate the function of chown, chmod, stat and fstat
o Set the whole-file lock with fcntl() and lockf()
o Write a program to print the mount table whenever an external device is connected
to the Unix system.