FreeBSD/sys/kern/kern_prot.c
/*
 * Fill in a struct xucred based on a struct ucred.
 */
Fill in a struct xucred based on a struct ucred.
Fill in a struct xucred based on a struct ucred .
void
cru2x(struct ucred *cr, struct xucred *xcr)
{
	int ngroups;
	bzero(xcr, sizeof(*xcr));
	xcr->cr_version = XUCRED_VERSION;
	xcr->cr_uid = cr->cr_uid;
	ngroups = MIN(cr->cr_ngroups, XU_NGROUPS);
	xcr->cr_ngroups = ngroups;
	bcopy(cr->cr_groups, xcr->cr_groups,
	    ngroups * sizeof(*cr->cr_groups));
}
void cru2x ( struct ucred * cr , struct xucred * xcr ) { int ngroups ; bzero ( xcr , sizeof ( * xcr ) ) ; xcr -> cr_version = XUCRED_VERSION ; xcr -> cr_uid = cr -> cr_uid ; ngroups = MIN ( cr -> cr_ngroups , XU_NGROUPS ) ; xcr -> cr_ngroups = ngroups ; bcopy ( cr -> cr_groups , xcr -> cr_groups , ngroups * sizeof ( * cr -> cr_groups ) ) ; }
Fill in a struct xucred based on a struct ucred.
Fill in a struct xucred based on a struct ucred .