date and time created 90/06/23 17:20:37 by trent
[unix-history] / usr / src / lib / libc / sys / setgroups.2
CommitLineData
88b3ccf2
KB
1.\" Copyright (c) 1983 The Regents of the University of California.
2.\" All rights reserved.
349834c5 3.\"
88b3ccf2
KB
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15.\"
16.\" @(#)setgroups.2 6.5 (Berkeley) %G%
349834c5 17.\"
10d611fe 18.TH SETGROUPS 2 ""
349834c5
KM
19.UC 5
20.SH NAME
21setgroups \- set group access list
22.SH SYNOPSIS
23.nf
24.ft B
25#include <sys/param.h>
26.PP
27.ft B
28setgroups(ngroups, gidset)
29int ngroups, *gidset;
30.fi
31.SH DESCRIPTION
32.I Setgroups
33sets the group access list of the current user process
34according to the array
35.IR gidset .
36The parameter
37.I ngroups
38indicates the number of entries in the array and must be no
34517f62 39more than NGROUPS, as defined in
349834c5
KM
40.RI < sys/param.h >.
41.PP
42Only the super-user may set new groups.
43.SH "RETURN VALUE
44A 0 value is returned on success, \-1 on error, with
45a error code stored in \fIerrno\fP.
46.SH "ERRORS
47The \fIsetgroups\fP call will fail if:
48.TP 15
49[EPERM]
50The caller is not the super-user.
51.TP 15
52[EFAULT]
53The address specified for \fIgidset\fP is outside the process
54address space.
55.SH "SEE ALSO
a81bfa3e 56getgroups(2), initgroups(3)
7f398d2d
MK
57.SH BUGS
58The
59.I gidset
60array should be of type
61.BR gid_t ,
62but remains integer for compatibility with earlier systems.