CS604 Operating Systems Assignment 1 Solution 2017

Problem Statement:

You are required to write a simple C language program to:

  1. Create a process using fork call
  2. Get and print status information of the running processes
  3. Use pipe call for inter-process communication between processes
  4. Terminate process
  5. Compile & run C program on Linux Operating system.

Detailed Description:

In the main() function, first of all you will establish a channel for processes to communicate through pipe system call. After successful creation of pipe, you will create child process through fork() system call.

In the child process, you will have to display your own student Id through the pipe or channel established between processes. In the parent process, you will have to display your own student name through the pipe or channel established between processes.

You will also print the status information of Parent and Child process by using user-defined function printInfo(). The status information includes Process Id and Parent Id in case of Child process and Process ID and Child Id in case of Parent process.

Compilation & Execution of Program:

You will compile your file with your student ID. For example, if your student ID is BC123456789 then you will compile the code according to following screenshot.

DOWNLOAD SOLUTION HERE
loading...