Re: Question regarding vnodes and memory mapped files
Re: Question regarding vnodes and memory mapped files
- Subject: Re: Question regarding vnodes and memory mapped files
- From: Quinn <email@hidden>
- Date: Wed, 21 Jan 2009 09:52:50 +0000
At 14:51 +0530 21/1/09, Narayan Subramanian wrote:
My question here is: Do we not call close() on the executable files
descriptor after we mmap() them into the process address space
(inside dyld)? I am assuming that the vnode corresponding to the
file descriptor should get freed after the file descriptor gets
closed (right?). (I mean isn't that the only way we can move around
an (on disk) executable file that being run by another process?). If
that is true, how is it that we are still able to trace the vnode
that represents the file that was mmap()ed, after its descriptor was
close()d? Who caches this vnode, how and where? If this vnode is
still 'alive' how is one able to physically move the executable file
(mapped by the process) on disk?
The file descriptor may or may not have been closed; that's
irrelevant because the vnode pager is holding a reference to the
vnode. The fact that the vnode has active references does not
prevent you from moving the image within the volume or, for that
matter, deleting the image off the volume. The vnode pager goes
through VFS, and the VFS plug-ins are expected to deal with this sort
of thing.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden