.\" $NetBSD: setgroups.2,v 1.19 2013/07/14 14:29:09 njoly Exp $ .\" .\" Copyright (c) 1983, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)setgroups.2 8.2 (Berkeley) 4/16/94 .\" .Dd October 7, 2006 .Dt SETGROUPS 2 .Os .Sh NAME .Nm setgroups .Nd set group access list .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In sys/param.h .In unistd.h .Ft int .Fn setgroups "int ngroups" "const gid_t *gidset" .Sh DESCRIPTION .Fn setgroups sets the group access list of the current user process according to the array .Fa gidset . The parameter .Fa ngroups indicates the number of entries in the array and must be no more than .Brq Dv NGROUPS_MAX . .Pp Only the super-user may set new groups. .Pp This system call affects only secondary groups. .Sh RETURN VALUES A 0 value is returned on success, \-1 on error, with an error code stored in .Va errno . .Sh ERRORS The .Fn setgroups call will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value of .Fa ngroups is greater than .Brq Dv NGROUPS_MAX . .It Bq Er EPERM The caller is not the super-user. .It Bq Er EFAULT The address specified for .Fa gidset is outside the process address space. .El .Sh SEE ALSO .Xr getgroups 2 , .Xr setegid 2 , .Xr setgid 2 , .Xr setregid 2 , .Xr initgroups 3 .Sh HISTORY The .Fn setgroups function call appeared in .Bx 4.2 . 'left'>Commit message (Expand)Author 2019-02-10Introduce PR_ZERO to avoid open-coding memset()s everywhere. OK riastradh@.christos 2019-02-09- Change the allocation macros to be more like function callschristos 2011-05-05convert the diskqueue mutex into a kmutexmrg 2009-03-23Rework/simplify the disk queuing code. A bunch of this was stilloster 2008-06-17Mark a buffer `busy` in getnewbuf() when it came from the pool_cache sincereinoud 2008-01-02Merge vmlocking2 to head.ad 2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos 2006-11-16__unused removal on arguments; approved by core.christos 2006-10-12- sprinkle __unused on function decls.christos 2006-10-05Protect calls to pool_put/pool_get that may occur in interrupt contexttls 2006-01-08Cleanup the initialization of buffers a bit, and remove some old codeoster 2006-01-06initialize necessary members of struct buf. PR/32462 from Reinoud Zandijk.yamt 2006-01-04- add simple functions to allocate/free a buffer for i/o.yamt 2005-12-11merge ktrace-lwp.christos 2005-05-29- avoid variable shadowingchristos 2005-02-27nuke trailing whitespaceperry 2005-02-12The 'next' argument to rf_CreateDiskQueueData is always NULL. Sinceoster 2005-02-12Add a 'waitflag' argument to rf_CreateDiskQueueData() and use it tooster 2005-02-05CreateDiskQueueData() doesn't need to use void * for raidPtr.oster 2004-11-24Only touch bufpool whilst in splbio(). (That should be the caseoster 2004-03-23bufpool must be accessed at splbio().oster 2004-03-21Doesn't hurt much to zero this before we start mucking with it.oster 2004-03-07- Introduce rf_pools which contains all of the various global pools usedoster 2004-03-07- Introduce rf_pools which contains all of the various global pools usedoster 2004-03-05- remove the RF_*_INC's, as necessary. They are not needed any more.oster 2004-02-29Adjust _rf_ShutdownCreate() so that it is willing to wait for moreoster 2004-01-01Nuke a bunch of unused variables:oster 2003-12-31init_dqd and clean_dqd don't do enough to be their own functions,oster 2003-12-30Some days you wonder if some of the function declaration consistencyoster 2003-12-29_rf_create_managed_cond() is now left doing nothing. Convert callers.oster 2003-12-29_rf_create_managed_mutex() is doing just a simple:oster 2003-12-29- first kick at a major reworking of RAIDframe's memory allocation code:oster 2003-12-29[Having received a definite lack of strenuous objection, a small amountoster 2003-02-09constify somejdolecek