FreeBSD/sys/kern/kern_prot.c
/*
 * Allocate a zeroed cred structure.
 */
Allocate a zeroed cred structure.
Allocate a zeroed cred structure .
struct ucred *
crget(void)
{
	register struct ucred *cr;
	cr = malloc(sizeof(*cr), M_CRED, M_WAITOK | M_ZERO);
	refcount_init(&cr->cr_ref, 1);
#ifdef AUDIT
	audit_cred_init(cr);
#endif
#ifdef MAC
	mac_cred_init(cr);
#endif
	cr->cr_groups = cr->cr_smallgroups;
	cr->cr_agroups =
	    sizeof(cr->cr_smallgroups) / sizeof(cr->cr_smallgroups[0]);
	return (cr);
}
struct ucred * crget ( void ) { register struct ucred * cr ; cr = malloc ( sizeof ( * cr ) , M_CRED , M_WAITOK | M_ZERO ) ; refcount_init ( & cr -> cr_ref , 1 ) ; #ifdef AUDIT audit_cred_init ( cr ) ; #endif #ifdef MAC mac_cred_init ( cr ) ; #endif cr -> cr_groups = cr -> cr_smallgroups ; cr -> cr_agroups = sizeof ( cr -> cr_smallgroups ) / sizeof ( cr -> cr_smallgroups [ 0 ] ) ; return ( cr ) ; }
Allocate a zeroed cred structure.
Allocate a zeroed cred structure .