"Kirill 'Big K' Katsnelson" <kkm(a)dtmx.com> writes:
Actually, files mapped in read-only mode do not need swap space at
all.
This is how read-only portions (pure data and code) of executable files
are loaded into memory in Windows, and a reason why an executable image
file cannot be deleted or written to if it is loaded.
I don't intend to quible
but this is one of those things that
interests me (meaning I am quibling).
Under linux, it is marked as unmodifiable but can be removed (the
inode is referenced by the (sort of) fd even though there is no
directory entry). Under Solaris, the pages are marked copy-on-write
so if an executable (not a script) is modified they don't affect the
original[1].
--pete
[1] Ok, I couldn't come up with a test for the copy-on-write and I'm
only infering the behaviour.