debian man page for sg_get_swap_stats

Query: sg_get_swap_stats

OS: debian

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

sg_get_mem_stats(3)					     Library Functions Manual					       sg_get_mem_stats(3)

NAME
sg_get_mem_stats, sg_get_swap_stats - get VM statistics
SYNOPSIS
#include <statgrab.h> sg_mem_stats *sg_get_mem_stats(void); sg_swap_stats *sg_get_swap_stats(void);
DESCRIPTION
Memory statistics are accessed through the sg_get_mem_stats function. It returns a pointer to a static sg_mem_stats. The sg_get_swap_stats returns returns swap statistics. It returns a pointer to a static sg_swap_stats. On the FreeBSD operating system elevated privileges are required to access the swap statistics. Making the program setgid kmem should be sufficient. Programs running as root will not have this problem.
RETURN VALUES
The VM system calls can return a pointer to either a sg_mem_stats or a sg_swap_stats. typedef struct{ long long total; long long free; long long used; long long cache; }sg_mem_stats; total The total amount of memory in bytes. free The total free memory in bytes. used The total used memory in bytes. cache The amount of cache used in bytes. typedef struct{ long long total; long long used; long long free; }sg_swap_stats; total The total swap space in bytes. used The used swap in bytes. free The free swap in bytes.
TODO
Add a function to hold open the file descriptor to the kernel memory structures. Doing this would allow the elevated privileges to be dropped early on.
SEE ALSO
statgrab(3)
WEBSITE
http://www.i-scream.org/libstatgrab/ i-scream $Date: 2005/04/25 11:25:45 $ sg_get_mem_stats(3)
Related Man Pages
sg_get_cpu_stats(3) - debian
sg_get_fs_stats(3) - debian
sg_get_page_stats(3) - debian
sg_get_swap_stats(3) - debian
statgrab(3) - debian
Similar Topics in the Unix Linux Community
Linux memory usage
top output and swap -s output are differing
Anyone help to interpretate os statistics
Memory Usage(Physical) in one Word? Suse Linux.
Help understanding how swap works