Fork Related Flashcards

1
Q

datatype to store process id

A

pid_t

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

function to create process

A

fork()

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

if q= fork() and q <0

A

error

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

if q= fork() and q =0

A

child process

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

if q= fork() and q >0

A

parent process

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

what function returns process id of corresponding process

A

getpid()

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

what function returns pid of parent process id in child process

A

getppid()

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

what function returns pid of child process id in parent process

A

q
where q = fork()

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

If you want both parent and child to do certain task where should you place your code.

A

outside any condition ( if -else loop )

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