*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> kvm_getswapinfo (3)              



NAME    [Toc]    [Back]

     kvm_getswapinfo -- return swap summary statistics for the system

LIBRARY    [Toc]    [Back]

     Kernel Data Access Library (libkvm, -lkvm)

SYNOPSIS    [Toc]    [Back]

     #include <kvm.h>

     kvm_getswapinfo(kvm_t *kd, struct kvm_swap *, int maxswap, int flags);

DESCRIPTION    [Toc]    [Back]

     The kvm_getswapinfo() function fills an array of kvm_swap structures with
     swap summary information for each swap device, for up to maxswap - 1
     devices.  The number of devices, up to maxswap - 1, is returned.  A grand
     total of all swap devices (including any devices that go beyond maxswap -
     1) is returned in one additional array entry.  This entry is not counted
     in the return value.  Thus, if you specify a maxswap value of 1, the
     function will typically return the value 0 and the single kvm_swap structure
 will be filled with the grand total over all swap devices.  The
     grand total is calculated from all available swap devices whether or not
     you made room for them all in the array.  The grand total is returned.

     The flags argument is currently unused and must be passed as 0.

     If an error occurs, -1 is returned.

     Each swap partition and the grand total is summarized in the kvm_swap
     structure.  This structure contains the following fields:

	   char ksw_devname[];
	   int ksw_total;
	   int ksw_used;
	   int ksw_flags;

     Values are in PAGE_SIZE'd chunks (see getpagesize(3)).  ksw_flags contains
 a copy of the swap device flags.

CACHING    [Toc]    [Back]

     This function caches the nlist values for various kernel variables which
     it reuses in successive calls.  You may call the function with kd == NULL
     to clear the cache.

DIAGNOSTICS    [Toc]    [Back]

     If the load average was unobtainable, -1 is returned; otherwise, the number
 of swap devices actually retrieved is returned.

     If the name of the swap device does not fit in the static char buffer in
     the structure, it is truncated.  The buffer is always zero terminated.

SEE ALSO    [Toc]    [Back]


FreeBSD 5.2.1		       January 22, 1999 		 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
w Tru64 Prints a summary of current system activity
dxsysinfo Tru64 Monitors system information such as CPU activity, memory, swap space, and file system usage
swapctl OpenBSD system swap management tool
swapctl Tru64 Manages the system swap space
swapon OpenBSD system swap management tool
pmap_resident_count FreeBSD return page resident and wiring statistics
pmap_wired_count FreeBSD return page resident and wiring statistics
SwapManager IRIX view and manage system swap space
glxchannelrectsyncsgix IRIX configures the system to update video input areas on complete swap buffers of bound xwids
tcl IRIX Summary of Tcl language syntax.
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service