Question: Write a C program with a focus on system calls. So only use read() and write() for obtaining input and creating output - do not

Write a C program with a focus on system calls. So only use read() and write() for obtaining input and creating output - do not use printf or fopen. Use open() and close() and other system call functions where necessary.

The programs should take input from STDIN continually until termination with a Control-D.

Write a program called parent that creates 2 child processes that will each execute another program. That other program will simply capture STDIN and send it to STDOUT or to a text file.

- The parent program, parent, should read characters from STDIN and send them to the children using pipes. - The first child process should send the characters to a text file (this child would simply think it's getting a STDIN). - The second child process should just send the characters to STDOUT for display.

hint: parent will loop for user input of STDIN.

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!