Write a C program that fulfills the following.
1) Write a C
a) The program when executed, has both a parent process and a child process. You use the fork() system call to create a child process.
b) The parent process code branch utilizes the producer
c) The Parent Producer and Child Consumer Algorithms are to be implemented using the POSIX Shared Memory API as given in the lectures for Chapter 3 POSIX Shared Memory API.
d) The Parent Process produces the file contents into shared memory as read from a source file (SRC_FILE) in chunks using read(). The chunk size (CHUNK_SIZE) is the same for both read() and write(). It will be accepted as input by your program as a command-line argument. Afterward, the parent and child process must be terminated when the source file is copied to the target file.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images