OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man2 / getgroups.2
index 3c47375..92fa941 100644 (file)
@@ -1,7 +1,6 @@
-.\" 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.
@@ -21,6 +20,7 @@
 .\"
 .\" 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>
@@ -28,7 +28,7 @@
 .\" 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
@@ -89,7 +89,7 @@ The
 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.
@@ -130,7 +130,7 @@ Out of memory.
 .TP
 .B EPERM
 The calling process has insufficient privilege.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 SVr4, 4.3BSD.
 The
 .BR getgroups ()
@@ -143,11 +143,15 @@ A process can have up to
 .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
 
@@ -158,6 +162,9 @@ The maximum number of supplementary group IDs can be found using
 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 ()
@@ -168,10 +175,20 @@ supporting 32-bit IDs.
 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/.