NAME

lkmi_swapex


SYNOPSIS

#include <lkmi.h >

int lkmi_swapex (lkmi_swapex_t *swapex, int index, int num);


PARAMETERS

swapex
Contain pointer to the structure which is described below.

index
Index of first evaluated swap space. First index is 0.

num
Number of lkmi_swapex_t blocks in swapex array.


DESCRIPTION

lkmi_swapex obtains informations about particular swap space(s) and its usage from /proc/swaps file and and puts it in swapex_info structure.

If NULL is entered as swapex_info then number of swap spaces is returned.

filename
Name of device file or file, where is swap created.

type
Type of swap space. Known and tested are: p partition. (no more)

size
Amount of swap space which may be used.

used
Amount of disk swap space which is currently used.

priority
Priority of particular swap space.


RETURN VALUE

If function ends successfully, then returns 0. If call fail, functions returns -1, for explanation of errno value see fopen(3) function.

If parameter swapex_info is NULL then number of swap spaces is returned.


BUGS REPORTING

Please use the SourceForge Reporting page which is located here:

Bug Report


COPYRIGHT

This function is written as part of lkmi library for Linux system and may be freely distributed under GPL terms.

Copyright (c) 1995, 2002 David Doubrava (linux_monitor(at)volny(dot)cz).


SEE ALSO

Origin of values description is in Linux kernel source.

lkmi
lkmi_cpu lkmi_files lkmi_filesys lkmi_hdd lkmi_hw_intr lkmi_inodes lkmi_memory lkmi_memoryswap lkmi_net lkmi_proc lkmi_readprocesses lkmi_swap lkmi_swapex lkmi_system