Three Descriptors One File

data.txt contains exactly the eight bytes ABCDEFGH. A single process runs:

int a = open("data.txt", O_RDONLY);
int b = open("data.txt", O_RDONLY);
int c = dup(a);

char buf[3] = {0};
read(a, buf, 2);   /* (1) */
read(b, buf, 2);   /* (2) */
read(c, buf, 2);   /* (3) */

Which bytes does each read return?

A

(1) AB, (2) CD, (3) AB

B

(1) AB, (2) AB, (3) CD

C

(1) AB, (2) CD, (3) EF

D

(1) AB, (2) AB, (3) AB