SYNOPSIS

\*(T<#include <statgrab.h>\*(T>

\*(T<sg_error sg_init\*(T> \kx \*(T<(int ignore_init_errors);\*(T>

\*(T<sg_error sg_snapshot\*(T> \kx \*(T<(void);\*(T>

\*(T<sg_error sg_shutdown\*(T> \kx \*(T<(void);\*(T>

\*(T<sg_error sg_drop_privileges\*(T> \kx \*(T<(void);\*(T>

DESCRIPTION

\*(T<sg_init\*(T>() either initialises the statgrab library and sets the initialisation counter to 1, if not already done, or increases the initialisation counter. If called for the first time (in fact: if called when the initialisation counter is 0), the constructor (initialisation routine) of each registered component is invoked, some global variables are initialised, requested mutual exclusion semaphores are initialised and so on. \*(T<sg_init\*(T>() is protected by the mutex named "statgrab".

\*(T<sg_snapshot\*(T>() is Win32 only and will probably disappear.

\*(T<sg_shutdown\*(T>() decrements the initialisation counter. If the counter reaches zero, components' destructors are called, mutual exclusion semaphores (exept "statgrab") are destroyed etc. \*(T<sg_shutdown\*(T>() is protected by the mutex named "statgrab".

\*(T<sg_drop_privileges\*(T>() drops elevated privileges.

RETURN VALUES

All functions return a statgrab error code. Either SG_ERROR_NONE when everything was ok or the appropriate error code from an constructor/destructor.

RELATED TO sg_drop_privileges…

statgrab(3)

WEBSITE

\(lahttp://www.i-scream.org/libstatgrab/\(ra