Fork Related Flashcards
1
Q
datatype to store process id
A
pid_t
2
Q
function to create process
A
fork()
3
Q
if q= fork() and q <0
A
error
4
Q
if q= fork() and q =0
A
child process
5
Q
if q= fork() and q >0
A
parent process
6
Q
what function returns process id of corresponding process
A
getpid()
7
Q
what function returns pid of parent process id in child process
A
getppid()
8
Q
what function returns pid of child process id in parent process
A
q
where q = fork()
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 )