modern syntax for asgops & inits cause Donn's latest ccom rejects the old.
[unix-history] / usr / src / lib / libc / sys / setgroups.2
CommitLineData
349834c5
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
7f398d2d 5.\" @(#)setgroups.2 6.3 (Berkeley) %G%
349834c5 6.\"
10d611fe 7.TH SETGROUPS 2 ""
349834c5
KM
8.UC 5
9.SH NAME
10setgroups \- set group access list
11.SH SYNOPSIS
12.nf
13.ft B
14#include <sys/param.h>
15.PP
16.ft B
17setgroups(ngroups, gidset)
18int ngroups, *gidset;
19.fi
20.SH DESCRIPTION
21.I Setgroups
22sets the group access list of the current user process
23according to the array
24.IR gidset .
25The parameter
26.I ngroups
27indicates the number of entries in the array and must be no
34517f62 28more than NGROUPS, as defined in
349834c5
KM
29.RI < sys/param.h >.
30.PP
31Only the super-user may set new groups.
32.SH "RETURN VALUE
33A 0 value is returned on success, \-1 on error, with
34a error code stored in \fIerrno\fP.
35.SH "ERRORS
36The \fIsetgroups\fP call will fail if:
37.TP 15
38[EPERM]
39The caller is not the super-user.
40.TP 15
41[EFAULT]
42The address specified for \fIgidset\fP is outside the process
43address space.
44.SH "SEE ALSO
45getgroups(2), initgroups(3X)
7f398d2d
MK
46.SH BUGS
47The
48.I gidset
49array should be of type
50.BR gid_t ,
51but remains integer for compatibility with earlier systems.