Problem 6-VO (15) Assume we have a file "foo.txt" that contains the six ASCIl characters abcdef and an empty file bar.txt include "csapp.h" int main ( pid t pid; char c: int fdl -Open ("foo.txt",RDONLY, 0) Read (Edl,&c, 1) int fd2 -Open ("bar.txt",O_WRONLY,0) printf("fdl - ed, fd2 - ed, c- %e ", fd1, fd2, c); if (pid-fork0) Read (fd1, c, 1); Dup2 (4, 1) printf ("fdi - td, fd2 - ed, c- %c ", fd1, fd2, c); exit(0) else ( Waitpid (pid, NULL, 0) Read (fdl, &c, 1): printf("fdi -ed, fd2 = ed, c-teln", fd1 , fd2 , c); (5 points) Draw the descriptor, open-file, and v-node tables for both parent/child processes just after the dup2(4, 1) line. You may assume the program started with just 0/1/2 file descriptors in the descriptor table for the process for stdin/stdout/stderr. 5 points) What would the contents of "bar.txt" be after this program executes? 5 points) What would be printed out to standard output after this program executes? 1.0 Problem 6-VO (15) Assume we have a file "foo.txt" that contains the six ASCIl characters abcdef and an empty file bar.txt include "csapp.h" int main ( pid t pid; char c: int fdl -Open ("foo.txt",RDONLY, 0) Read (Edl,&c, 1) int fd2 -Open ("bar.txt",O_WRONLY,0) printf("fdl - ed, fd2 - ed, c- %e ", fd1, fd2, c); if (pid-fork0) Read (fd1, c, 1); Dup2 (4, 1) printf ("fdi - td, fd2 - ed, c- %c ", fd1, fd2, c); exit(0) else ( Waitpid (pid, NULL, 0) Read (fdl, &c, 1): printf("fdi -ed, fd2 = ed, c-teln", fd1 , fd2 , c); (5 points) Draw the descriptor, open-file, and v-node tables for both parent/child processes just after the dup2(4, 1) line. You may assume the program started with just 0/1/2 file descriptors in the descriptor table for the process for stdin/stdout/stderr. 5 points) What would the contents of "bar.txt" be after this program executes? 5 points) What would be printed out to standard output after this program executes? 1.0