Demand paged executables

Paul De Bra debra at alice.UUCP
Sat Feb 4 02:58:58 AEST 1989


In article <6211 at saturn.ucsc.edu> brad at polaris.UUCP (Brad Smith) writes:
}Two questions/points on this:
}	- Wouldn't there be some problems with other links to
}	  a file being invalidated (pointing to the old version)
}	  if the file was unlinked, a new inode allocated, and
}	  a new link created to copy over an executing program?

If you try to write over an existing file that is being executed that should
fail. You can remove the file and create a new one, but indeed all other
links to the old file will still point to the old file. If your system
supports them it is better to use symbolic links to executable files, to
avoid ending up with multiple versions of programs that once were the same.

}	- It seems the reason for not locking shell scripts is
}	  that virtual memory for the executable is not being
}	  paged out of the file containing the script.  Some
}	  program (typically a shell) is being run with the
}	  contents of the script as input... or something to
}	  that effect.

The shell only reads and interprets the shell script. The script does not
contain machine-code. The shell does not read the whole script before
executing it however, so when you change a large script while it is being
executed (i.e. read) the shell may find syntax errors because it suddenly
continues to read the new script from an arbitrary point (a block boundary
usually).

Paul.
-- 
------------------------------------------------------
|debra at research.att.com   | uunet!research!debra     |
------------------------------------------------------



More information about the Comp.unix.wizards mailing list