Question: Please compile the program using Cygwin. Understanding Unix System Calls fork(), getpid(), getppid(), wait() First lookup the manual pages for the above Unix system calls.
Please compile the program using Cygwin.
Understanding Unix System Calls fork(), getpid(), getppid(), wait() First lookup the manual pages for the above Unix system calls. Write a C++ program which performs the following: 1) u Creates a new child process using the fork() system call. If the fork() fails you should display an error. If child process is successfully created, it should: a. Identify itself by displaying its child process-id (e.g., I am a child process and my is ID = XXXX) b. It then proceeds and calls the function named generateOddNumbers(int upperBound) which generates odd numbers from 1 to upperBound. The child then indicates that it is finished and about to exit, then dedicates her work to her parent's process by thanking the parent. (e.g. I wish to dedicate my work to my parent, ID = YYYY) The parent process should a. First Introduce itself and provide its ID = YYYY, b. Then explain what the child is going to do Then lovingly wait for the child to complete its work Finally praise the child process by displaying the message "good child!" e. Of course, by now the child is no longer living. Sad! So, it would be fitting for the parent to acknowledge the child by invoking the child's process id. 2) ovo
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
