Copies a concurrent group set into a credentials structure.
#include <sys/cred.h>
int kcred_setgroups ( crp, ngroups, groups )
struct ucred * cr;
int ngroups;
gid_t * groups;| Item | Description | 
|---|---|
| crp | Pointer to a credentials structure | 
| ngroups | Size of the array of group ID values | 
| groups | Array of group ID values | 
The kcred_setgroups kernel service copies ngroups concurrent group set members into the credentials structure pointed to by crp. crp must be a valid, referenced credentials structure and must not be the current credentials of any process.
The kcred_setgroups kernel service can be called from the process environment only.
| Item | Description | 
|---|---|
| 0 | The concurrent group set has been copied successfully. | 
| -1 | An error has occurred. |