Demand paged executables

Guy Harris guy at auspex.UUCP
Sat Feb 4 06:30:38 AEST 1989


 >Consider what might happen if an a.out with shared text is started
 >(process A).
 >Next the actual file is allowed to be removed.
 >Later an executable is created and happens to land at the same inode that the
 >previous a.out used.

Shouldn't happen on any reasonable implementation.  The on-disk inode in
question should *not* freed until the last *active* reference to it goes
away, and shared texts using that file count as active references, so
the inode should not be freed on disk until all processes running the
program have stopped running it (either by exiting or "exec"ing some
other program).  I know this is the case in 4.xBSD, and was probably the
case in V7 and S3 and older S5 implementations as well.  I think it's
true of paging S5 implementations as well. 

If it is *not* the case, the implementation is buggy; consider the case
of somebody opening a file and then unlinking it (this is done by lots
of programs).  If the inode is recycled when the unlink is done,
subsequent references to the file won't work, especially if the inode is
then grabbed by another file....



More information about the Comp.unix.wizards mailing list