Lines Matching refs:ngrp
92 static void crsetgroups_locked(struct ucred *cr, int ngrp,
307 u_int ngrp;
311 ngrp = cred->cr_ngroups;
317 if (uap->gidsetsize < ngrp)
320 error = copyout(cred->cr_groups, uap->gidset, ngrp * sizeof(gid_t));
322 td->td_retval[0] = ngrp;
837 kern_setgroups(struct thread *td, u_int ngrp, gid_t *groups)
843 MPASS(ngrp <= ngroups_max + 1);
844 AUDIT_ARG_GROUPSET(groups, ngrp);
846 crextend(newcred, ngrp);
851 error = mac_cred_check_setgroups(oldcred, ngrp, groups);
860 if (ngrp == 0) {
869 crsetgroups_locked(newcred, ngrp, groups);
2057 crsetgroups_locked(struct ucred *cr, int ngrp, gid_t *groups)
2063 KASSERT(cr->cr_agroups >= ngrp, ("cr_ngroups is too small"));
2065 bcopy(groups, cr->cr_groups, ngrp * sizeof(gid_t));
2066 cr->cr_ngroups = ngrp;
2076 for (i = 2; i < ngrp; i++) {
2089 crsetgroups(struct ucred *cr, int ngrp, gid_t *groups)
2092 if (ngrp > ngroups_max + 1)
2093 ngrp = ngroups_max + 1;
2095 crextend(cr, ngrp);
2096 crsetgroups_locked(cr, ngrp, groups);