kcred_getppriv Kernel Service

Purpose

Copies a privilege vector from a credentials structure.

Syntax

#include <sys/priv.h>
#include <sys/cred.h>

int kcred_getppriv (crp, which, privset)
struct ucred *crp;
int which;
privg_t privset;

Parameters

Item Description
crp Points to a credentials structure.
which Specifies the privilege set to get.
privset Specifies the privilege set.

Description

The kcred_getppriv kernel service returns a single privilege set from the credentials structure referenced by the crp parameter. The which parameter is one of the values of PRIV_EFFECTIVE, PRIV_MAXIMUM, PRIV_INHERITED, PRIV_LIMITING, and PRIV_USED. The corresponding privilege set is copied to the privset parameter. The crp parameter must be a valid, referenced credentials structure.

Execution Environment

The kcred_getppriv kernel service can be called from the process environment only.

Return Values

Item Description
0 Success.
-1 An error has occurred.