PROC_GET_PRIV(3PROC) Process Control Library Functions PROC_GET_PRIV(3PROC)
NAME
proc_get_priv,
proc_free_priv - get process privileges
LIBRARY
Process Control Library (libproc, -lproc)
SYNOPSIS
#include <libproc.h> prpriv_t * proc_get_priv(
pid_t pid);
void proc_free_priv(
prpriv_t *prp);
DESCRIPTION
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.
RETURN VALUES
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.
INTERFACE STABILITY
UncommittedMT-LEVEL MT-SafeSEE ALSO
libproc(3LIB),
proc(5)illumos November 27, 2023 illumos