| PROC_GET_PRIV(3PROC) | Process Control Library Functions | PROC_GET_PRIV(3PROC) |
proc_get_priv,
proc_free_priv — get process
privileges
Process Control Library (libproc, -lproc)
#include
<libproc.h>
prpriv_t *
proc_get_priv(pid_t pid);
void
proc_free_priv(prpriv_t
*prp);
The
proc_get_priv()
function is a convenient way to read the /proc privilege file for the
process pid. The
proc_get_priv() function takes care of allocating
memory for the privilege set and ensures that it is large enough to hold all
of the privilege sets. The definition of the prpriv_t
structure may be found in proc(5).
The
proc_free_priv()
function releases the memory that was allocated by a call to
proc_get_priv(). It is safe to pass the
NULL pointer in as prp, the
function will simply return without taking any action in that case.
Upon successful completion, the
proc_get_priv() function returns a pointer to an
allocated prpriv_t with the privileges of
pid. Otherwise, NULL is
returned to indicate an error occurred.
| November 27, 2023 | OmniOS |