Skip to main content
deleted 174 characters in body
Source Link
user68207
user68207

When you fork a process, the child inherits its parent's file descriptors. I understand that when this happens, the child receives a copy of the parent's file descriptor table with the pointers in each pointing to the same open file description. Is this the same thing as a file table, as in http://en.wikipedia.org/wiki/File_descriptor, or something else?

Note, however, that what is actually passed is a reference to an "open file description" that has mutable state (the file offset, and the file status and access flags).

When you fork a process, the child inherits its parent's file descriptors. I understand that when this happens, the child receives a copy of the parent's file descriptor table with the pointers in each pointing to the same open file description. Is this the same thing as a file table, as in http://en.wikipedia.org/wiki/File_descriptor, or something else?

Note, however, that what is actually passed is a reference to an "open file description" that has mutable state (the file offset, and the file status and access flags).

When you fork a process, the child inherits its parent's file descriptors. I understand that when this happens, the child receives a copy of the parent's file descriptor table with the pointers in each pointing to the same open file description. Is this the same thing as a file table, as in http://en.wikipedia.org/wiki/File_descriptor, or something else?

Source Link
user68207
user68207

What is an open file description?

When you fork a process, the child inherits its parent's file descriptors. I understand that when this happens, the child receives a copy of the parent's file descriptor table with the pointers in each pointing to the same open file description. Is this the same thing as a file table, as in http://en.wikipedia.org/wiki/File_descriptor, or something else?

Note, however, that what is actually passed is a reference to an "open file description" that has mutable state (the file offset, and the file status and access flags).