site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FQiPQieVE/u9T3MQ9moPcfnGhfZ9zzqpH9LQSN3GEc8=; b=acFr+AyO2aN0yNZj1+uXaZFHn8CvnLbL21ZAxComkwScHyn9OMjqYJawXUzX+mM/KI ufNgHkzSSvevRKuDjXRCY6vjwbNCYKfkPqiPr+P4MrZ89/srDOqzM4cQN1l6udZpQ+4O rfgywik53FGNJwj6PE/yfX2kCzJywnpGnCtvc= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=krND0QXYb+nlMMUc4icobBSu5sWUrbNZ+K/gQz53pNX7g4XH0msTlZiQJGDcej/TSQ qh/YnIQx9IkIIyMvG+DiCx7sEYhoEjvDbr78BMqhoQJIqCGYzN9AwOj/rBkIbTvi0YhG ACt+9DrC6LMLpUJZ0gLuNoLlyLDNBQCoGZR+A= I think Narayan means by move "change path" aka for the end user aka file system representation address anyway it's a lot of confusion around here Narayan you are assuming that a file descriptor depends on the path :) thanks a "FS system" is not stocked by this, you should have make some tests before asking your question (open a fd move remove on the file system representation whatever you want and trace what exactly happens, it's enough easy to do) you should start to read some stuff of Kirk (Marshall Kirk McKusick ), who spent a lot of time to write interesting stuff, your questions doesn't only fit with macos, the disease is deeper Cheers! On Wed, Jan 21, 2009 at 8:39 AM, Michael Smith <drivers@mu.org> wrote:
On Jan 21, 2009, at 1:21 AM, 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?).
No.
(I mean isn't that the only way we can move around an (on disk) executable file that being run by another process?).
What do you mean by "move around"?
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?
The same way as before.
Who caches this vnode, how and where?
Who do you think? 8)
If this vnode is still 'alive' how is one able to physically move the executable file (mapped by the process) on disk?
Again, what do you mean by "move"?
If you would like to point me to some code in the kernel for some explanation, that is welcome. I have the sources for 10.4.11 with me.
Start with everything in xnu/bsd/vfs, xnu/bsd/kern and osfmk/vm.
A couple of concepts worth considering:
- What do you mean by "move"?
- Why do you think that an open file handle is fundamentally different from an address space map entry when it comes to referring to an open file?
- Why do you (seem to) think that a file can only exist if it has a reference in the filesystem namespace?
= Mike
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/openspecies%40gmail.com
This email sent to openspecies@gmail.com
-- -mmw _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com