2 File Descriptors. Use the following code snippet to answer the following questions:
//Assume the STDIN contains Anteaters
3 char* buf = calloc(18, sizeof(char)); //Remember that calloc initializes all bytes to 0
3 int x = open("1.txt", O_RDONLY); //Assume 1.txt contains ics53@!
int y = open("2.txt", O_RDONLY); //Assume 2.txt contains peter
int z = open("1.txt", O_RDONLY); //Assume 1.txt contains ics53@!
8 dup2(y, 0);
9 read(0, buf, 2);
10 read(y, buf+2, 2);
11 //Answer first question
12 dup2(x, y);
13 read(y, buf+4, 4);
14 // Answer second question
15 read(x, buf+8, 8);
16 dup2(x, z);
17 read(z, buf+16, 2),
[2 pts] How many characters have been read from the standard input buffer at line 11?
[2 pts] At line 14, what is the file offset (cursor position) of file descriptor y? (Answer with the specific character in the file which would be read next)
[1 pt] At the end of execution, which file (1.txt or 2.txt) is stored in the file descriptor table entry for y?
[4 pts] At the end of execution, what is stored in buf? (Select 1)
(Apeteics53!