Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!genrad!decvax!harpo!seismo!hao!hplabs!sri-unix!ron@brl-bmd From: ron%brl-bmd@sri-unix.UUCP Newsgroups: net.unix-wizards Subject: Re: PDP-11 loader options Message-ID: <2101@sri-arpa.UUCP> Date: Mon, 13-Jun-83 16:31:02 EDT Article-I.D.: sri-arpa.2101 Posted: Mon Jun 13 16:31:02 1983 Date-Received: Wed, 15-Jun-83 18:44:21 EDT Lines: 35 From: Ron NatalieNow wait a minute. Steve's letter states the with the -n option the text part of the program is not put into /dev/swap but loaded out of the disk each time and that's why you can't unlink these files...WRONG. When you load a 410 type (one loaded with the -n) option or a 411 (one loaded with -i) it recognizes that there is no way the user running the program can overwrite the text part. It then sets up to use UNIX's shared text mechanism. When the program is loaded and it doesn't already exist on the swap device, it makes a place for both the text part and the user's writable data part in swap space. On each subsequent execution (if the swap image for this program is still there) it makes a place only for the user's data image. Dinking with the memory management, there is only one copy of the text part of any one shared text program in memory (and one on the swap disk) at a time. All user's use their own data part but share the text image. To exploit this even further some programs (noticeably, some shells) have modify their assembler code to cause read-only data to be assembled into text space (of course this only works with -n files and not -i). The reason you can't unlink the inode that is in use, is that the way it knows that your 410 or 411 file is the same as one already running is that it has the inode and disk device numbers stored in an internal structure. If it were to allow you to remove a file that is already running shared text, you could replace the file with the same inode/device combination and it would run that with new data but the old text. The ISVTX (or sticky) bit in the inode (designated by a 't') in ls output, causes shared text programs not to be chucked out of swap space when they are done running. This allows faster startup because it only once ever has to load in the text. -Ron