Subject: Re: bin/14172
To: <>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 12/04/2002 22:52:32
> I reread David's email, right now sysconf returns the
> value of  _SC_NGROUPS_MAX, not -1 or 0. So, do we want
> to change it so if we compare  _SC_NGROUPS_MAX to
> NGROUPS_MAX and there is a problem, sysconf returns a -1?

Erm _SC_NGROUPS_MAX is the tag for sysconf() the value returned
is NGROUPS_MAX (or maybe NGROUPS) as defined when the kernel was
compiled.  In posix terms the actual limit is {NGROUPS_MAX}, this
need not exist (ie there need not be a limit!) in which case
sysconf will return -1.

> Here is the opengroup man page (you may need to "register"):
> http://www.opengroup.org/onlinepubs/007904975/functions/sysconf.html
> 
> According to the Application Usage section, a -1 should be
> returned. The questions is, does sysconf return the -1 after
> some sort of comparison (as I think David alluded to) or
> does the caller simply do it?

The 'Return Value' of the posix page says:
	If the variable corresponding to name has no limit, sysconf() shall
	return -1 without changing the value of errno.  Note that indefinite
	limits do not imply infinite limits;

This is most likely true for {PATH_MAX} - when the limit shouldn't be used
to allocate an array.

	David

-- 
David Laight: david@l8s.co.uk