| 29 |
|
<funcdef>int <function>statgrab_init</function></funcdef> |
| 30 |
|
<void/> |
| 31 |
|
</funcprototype> |
| 32 |
+ |
<funcprototype> |
| 33 |
+ |
<funcdef>int <function>statgrab_drop_privileges</function></funcdef> |
| 34 |
+ |
<void/> |
| 35 |
+ |
</funcprototype> |
| 36 |
|
|
| 37 |
|
<funcprototype> |
| 38 |
|
<funcdef>cpu_percent_t *<function>cpu_percent_usage</function></funcdef> |
| 121 |
|
leaves them open for future use. Because of this, any special |
| 122 |
|
privileges the program has (e.g. setgid kmem) can be dropped |
| 123 |
|
after this call, and all the libstatgrab calls should continue to |
| 124 |
< |
work. |
| 124 |
> |
work. It is therefore a good idea to call |
| 125 |
> |
<function>statgrab_drop_privileges</function>, which discards |
| 126 |
> |
setuid and setgid privileges, immediately after you call |
| 127 |
> |
<function>statgrab_init</function>, unless your application has |
| 128 |
> |
another reason for needing setuid or setgid privileges. |
| 129 |
|
</para> |
| 130 |
|
<para> |
| 131 |
< |
<function>statgrab_init</function> returns 0 on success, and |
| 131 |
> |
<function>statgrab_init</function> and |
| 132 |
> |
<function>statgrab_drop_privileges</function> return 0 on success, and |
| 133 |
|
non-zero on failure. |
| 134 |
|
</para> |
| 135 |
|
<para> |