Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jan 2008 18:20:02 GMT
From:      Garrett Wollman <wollman@csail.mit.edu>
To:        freebsd-standards@FreeBSD.org
Subject:   Re: docs/26003: getgroups(2) lists NGROUPS_MAX but not syslimits.h
Message-ID:  <200801271820.m0RIK2kP029108@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR docs/26003; it has been noted by GNATS.

From: Garrett Wollman <wollman@csail.mit.edu>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: docs/26003: getgroups(2) lists NGROUPS_MAX but not syslimits.h
Date: Sun, 27 Jan 2008 12:58:03 -0500

 <<On Sun, 27 Jan 2008 16:00:04 GMT, Bruce Evans <brde@optusnet.com.au> said:
 
 >  one (to be unportable by hard-coding NGROUPS_MAX).  The includes are
 >  already sufficient for using {NGROUPS_MAX} in its portable form
 >  sysconf(_SC_NGROUPS_MAX), except you will also need malloc().  <stdlib.h>
 >  for using malloc() is another include that doesn't belong in the
 >  synopsis.
 
 What Bruce said.  It would be better for constants such as this to be
 left completely undefined (at least when not compiling the kernel) --
 although there is the inevitable tension between handling these limits
 correctly and handling broken applications that do things like
 
 	#ifndef NGROUPS_MAX
 	#define NGROUPS_MAX 8
 	#endif
 
 Those applications, at least, are clearly wrong, so my vote would be
 on the side of breaking the applications and doing the Right Thing by
 not defining NGROUPS_MAX.
 
 -GAWollman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801271820.m0RIK2kP029108>