.TH GETGROUPS 2 .SH NAME getgroups, setgroups \- get or set supplementary group id's .SH SYNOPSIS .ft B .nf #include #include int getgroups(int \fIgidsetlen\fP, gid_t *\fIgidset\fP) int setgroups(int \fIgidsetlen\fP, gid_t *\fIgidset\fP) .fi .ft P .SH DESCRIPTION .B Getgroups() fills the array .I gidset of length .I gidsetlen with the supplementary group id's of the current process. It returns the actual number of id's placed in the array. The return value is -1 and .B errno is set to .B EINVAL if the array is not big enough for all the id's. One may call .B getgroups with .I gidsetlen set to zero to query the number of supplementary group id's currently set for the process. The value of .I gidset is then not used. .PP .B Setgroups() may be used by a process with super-user privileges to set the supplementary group id's of the process to the .I gidsetlen group id's in the array .IR gidset . .B Setgroups returns -1 and sets .B errno to .B EINVAL if the number of id's is larger than the maximum reported by .BR sysconf (2). .SH "SEE ALSO" .BR sysconf (2), .BR initgroups (3). .SH AUTHOR Kees J. Bot (kjb@cs.vu.nl) .\" .\" $PchId: getgroups.2,v 1.3 1995/11/27 19:38:13 philip Exp $