Demand paged executables

John F. Haugh II jfh at rpp386.Dallas.TX.US
Sat Feb 4 01:07:03 AEST 1989


In article <314 at spca6.UUCP> ray at spca6.UUCP (ray) writes:
>Problem I see for a.outs that have shared text.  
>This is all from reading the Bach book, I have no access to source.  
>From the Bach book page 223,
>"...the kernel searches the active region list for the file's text region,
>identifying it as the one whose inode pointer matches the inode of the
>executable file."

This is fairly accurate.  There is a table of active text segments.  It
contains information regarding the number of references to a pure-text
file, how many are loaded, if each is swapped, and so on.  Stare at
/usr/include/sys/text.h for more details.

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

Can't happen, unless the entire inode is scavenged.  Consider that when
an open file is removed, the system waits until the last reference goes
away before recovering the inode and associated data blocks.  Thus, that
i-number is not available until the last reference to the inode is removed.
Same thing should work with pure-text prototypes.
-- 
John F. Haugh II                        +--Quote of the Week:------------------
VoiceNet: (214) 250-3311   Data: -6272  | "Get it through your head:
InterNet: jfh at rpp386.Dallas.TX.US       |     CARS ARE THE ENEMY."
UucpNet : <backbone>!killer!rpp386!jfh  +------    -- Bob Fishell    ----------



More information about the Comp.unix.wizards mailing list