svn commit: r192087 - in projects/ngroups: lib/libc/gen lib/libc/rpc lib/libc/sys usr.bin/id usr.bin/newgrp usr.bin/quota usr.sbin/chown usr.sbin/chroot usr.sbin/jail usr.sbin/jexec usr.sbin/lpr/lpc

Brooks Davis brooks at FreeBSD.org
Thu May 28 18:22:29 UTC 2009


On Fri, May 15, 2009 at 01:32:52PM +1000, Bruce Evans wrote:
> On Thu, 14 May 2009, Brooks Davis wrote:
> 
>> Log:
>>  Use to value returned by sysconf(_SC_NGROUPS_MAX) in favor of
>>  NGROUPS_MAX or NGROUPS since POSIX says that NGROUPS_MAX represents a
>>  lower bound on sysconf(_SC_NGROUPS_MAX).
> 
> Actually, POSIX says that NGROUPS_MAX is identical to
> sysconf(_SC_NGROUPS_MAX) if it is defined (and the sysconf() succeeds).
> It is _POSIX_NGROUPS_MAX that gives the lower bound.  _POSIX_NGROUPS_MAX
> is always 8, except under old versions of POSIX that don't require
> supplementary groups to be supported, where it is always 0.  It is a
> bug for a POSIX implementation to define NGROUPS_MAX if its value is
> not always identical to sysconf(_SC_NGROUPS_MAX), or for a POSIX
> application to use NGROUPS_MAX unconditionally.

According to the limits.h section of POSIX.1-2008, NGROUPS_MAX is a
Runtime Increasable Value and thus NGROUPS_MAX specifies the minimum
value that implementation may use.  Given the constraint that the value
returned by sysconf(_SC_NGROUPS_MAX) not change during the life of a
process, there is probably a practical limitation that the underlying
limit be controllable at compile time or by a tunable, but not by sysctl.

I'll look over and incorporate your other comments shortly.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-projects/attachments/20090528/ae9954e2/attachment.pgp


More information about the svn-src-projects mailing list