35 |
|
</funcprototype> |
36 |
|
|
37 |
|
<funcprototype> |
38 |
+ |
<funcdef>sg_error <function>sg_get_error</function></funcdef> |
39 |
+ |
<void/> |
40 |
+ |
</funcprototype> |
41 |
+ |
<funcprototype> |
42 |
+ |
<funcdef>const char *<function>sg_get_error_arg</function></funcdef> |
43 |
+ |
<void/> |
44 |
+ |
</funcprototype> |
45 |
+ |
<funcprototype> |
46 |
+ |
<funcdef>int<function>sg_get_error_errno</function></funcdef> |
47 |
+ |
<void/> |
48 |
+ |
</funcprototype> |
49 |
+ |
<funcprototype> |
50 |
+ |
<funcdef>const char *<function>sg_str_error</function></funcdef> |
51 |
+ |
<paramdef>sg_error <parameter>code</parameter></paramdef> |
52 |
+ |
</funcprototype> |
53 |
+ |
|
54 |
+ |
<funcprototype> |
55 |
|
<funcdef>sg_cpu_stats *<function>sg_get_cpu_stats</function></funcdef> |
56 |
|
<void/> |
57 |
|
</funcprototype> |
74 |
|
</funcprototype> |
75 |
|
|
76 |
|
<funcprototype> |
77 |
+ |
<funcdef>sg_fs_stats *<function>sg_get_fs_stats</function></funcdef> |
78 |
+ |
<void/> |
79 |
+ |
</funcprototype> |
80 |
+ |
|
81 |
+ |
<funcprototype> |
82 |
|
<funcdef>sg_host_info *<function>sg_get_host_info</function></funcdef> |
83 |
|
<void/> |
84 |
|
</funcprototype> |
161 |
|
non-zero on failure. |
162 |
|
</para> |
163 |
|
<para> |
164 |
+ |
There are three functions relating to error reporting in libstatgrab. |
165 |
+ |
The first, <function>sg_get_error</function> returns an sg_error code |
166 |
+ |
which relates to the last error generated by libstatgrab. This can be |
167 |
+ |
converted to a string by calling <function>sg_str_error</function> |
168 |
+ |
giving the sg_error code as an argument. An optional |
169 |
+ |
argument may be set when the error was generated. This can be |
170 |
+ |
accessed by calling <function>sg_get_error_arg</function>; |
171 |
+ |
<constant>NULL</constant> will be returned if no argument has |
172 |
+ |
been set. Some errors will also record the value of the system |
173 |
+ |
errno variable when the error occurred; this can be retrieved by |
174 |
+ |
calling <function>sg_get_error_errno</function>, which will |
175 |
+ |
return <constant>0</constant> if no valid errno has been recorded. |
176 |
+ |
</para> |
177 |
+ |
<para> |
178 |
+ |
It is the intended practice that whenever a libstatgrab function is |
179 |
+ |
called and subsequently fails that an appropriate error will be set. |
180 |
+ |
</para> |
181 |
+ |
<para> |
182 |
|
The library was originally written to support the i-scream |
183 |
|
central monitoring system, but has since become a standalone |
184 |
|
package. It has been ported to work on Linux, NetBSD, FreeBSD, |
185 |
< |
OpenBSD, DragonFly BSD, Solaris and Cygwin. |
185 |
> |
OpenBSD, DragonFly BSD, Solaris, HP-UX and Cygwin. |
186 |
|
</para> |
187 |
|
</refsect1> |
188 |
|
|
197 |
|
</citerefentry> |
198 |
|
<citerefentry> |
199 |
|
<refentrytitle>sg_get_disk_io_stats</refentrytitle> |
200 |
+ |
<manvolnum>3</manvolnum> |
201 |
+ |
</citerefentry> |
202 |
+ |
<citerefentry> |
203 |
+ |
<refentrytitle>sg_get_fs_stats</refentrytitle> |
204 |
|
<manvolnum>3</manvolnum> |
205 |
|
</citerefentry> |
206 |
|
<citerefentry> |