PROC_GET_PRIV(3PROC) Process Control Library Functions PROC_GET_PRIV(3PROC)

proc_get_priv, proc_free_privget 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 () 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 () 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.

libproc(3LIB), proc(5)

November 27, 2023 OmniOS