If 2 file descriptors were dupped to the same file (i.e. 506 and STDOUT), will invoking close(506) cleanup the object associated by both and render STDOUT unusable? Or does kernel implement reference counting for its files?
If 2 file descriptors were dupped to the same file (i.e. 506 and STDOUT
Share
The kernel implements reference counting, so the kernel object is not closed until all the file handles pointing to it are closed.