Question: Write a C program, hw1_p3.c, in which a parent process creates two child processes via fork (, and the program connects the standard output of

Write a C program, hw1_p3.c, in which a parent process creates two child processes via fork (, and the program connects the standard output of the first child process to the standard input of the second child process by using the pipe 0 system call. The first child process should use the following statement to send a string to the second child process via standard output file descriptor 1 through the pipe. The second child process should get the string sent by the first child process (via the pipe) by reading from standard input (i.e., file descriptor 0), e.g., int n=read(0, buf, sizeof(buf)) Then, the second child process should display on screen its received string (from first child process via the pipe), e.g., printf("the second child process with PID \%d, receive: \%s", (int)getpid(), buf)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
