Each call to open
gives us a new file table entry. But since both opens reference the same file,
both file table entries point to the same v-node table entry. The call to dup
references the existing file table entry. We show this in Figure C.2. An
F_SETFD on fd1 affects only the file descriptor flags for fd1. But an F_SETFL
on fd1 affects the file table entry that both fd1 and fd2 point to.
Figure C.2. Result of dup and open
Figure C.2. Result of dup and open
No comments:
Post a Comment