previous | start | next

11.2

foobar.txt has 6 characters: "foobar".

    1   int main()
    2   {
    3     int fd1, fd2;
    4     char c;
    5   
    6     fd1 = open("foobar.txt", O_RDONLY, 0);
    7     fd2 = open("foobar.txt", O_RDONLY, 0);
    8     read(fd1, &c, 1);
    9     read(fd2, &c, 1);
   10     printf("c = %c\n", c);
   11     exit(0);
   12   }


previous | start | next