kcred_setpriv Kernel Service

Purpose

Copies a privilege vector into a credentials structure.

Syntax

#include <sys/priv.h>

#include <sys/cred.h>

int kcred_setpriv ( crp, which, priv )
struct ucred * cr;
int which;
priv_t * priv;

Parameters

Item Description
crp Pointer to a credentials structure
which Privilege set to set
priv Privilege set

Description

The kcred_setpriv kernel service sets one or more single privilege sets in the credentials structure referenced by crp. The which parameter is one or more bit-wise ored values of PRIV_BEQUEATH, PRIV_EFFECTIVE, PRIV_INHERITED, and PRIV_MAXIMUM. The corresponding privilege sets are initialized from priv. crp must be a valid, referenced credentials structure and must not be the current credentials of any process.

Execution Environment

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

Return Values

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