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 Message-ID: <942@auspex.UUCP> Date: 3 Feb 89 20:04:18 GMT References: <409@lakart.UUCP> <7599@chinet.chi.il.us> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 23 >Now, if a.outs need this kind of protection (and they do) They most definitely do *not* need protection against unlinking, as Mr. Goodenough pointed out - the system is definitely smart enough not to blow away the file until the last *active* reference goes away, even if you remove the last link. They may, or may not, need protection against being written to; SunOS 4.0 provides no such protection, but I haven't found that to be a fatal problem - just use "mv" (or something that does the same sort of thing) to install a new version, which means processes currently using the image will continue to use an unmolested copy of the old version, and processes that use it subsequently will get the new version, and when the last process stops using the old version *poof* it goes away. >why isn't the same thing done for shell scripts - i.e prevent them from being >modified while running? Because the kernel has no idea that a shell script is "running". All it knows is that somebody has it open for reading. It would be considered rude to forcibly disallow writes to *any* file that somebody has open for reading, and UNIX, for better or worse, doesn't have the notion of "N-readers/1-writer" exclusion on "open"s.