Gets a privilege set associated with a process.
Security Library (libc.a)
The getppriv subroutine returns the privilege set for the process specified by the pid parameter. If the value of the pid is negative, the calling process's privilege set is retrieved. The value of the which parameter is one of the PRIV_EFFECTIVE, PRIV_MAXIMUM, PRIV_INHERITED, PRIV_LIMITING or PRIV_USED values. The corresponding privilege set is copied to the privset parameter in the size specified by the privsize parameter. The PV_PROC_PRIV privilege is required in the effective set when a process wants to obtain privilege set from another process.
Item | Description |
---|---|
Pid | Indicates the process that the privilege set is requested for. |
Which | Specifies the privilege set to get. |
Privset | Stores the privilege set. |
Privsize | Specifies the size of the privilege set. |
The getppriv subroutine returns one of the following values:
Item | Description |
---|---|
0 | The subroutine completes successfully. |
-1 | An error has occurred. An errno global variable is set to indicate the error. |
The getppriv subroutine fails if any of the following values is true:
Item | Description |
---|---|
EFAULT | The privset parameter is pointing to an address that is not legal. |
EINVAL | The value of the privset parameter is NULL, or the value of the privsize parameter is not valid. |
EPERM | The process does not have the privilege (PV_PROC_PRIV or MAC read) to obtain another process' privilege set. |
ESRCH | No process has a process ID that is equal to the value of the Pid parameter. |