Question: Assume that the program listed here after has been complied to run on a GNU/Linux system. Analyze attached program prg.txt and trace its execution to

 Assume that the program listed here after has been complied to

Assume that the program listed here after has been complied to run on a GNU/Linux system. Analyze attached program "prg.txt" and trace its execution to answer the following questions. #define RDO #define WR 1 int main() { int pid, pild[2], p2fd[2], n, j= 0; char buf[81); if (pipe (plfd) 0) i++; if (write(p2id[WR], &j sizeof(int))! sizeof(int)) (perror("write error"); exit(1):) close(plfd(RDD); close(p2d[WRD); exit(0); close(pld(RD)); close(pild[WR]); close(p2d[WR]); while (read (p2fd[RD], &j, sizeof(int)) > 0) printf("tot%d ,1); wait(&n); watan); close (p21d[RD]); return 0; Given that the object program is run from a terminal windows ad the user has entered the strings "abc", "xy", "x2" each terminated by an enter" character, then finished the processing by entering the end-of-file (ctrl+d) character. Write all the input and output messages generated during the execution of this program. Assume that the program listed here after has been complied to run on a GNU/Linux system. Analyze attached program "prg.txt" and trace its execution to answer the following questions. #define RDO #define WR 1 int main() { int pid, pild[2], p2fd[2], n, j= 0; char buf[81); if (pipe (plfd) 0) i++; if (write(p2id[WR], &j sizeof(int))! sizeof(int)) (perror("write error"); exit(1):) close(plfd(RDD); close(p2d[WRD); exit(0); close(pld(RD)); close(pild[WR]); close(p2d[WR]); while (read (p2fd[RD], &j, sizeof(int)) > 0) printf("tot%d ,1); wait(&n); watan); close (p21d[RD]); return 0; Given that the object program is run from a terminal windows ad the user has entered the strings "abc", "xy", "x2" each terminated by an enter" character, then finished the processing by entering the end-of-file (ctrl+d) character. Write all the input and output messages generated during the execution of this program

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!