Reading user structure from /dev/swap on 3B2

Brent P. Callaghan brent at poseidon.UUCP
Tue Mar 25 01:22:59 AEST 1986


>	I'm having problems trying to find how to read the user block
>of a process when it's swapped to /dev/swap. I've tried using proc.p_swaddr
>(Swap Address) and have try the following address in swap -
>
>		ctod(proc.p_swaddr)*BSIZE		(BSIZE = 512)
>		ctod(proc.p_swaddr)*1024
>		ctob(proc.p_swaddr)*BSIZE
>		ctob(proc.p_swaddr)*1024
>		ctob(proc.p_swaddr)
>		ctod(proc.p_swaddr)
>
>	All the above produce junk. Any System V R2V2 experts have any ideas?
This works on a 3B2:

addr = (swplo + proc.p_swaddr + ctod(proc.p_size - proc.p_ssize - USIZE)) << BSHIFT ;
lseek(devswap, addr, 0) ;
read(devswap, (char *)&ublock, sizeof(ublock)) ;

Declare swplo as "daddr_t swplo ;" and gets it's value
from /dev/kmem ; It's value is often zero anyway.
-- 
				
Made in New Zealand -->		Brent Callaghan
				AT&T Information Systems, Lincroft, NJ
				{ihnp4|mtuxo|pegasus}!poseidon!brent
				(201) 576-3475



More information about the Comp.unix.wizards mailing list