Lecture 3: Process / Shell (Part 1) Part 2 Flashcards

1
Q

Every process has a __________

A

Process File Descriptor Table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does an entry inside a Process File Descriptor Table represent?

A

Something that can be read from or written to - such as:

  • file
  • screen
  • pipe
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Where is the System File Descriptor Table maintained? (Who’s memory?)

A

The OS maintains this table in the OS’s memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe the System File Descriptor Table. What do the entries represent?

A
  • 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)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does an entry in the System File Descriptor Table contain?

A

1) The file descriptor’s permissions
2) # of Links
3) The file offset which is moved by read or write

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When is an entry removed from the System File Descriptor Table?

A

When there are 0 links pointing to it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Wait command returns what?

A
  • Returns PID of child process

- Returns -1 if no child process exists (already exited)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the command you can use at the Shell CLI to obtain a list of processes and their info?

A

ps -el

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the exec function return?

A

-1 if it fails. Upon success, it never returns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the exec family of functions used for mainly?

A

A child process can use it to execute some other program other than the parent / overlays a new program on the existing process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly