Reads the current process credentials.
#include <usersec.h>
char **getpcred ( Which)
int Which;
The getpcred subroutine reads the specified process security credentials and returns them in a character buffer. It is the calling application's responsibility to free this memory.
The getpcred subroutine reads the specified process security credentials and returns them in a character buffer.
Which | Specifies which credentials are read. This parameter is a bit mask
and can contain one or more of the following values, as defined in the
usersec.h file:
If the Which parameter is null, all credentials are returned. |
When successful, the getpcred subroutine returns a pointer to a string containing the requested values. If the getpcred subroutine is unsuccessful, a null pointer is returned and the errno global variable is set to indicate the error.
The getpcred subroutine
fails if either of the following are true:
EINVAL | The Which parameter contains invalid credentials requests. |
EPERM | The process does not have the proper authority to retrieve the requested credentials. |
Other errors can also be set by any subroutines invoked by the getpcred subroutine.
This subroutine is part of Base Operating System (BOS) Runtime.
The ckuseracct (ckuseracct Subroutine) subroutine, ckuserID (ckuserID Subroutine) subroutine, getpenv (getpenv Subroutine) subroutine, setpenv subroutine, setpcred subroutine.
List of Security and Auditing Subroutines, Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.