diff options
author | Jilles Tjoelker <jilles@FreeBSD.org> | 2011-01-21 22:15:17 +0000 |
---|---|---|
committer | Jilles Tjoelker <jilles@FreeBSD.org> | 2011-01-21 22:15:17 +0000 |
commit | 198c89c3064c9d12b761e2b76b0e8489d6073d4e (patch) | |
tree | 8e1c2bba088c967725daebb442284d043fcac648 /lib | |
parent | cd2895aab0b00a8493c0da56562c8cf4bac13e78 (diff) | |
download | src-198c89c3064c9d12b761e2b76b0e8489d6073d4e.tar.gz src-198c89c3064c9d12b761e2b76b0e8489d6073d4e.zip |
getgroups(2): Remove mention of <sys/param.h> and refer to sysconf(3).
Because {NGROUPS_MAX} may become variable, its value should be obtained
using sysconf(3). If a #define is used anyway, it should be obtained by
including <limits.h> as that is in POSIX like getgroups(2) itself is.
<sys/param.h> is not in POSIX.
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=217704
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/sys/getgroups.2 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/libc/sys/getgroups.2 b/lib/libc/sys/getgroups.2 index c02b2290e7a1..66238a15ce90 100644 --- a/lib/libc/sys/getgroups.2 +++ b/lib/libc/sys/getgroups.2 @@ -28,7 +28,7 @@ .\" @(#)getgroups.2 8.2 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd March 5, 1999 +.Dd January 21, 2011 .Dt GETGROUPS 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/param.h .In unistd.h .Ft int .Fn getgroups "int gidsetlen" "gid_t *gidset" @@ -66,6 +65,12 @@ is zero, returns the number of supplementary group IDs associated with the calling process without modifying the array pointed to by .Fa gidset . +.Pp +The value of +.Dv {NGROUPS_MAX} +should be obtained using +.Xr sysconf 3 +to avoid hard-coding it into the executable. .Sh RETURN VALUES A successful call returns the number of groups in the group set. A value of -1 indicates that an error occurred, and the error @@ -88,7 +93,8 @@ an invalid address. .El .Sh SEE ALSO .Xr setgroups 2 , -.Xr initgroups 3 +.Xr initgroups 3 , +.Xr sysconf 3 .Sh STANDARDS The .Fn getgroups |