--- projects/libstatgrab/docs/statgrab.xml 2003/10/21 15:48:55 1.2 +++ projects/libstatgrab/docs/statgrab.xml 2004/03/06 23:35:20 1.6 @@ -6,8 +6,8 @@ - $Date: 2003/10/21 15:48:55 $ - $Id: statgrab.xml,v 1.2 2003/10/21 15:48:55 pajs Exp $ + $Date: 2004/03/06 23:35:20 $ + $Id: statgrab.xml,v 1.6 2004/03/06 23:35:20 tdb Exp $ @@ -29,6 +29,10 @@ int statgrab_init + + int statgrab_drop_privileges + + cpu_percent_t *cpu_percent_usage @@ -81,6 +85,11 @@ + network_iface_stat_t *get_network_iface_stats + int *entries + + + page_stat_t *get_page_stats @@ -105,28 +114,35 @@ Description - The statgrab library provides a cross platform interface to getting + The statgrab library provides a cross-platform interface to getting system statistics. Each of the function calls returns a structure containing statistics. See the manual page for each individual function for more details on usage. - statgrab_init(void) should be the first - function you call before you start to use libstatgrab. This - function on *bsd systems opens up the kernel structures and - leaves them open for future use. Because of this, any special - privileges the program has (e.g. setgid kmem) can be dropped - after this call, and all the libstatgrab calls should continue to - work. + statgrab_init must be the first + function you call before you start to use libstatgrab; it performs all + the one-time initialisation operations that need setuid/setgid + privileges. For instance, on *BSD it opens a descriptor to be able to + read kernel structures later on, and on Solaris it reads the device + mappings that in some cases are only accessible by root (machines with + a /dev/osa). Once this has run, the other libstatgrab functions no longer + need elevated privileges. It is therefore a good idea to call + statgrab_drop_privileges, which discards + setuid and setgid privileges, immediately after you call + statgrab_init, unless your application has + another reason for needing setuid or setgid privileges. - statgrab_init returns 0 on success, and + statgrab_init and + statgrab_drop_privileges return 0 on success, and non-zero on failure. - The library was originally written to support the i-scream central - monitoring system, but has since become a standalone package. It - has been ported to work on Linux, FreeBSD, and Solaris. + The library was originally written to support the i-scream + central monitoring system, but has since become a standalone + package. It has been ported to work on Linux, NetBSD, FreeBSD, + OpenBSD, DragonFly BSD, Solaris and Cygwin. @@ -157,6 +173,10 @@ get_network_stats + 3 + + + get_network_iface_stats 3