Date: Mon, 30 Jul 2001 22:01:47 +0200 From: Jeroen Ruigrok/Asmodai <asmodai@wxs.nl> To: Bruce Evans <bde@zeta.org.au> Cc: Robert Watson <rwatson@FreeBSD.org>, dd@FreeBSD.org, freebsd-doc@FreeBSD.org, bde@FreeBSD.org, FreeBSD Gnats <freebsd-gnats-submit@freebsd.org> Subject: Re: docs/26003: getgroups(2) lists NGROUPS_MAX but not syslimits.h Message-ID: <20010730220147.H65558@daemon.ninth-circle.org> In-Reply-To: <Pine.BSF.4.21.0104011858330.14800-100000@besplex.bde.org> References: <Pine.NEB.3.96L.1010331222140.65399B-100000@fledge.watson.org> <Pine.BSF.4.21.0104011858330.14800-100000@besplex.bde.org>
index | next in thread | previous in thread | raw e-mail
-On [20010401 13:00], Bruce Evans (bde@zeta.org.au) wrote:
>On Sat, 31 Mar 2001, Robert Watson wrote:
>
>> Dunno -- I guess this leads to a number of questions of specification-land
>> -- is NGROUPS_MAX supposed to be exposed to the application, if so, how
>> should the application go about including things to get the value, etc.
>> Bruce might have a good answer, if not a correct one, so I've CC'd him
>> :-).
>
>In POSIX.1-1996:
>
>1) NGROUPS_MAX is defined in <limits.h>. (<sys/syslimits.h> is BSD
> implementation detail, so it shouldn't be documented.)
>
>2) NGROUPS_MAX is a "Run-Time Increasable Value". This means that
> applications may find that the actual maximum number of groups is
> larger than their compile time value of NGROUPS_MAX. The run time
> maximum is given by sysconf(_SC_NGROUPS_MAX).
>
>3) Unlike some other POSIX limits, NGROUPS_MAX must be defined at
> compile time, although its value is almost useless if its run time
> value is larger. A footnote says that future revisions of POSIX.1
> are expected to permit omitting the definition of NGROUPS_MAX from
> <limits.h> to indicate that its value is variable.
Latest POSIX draft specifies:
SYNOPSIS
#include <unistd.h>
int getgroups(int gidsetsize, gid_t grouplist[]);
[...]
Applications writers should note that {NGROUPS_MAX} is not
necessarily a constant on all implementations.
[...]
Issue 6
In the SYNOPSIS, the optional include of the <sys/types.h>
header is removed.
The following new requirements on POSIX implementations derive
from alignment with the Single UNIX Specification:
· The requirement to include <sys/types.h> has been removed.
Although <sys/types.h> was required for conforming
implementations of previous POSIX specifications, it was not
required for UNIX applications.
· A return value of 0 is not permitted, because {NGROUPS_MAX}
cannot be 0. This is a FIPS requirement.
--
Jeroen Ruigrok van der Werven/Asmodai asmodai@[wxs.nl|freebsd.org|xmach.org]
Documentation nutter/C-rated Coder, finger asmodai@ninth-circle.dnsalias.net
http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/
The human race is challenged more than ever before to demonstrate our
mastery -- not over nature but of ourselves...
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010730220147.H65558>
