Question: C with Linux. Help with fork() and wait() system calls. Goals The purpose of this lab is to help you learn about fork0 and wait()

C with Linux. Help with fork() and wait() system calls.

C with Linux. Help with fork() and wait() system calls. Goals The

purpose of this lab is to help you learn about fork0 and

Goals The purpose of this lab is to help you learn about fork0 and wait() system calls in C. Tasks Task 1 1. define a function to carry out the task corresponds to a child process within the operating system as: (a) this function should use a system call to get its corresponding process identification. (b) this function should print the obtained process ID on the console. (c) this function prints either 'a' or 'b'. Whether it should print 'a' or 'b' should be determined by one of the arguments of this function. (d) this function should at the end use a library call that cause normal process termination. 2. the main function create two separate child processes as: (a) the main function should call a system call twice to create two separate child processes (b) by using if statements, the main function should call the function that was defined for the child processes by given this function appropriate inputs. This function should be called twice for each of the child processes. (c) by using a system call, this function should wait for both of its child processes to terminate. (d) print an end of line character at the end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!