Demand paged executables

Guy Harris guy at auspex.UUCP
Sat Feb 4 06:04:18 AEST 1989


>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. 



More information about the Comp.unix.wizards mailing list