Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!ncar!ames!oliveb!3comvax!bridge2!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: Demand paged executables Keywords: SYSTEM V see Bach Message-ID: <944@auspex.UUCP> Date: 3 Feb 89 20:30:38 GMT References: <409@lakart.UUCP> <1997@solo12.cs.vu.nl> <2765@rti.UUCP> <314@spca6.UUCP> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 21 >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....