Question: Need The following on UBUNTU ... Simulate suitable command/commands in gedit editor where a child is created to execute a command using fork() and exit()
Need The following on UBUNTU ...



Simulate suitable command/commands in gedit editor where a child is created to execute a command using fork() and exit() system calls. Simulate suitable command/commands in gedit editor where a child created to execute a command using wait() and exit() system calls. Simulate suitable command/commands in gedit to write equivalent code in C / C++ by following the algorithms given ALGORITHM 1: STEP 1: Start the program. STEP 2: Declare fork result as integer. STEP 3: get process id through function, print parent process with process number. STEP 4: get process id through function, print process during forking with process number. STEP 5: fork the process and save it in forkresult. STEP 6: Check forkresult is not equal to 0 then get and print child process id through function with fork result, else get and print child process id through function. STEP 7: get process id through function, print parent process with process number. STEP 8: Stop the program. ALGORITHM 2: STEP 1: Start the program. STEP 2: Declare pid as integer. STEP 3: Print "hello world. STEP 4: get process id through function, print parent process" with process number. STEP 5: Print statement before forking. STEP 6: Fork the process and store it in pid. STEP 7: Print statement "after forking". STEP 8: Check pid is equal to 0 then get and print "child process" with id through function, else get and print "parent process with id through function. STEP 9: Stop the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
