I got lots of people suggesting table(TBL_SWAPINFO, -1,...) but I didn't get
my head around it until I used gtrace to see what swapon -s was doing.
The trick is to call TBL_SWAPINFO with index 0 to the highest and add these
up for total and free. But the free given with index -1 will not agree with
this total - the difference is the reserved swap.
Thanks to: John Vaughn, John P Speno, Paul A Sand, alan_at_nabeth.cxo.dec.com,
Irs
Original query:
Does anyone know how to find out the reserved swap space via a system call.
I know I can get it from swapon -s, but I need to write something that
constantly monitors it and a system call would be more efficient.
Alternatively I could read something from /dev/kmem.
Dave Simmonds
dsimmonds_at_datametrics.co.uk
Received on Thu Mar 30 2000 - 14:44:34 NZST