Week 4 - Processes and Low Level I/O Flashcards

1
Q

What library is syscall in?

A

unistd.h

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

What library is fopen in?

A

stdio.h

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

What library is fork in?

A

unistd.h

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

What library is exit in?

A

stdlib.h

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

What library is printf in?

A

stdio.h

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

What library is get_pid in?

A

unistd.h

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

What library is sleep in?

A

unistd.h

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

What library is wait in?

A

sys/wait.h

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

What is SYSNO?

A

the system call number

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

How do you make a direct syscall?

A

long int syscall( long int SYSNO, …)

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

How do you create a new child?

A

pid_t fork();

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

What number is the standard input?

A

0

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

What number is the standard output?

A

1

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

What number is the standard error?

A

2

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

How does the parent wait for the child to terminate?

A

pid_t wait(int *status);

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

How do you suspend a process?

A

unsigned in sleep( unsigned int secs);

17
Q

What are the steps to opening a file?

A
  • kernel checks you have the right
  • kernel returns the file descriptor
  • kernel keeps track of open file info
18
Q

How do you open a file?

A

FILE *fopen( char *name, char *mode);

19
Q

What does a file handler contain?

A
  • pointer to a buffer
  • number of characters left in the buffer
  • pointer to next position in the buffer
  • the file descriptor
  • various flags