Unix IPC Question:

Please Explain fork() system call?

Tweet Share WhatsApp

Answer:

fork is a system call used for creating child processes of a
parent process.it returns the process id of the created
child process.after that pid(process id ) is checked if it
is negative,it means no child process is created,pid==0
implies the id of the newly created process and pid>0 is the
id of child process given to the parent process.the
statements following fork system call are executed by both
the parent and child process.and one more thing,the parent
and child process have the exact copy of address space but
it exist separately for the two processes.

Download Unix Inter-Process Communication (IPC) PDF Read All 26 Unix Inter-Process Communication (IPC) Questions
Previous QuestionNext Question
Predict the output of the following program code
main()
{
fork();
printf("Hello World!");
}
What are various IDs associated with a process?