#include <cx/cred.h>int acred(const KnCap *cactorcap, cx_cred_t *oldCred, const cx_cred_t *newCred);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
If oldCred is not the NULL pointer, a copy of the credential structure of the process designated by its capability cactorcap will be copied at the location pointed to by oldCred.
If newCred is not the NULL pointer, the credentials of the process designated by its capability cactorcap will be set to the value of the credentials pointed to by newCred.
A structure cx_cred_t includes the following members:
uid_t cr_uid; /* process's user ID */ gid_t cr_gid; /* process's group ID */ unsigned short cr_ngroups; /* number of groups in cr_groups */ gid_t cr_groups; /* supplementary group list */
Upon successful completion, acred returns 0. Otherwise, it returns the following error conditions:
cactorcap doesn't designate a valid process.
newCred is not the NULL pointer and the caller is not a trusted process.
cactorcap, oldCred or newCred points outside the allocated address space of the calling process.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
|Interface Stability||Deprecated - replaced by getuid(2POSIX) setuid(2POSIX)|