29 Mar
2006
29 Mar
'06
16:38
On Wed, 2006-03-29 at 11:33 -0500, Jerry Feldman wrote:
The way it works: open(2) opens a file and returns a file descriptor. The use count on that file is incremented. fork(2) replicates the file descriptors such that the parent and child now have their own, and the use count is incremented. At some point, the unlink(2) system call is called.
No, the syscall is close(), not unlink() What confused me initially was that I fooled myself into thinking parent and child shared a single fd, which got closed. Obviously this is not the case