.\" -*- coding: us-ascii -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH sg_init 3 2013-06-07 i-scream "" .SH NAME sg_init, sg_snapshot, sg_shutdown, sg_drop_privileges \- initialise libstatgrab .SH SYNOPSIS 'nh .nf \*(T<#include \*(T> .fi .sp 1 .PP .fi .ad l \*(T \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu \*(T<(int \fIignore_init_errors\fR);\*(T> 'in \n(.iu-\nxu .ad b .PP .fi .ad l \*(T \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu \*(T<(void);\*(T> 'in \n(.iu-\nxu .ad b .PP .fi .ad l \*(T \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu \*(T<(void);\*(T> 'in \n(.iu-\nxu .ad b .PP .fi .ad l \*(T \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu \*(T<(void);\*(T> 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \*(T<\fBsg_init\fR\*(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<\fBsg_init\fR\*(T>() is protected by the mutex named "statgrab". .PP \*(T<\fBsg_snapshot\fR\*(T>() is Win32 only and will probably disappear. .PP \*(T<\fBsg_shutdown\fR\*(T>() decrements the initialisation counter. If the counter reaches zero, components' destructors are called, mutual exclusion semaphores (exept "statgrab") are destroyed etc. \*(T<\fBsg_shutdown\fR\*(T>() is protected by the mutex named "statgrab". .PP \*(T<\fBsg_drop_privileges\fR\*(T>() drops elevated privileges. .SH "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. .SH "SEE ALSO" \fBstatgrab\fR(3) .SH WEBSITE \(lahttp://www.i-scream.org/libstatgrab/\(ra