Lecture 3: Process / Shell (Part 1) Part 2 Flashcards
Every process has a __________
Process File Descriptor Table
What does an entry inside a Process File Descriptor Table represent?
Something that can be read from or written to - such as:
- file
- screen
- pipe
Where is the System File Descriptor Table maintained? (Who’s memory?)
The OS maintains this table in the OS’s memory.
Describe the System File Descriptor Table. What do the entries represent?
- Each entry represents an open file in the system (ie. every open file has at least 1 entry in the table)
- One file can have many entries in the table associated with it (if opened by many processes)
What does an entry in the System File Descriptor Table contain?
1) The file descriptor’s permissions
2) # of Links
3) The file offset which is moved by read or write
When is an entry removed from the System File Descriptor Table?
When there are 0 links pointing to it.
Wait command returns what?
- Returns PID of child process
- Returns -1 if no child process exists (already exited)
What is the command you can use at the Shell CLI to obtain a list of processes and their info?
ps -el
What does the exec function return?
-1 if it fails. Upon success, it never returns.
What is the exec family of functions used for mainly?
A child process can use it to execute some other program other than the parent / overlays a new program on the existing process.