-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" Modified Thu Oct 31 12:04:29 1996 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
.\" 2008-05-03, mtk, expanded and rewrote parts of DESCRIPTION and RETURN
.\" VALUE, made style of page more consistent with man-pages style.
.\"
-.TH GETGROUPS 2 2010-11-22 "Linux" "Linux Programmer's Manual"
+.TH GETGROUPS 2 2014-08-19 "Linux" "Linux Programmer's Manual"
.SH NAME
getgroups, setgroups \- get/set list of supplementary group IDs
.SH SYNOPSIS
argument specifies the number of supplementary group IDs
in the buffer pointed to by
.IR list .
-.SH "RETURN VALUE"
+.SH RETURN VALUE
On success,
.BR getgroups ()
returns the number of supplementary group IDs.
.TP
.B EPERM
The calling process has insufficient privilege.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
SVr4, 4.3BSD.
The
.BR getgroups ()
.B NGROUPS_MAX
supplementary group IDs
in addition to the effective group ID.
+The constant
+.B NGROUPS_MAX
+is defined in
+.IR <limits.h> .
The set of supplementary group IDs
is inherited from the parent process, and preserved across an
.BR execve (2).
-The maximum number of supplementary group IDs can be found using
+The maximum number of supplementary group IDs can be found at run time using
.BR sysconf (3):
.nf
The maximum return value of
.BR getgroups ()
cannot be larger than one more than this value.
+Since Linux 2.6.4, the maximum number of supplementary group IDs is also
+exposed via the Linux-specific read-only file,
+.IR /proc/sys/kernel/ngroups_max .
The original Linux
.BR getgroups ()
The glibc
.BR getgroups ()
wrapper function transparently deals with the variation across kernel versions.
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR getgid (2),
.BR setgid (2),
.BR getgrouplist (3),
+.BR group_member (3),
.BR initgroups (3),
.BR capabilities (7),
.BR credentials (7)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.