Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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 endStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started