|PROG_GET_CRED(3PROC)||Process Control Library Functions||PROG_GET_CRED(3PROC)|
prcred_t *credp, int
proc_get_cred() function is a convenient way to read the /proc cred file for the process proc.
Up to ngroups supplemental groups will be read and written into credp in addition to the normal information. If ngroups is more than one, than it is up to the caller to have allocated enough space for credp. Callers could allocate it, using an expression similar to:
credp = malloc(sizeof (prcred_t) + (ngroups - 1) * sizeof (gid_t));
The definition of the prcred_t structure may be found in proc(5).
proc_get_cred() function returns 0. Otherwise, -1 is returned to indicate an error occurred.
|May 11, 2016||OmniOS|