FreeBSD/sys/kern/kern_prot.c
/*
 * Copy a ucred's contents from a template.  Does not block.
 */
Copy a ucred's contents from a template.  Does not block.
Copy a ucred ' s contents from a template . Does not block .
void
crcopy(struct ucred *dest, struct ucred *src)
{
	KASSERT(dest->cr_ref == 1, ("crcopy of shared ucred"));
	bcopy(&src->cr_startcopy, &dest->cr_startcopy,
	    (unsigned)((caddr_t)&src->cr_endcopy -
		(caddr_t)&src->cr_startcopy));
	crsetgroups(dest, src->cr_ngroups, src->cr_groups);
	uihold(dest->cr_uidinfo);
	uihold(dest->cr_ruidinfo);
	prison_hold(dest->cr_prison);
	loginclass_hold(dest->cr_loginclass);
#ifdef AUDIT
	audit_cred_copy(src, dest);
#endif
#ifdef MAC
	mac_cred_copy(src, dest);
#endif
}
void crcopy ( struct ucred * dest , struct ucred * src ) { KASSERT ( dest -> cr_ref == 1 , ( " " ) ) ; bcopy ( & src -> cr_startcopy , & dest -> cr_startcopy , ( unsigned ) ( ( caddr_t ) & src -> cr_endcopy - ( caddr_t ) & src -> cr_startcopy ) ) ; crsetgroups ( dest , src -> cr_ngroups , src -> cr_groups ) ; uihold ( dest -> cr_uidinfo ) ; uihold ( dest -> cr_ruidinfo ) ; prison_hold ( dest -> cr_prison ) ; loginclass_hold ( dest -> cr_loginclass ) ; #ifdef AUDIT audit_cred_copy ( src , dest ) ; #endif #ifdef MAC mac_cred_copy ( src , dest ) ; #endif }
Copy a ucred's contents from a template.
Copy a ucred ' s contents from a template .