The following program demonstrates how fork duplicates the parent's file descriptor table in the child, such that the same descriptor in the parent and child reference the same open file description, and thus attributes such as the file offset for reads and writes.