libstatgrab 0.16 (Default branch)


 
Thread Tools Search this Thread
Special Forums News, Links, Events and Announcements Software Releases - RSS News libstatgrab 0.16 (Default branch)
# 1  
Old 03-18-2008
libstatgrab 0.16 (Default branch)

ImageThe libstatgrab library provides an easy-to-useinterface for accessing system statistics andinformation. Available statistics include CPU,Load, Memory, Swap, Disk I/O, and Network I/O. Itwas developed to work on Linux, FreeBSD, andSolaris. The package also includes two tools:saidar provides a curses-based interface forviewing live system statistics, and statgrab is asysctl-like interface to the statistics.License: GNU Lesser General Public License (LGPL)Changes:
Building on Solaris and the Debian "armel" port was fixed. Support for FreeBSD 8 was added and minor problems were fixed.Image

More...
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question
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)