xref: /minix3/minix/lib/libc/sys/setgroups.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #include <sys/cdefs.h>
2*433d6423SLionel Sambuc #include <lib.h>
3*433d6423SLionel Sambuc #include "namespace.h"
4*433d6423SLionel Sambuc 
5*433d6423SLionel Sambuc #include <string.h>
6*433d6423SLionel Sambuc #include <unistd.h>
7*433d6423SLionel Sambuc 
setgroups(int ngroups,const gid_t * gidset)8*433d6423SLionel Sambuc int setgroups(int ngroups, const gid_t *gidset)
9*433d6423SLionel Sambuc {
10*433d6423SLionel Sambuc   message m;
11*433d6423SLionel Sambuc 
12*433d6423SLionel Sambuc   memset(&m, 0, sizeof(m));
13*433d6423SLionel Sambuc   m.m_lc_pm_groups.ptr = (vir_bytes)gidset;
14*433d6423SLionel Sambuc   m.m_lc_pm_groups.num = ngroups;
15*433d6423SLionel Sambuc 
16*433d6423SLionel Sambuc   return(_syscall(PM_PROC_NR, PM_SETGROUPS, &m));
17*433d6423SLionel Sambuc }
18