Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

kvm_getswapinfo(3) [freebsd man page]

KVM_SWAPINFO(3) 					   BSD Library Functions Manual 					   KVM_SWAPINFO(3)

NAME
kvm_getswapinfo -- return swap summary statistics for the system LIBRARY
Kernel Data Access Library (libkvm, -lkvm) SYNOPSIS
#include <kvm.h> int kvm_getswapinfo(kvm_t *kd, struct kvm_swap *, int maxswap, int flags); DESCRIPTION
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
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
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 termi- nated. SEE ALSO
kvm(3) BSD
January 22, 1999 BSD

Check Out this Related Man Page

SWAPON(8)						     Linux Programmer's Manual							 SWAPON(8)

NAME
swapon, swapoff - enable/disable devices and files for paging and swapping SYNOPSIS
/sbin/swapon [-h -V] /sbin/swapon -a [-v] [-e] /sbin/swapon [-v] [-p priority] specialfile ... /sbin/swapon [-s] /sbin/swapoff [-h -V] /sbin/swapoff -a /sbin/swapoff specialfile ... DESCRIPTION
Swapon is used to specify devices on which paging and swapping are to take place. Calls to swapon normally occur in the system multi-user initialization file /etc/rc making all swap devices available, so that the paging and swapping activity is interleaved across several devices and files. Normally, the first form is used: -h Provide help -V Display version -s Display swap usage summary by device. Equivalent to "cat /proc/swaps". Not available before Linux 2.1.25. -a All devices marked as ``swap'' swap devices in /etc/fstab are made available. Devices that are already running as swap are silently skipped. -e When -a is used with swapon, -e makes swapon silently skip devices that do not exist. -p priority Specify priority for swapon. This option is only available if swapon was compiled under and is used under a 1.3.2 or later kernel. priority is a value between 0 and 32767. See swapon(2) for a full description of swap priorities. Add pri=value to the option field of /etc/fstab for use with swapon -a. Swapoff disables swapping on the specified devices and files. When the -a flag is given, swapping is disabled on all known swap devices and files (as found in /proc/swaps or /etc/fstab). NOTE
You should not use swapon on a file with holes. Swap over NFS may not work. SEE ALSO
swapon(2), swapoff(2), fstab(5), init(8), mkswap(8), rc(8), mount(8) FILES
/dev/hd?? standard paging devices /dev/sd?? standard (SCSI) paging devices /etc/fstab ascii filesystem description table HISTORY
The swapon command appeared in 4.0BSD. Linux 1.x 25 September 1995 SWAPON(8)
Man Page