Question: Problem 1 Write a C program in Linux that creates one child process, your program should do the following: Part 1: -The parent process creates

 Problem 1 Write a C program in Linux that creates one

Problem 1 Write a C program in Linux that creates one child process, your program should do the following: Part 1: -The parent process creates a child process and the child process will output the time of the day and its own PID every second. -The parent process waits for 5 seconds. -The parent process will kill the child process after 5 seconds and prints Child killed.. Then the parent terminates. Part II: -The parent process creates 4 child processes and each child process will output the time of the day and its own PID every second. -The parent process waits for 5 seconds. -The parent process will kill the child processes after 5 seconds and prints Child killed.. Then the parent terminates. You may need to use sleep(), gettimeofday(), kill() and fork() system calls

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!