* Copyright (c) 1983 Regents of the University of California.
* %sccs.include.redist.c%
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)initgroups.c 5.9 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
initgroups(uname
, agroup
)
int groups
[NGROUPS
], ngroups
;
if (getgrouplist(uname
, agroup
, groups
, &ngroups
) < 0)
warnx("%s is in too many groups, using first %d",
if (setgroups(ngroups
, groups
) < 0) {