Do you believe in MAGIC?

Don E. Davis ded at aplvax.UUCP
Thu Jun 6 04:52:07 AEST 1985


We are currently in the midst of converting to 4.2BSD.  During this
conversion a question popped up which different parts of the 
documentation seemed to answer differently (so what else is new).

We wanted to identify which programs were running with shared text.
Unfortunately, we couldn't ascertain this info using "file" or "ps" (and
"stat" wasn't even there).  The "ld" man page says that loading with 
a "-n" flag will result in a shared text program via magic number 0410.
But a perusal of the kern_exec.c source seemed to indicate that either 
0413 or 0410 would result in a shared text program.  I compiled a
test program with and without the -n option, and the only difference
seemed to be that the 0413 magic version had its header padded with
zeros up until word 1024.  Thereafter, the 0410 and 0413 versions seemed
identical.  A "file" run on the 0413 version returns "demand paged"; the 0410
doesn't.

What is going on here?  Is there an easy way to determine which files
are running shared text?  What are the tradeoffs?  Why not make all programs
shared text?  Thanks?
-- 

					Don Davis
					JHU/APL
				...decvax!harpo!seismo!umcp-cs!aplvax!ded
				...rlgvax!cvl!umcp-cs!aplvax!ded



More information about the Comp.unix.wizards mailing list