Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

Students also viewed these Databases questions

Question

LO3 Define job design and identify common approaches to job design.

Answered: 1 week ago