when the fork system call is executed, a new process is created. The original process is called the parent process whereas the new process is called the child process. The new process consists of a copy of the address space of the parent. On success, both processes continue execution at the instruction after the fork call, with one difference, the return code for the fork system call is zero for the child process, while the process identifier of the child is returned to the parent process. On failure, a -1 will be returned in the parent's context, no child process will be created, and an error number will be set appropriately.
Keeping the above stated working of the fork system call, you have to write a program in C language using Linux environment. This program should produce the following results:
• Display the Process ID of the Parent and Child processes using getppid() and getpid() system calls respectively.
• You have to prove that on successful fork ( ) execution, the process identifier of the Child process is returned to the Parent process as stated in the above mentioned working of the fork system call.
• Prove that the Process ID of the Parent process do not change after fork system call execution.
Keeping the above stated working of the fork system call, you have to write a program in C language using Linux environment. This program should produce the following results:
• Display the Process ID of the Parent and Child processes using getppid() and getpid() system calls respectively.
• You have to prove that on successful fork ( ) execution, the process identifier of the Child process is returned to the Parent process as stated in the above mentioned working of the fork system call.
• Prove that the Process ID of the Parent process do not change after fork system call execution.
Comment