standards/104743: [headers] [patch] Wrong values for _POSIX_ minimal limits

Bruce Evans brde at optusnet.com.au
Wed Mar 2 02:37:58 UTC 2011


On Tue, 1 Mar 2011, Thomas Quinot wrote:

> * eadler at FreeBSD.org, 2011-03-01 :
>
>> State-Changed-From-To: open->patched
>> State-Changed-By: eadler
>> State-Changed-When: Tue Mar 1 10:14:35 EST 2011
>> State-Changed-Why:
>> committed in head (r211980) and 8 (r213655)
>>
>> http://www.freebsd.org/cgi/query-pr.cgi?pr=104743
>
> Right, I think this PR can indeed be closed now. Thanks!

I don't see any commit that correctly fixed this.  include/limits.h
now has:

% #if __POSIX_VISIBLE

__POSIX_VISIBLE means "any version of POSIX".  Many of the definitions
under this ifdef (mainly the ones changed in the patch in the PR) have
values that depend on the version of POSIX.  Thus they cannot be solely
under this ifdef.  But they are, and recent commits didn't change this
at all.  If recent commits changed the values, then they just moved
the brokenness from one version of POSIX to another.  Probably from
current POSIX to old POSIX, so it is less impportant.

% #define	_POSIX_ARG_MAX		4096
% #define	_POSIX_CHILD_MAX	25

This was 6 in POSIX.1-1988 through at least POSIX.1-2001-draft7.  The
PR initially wants to change it unconditionally back to 6.  This at
least fixes the old versions.  According to the PR followup, later
versions of POSIX change it to 25, so it needs to be ifdefed.

% #define	_POSIX_LINK_MAX		8
% #define	_POSIX_MAX_CANON	255
% #define	_POSIX_MAX_INPUT	255
% #define	_POSIX_NAME_MAX		14
% #define	_POSIX_NGROUPS_MAX	8

This was 0 in POSIX.1-1988 through at least POSIX.1-1996.  It was changed
to be 8 at least as early as POSIX.1-2001-draft7.  The PR initially wants
to change it unconditionally back to 0.  It needs to be ifdefed.

% #define	_POSIX_OPEN_MAX		20

This was 16 in POSIX.1-1988 through at least POSIX.1-1996.  It was changed
to be 20 at least as early as POSIX.1-2001-draft7.  The PR initially wants
to change it unconditionally back to 16.  It needs to be ifdefed.

% #define	_POSIX_PATH_MAX		256

This was 255 in POSIX.1-1988 through at least POSIX.1-1996.  It was changed
to be 256 at least as early as POSIX.1-2001-draft7.  The PR initially wants
to change it unconditionally back to 255.  It needs to be ifdefed.

% #define	_POSIX_PIPE_BUF		512
% #define	_POSIX_SSIZE_MAX	32767
% #define	_POSIX_STREAM_MAX	8
% #define	_POSIX_TZNAME_MAX	6

This was 3 in POSIX.1-1988 through at least POSIX.1-1996.  It was changed
to be 6 at least as early as POSIX.1-2001-draft7.  The PR initially wants
to change it unconditionally back to 3.  It needs to be ifdefed.

% ...
% #if __POSIX_VISIBLE >= 199309
% #define	_POSIX_AIO_LISTIO_MAX	2

Maybe the support for old versions of POSIX is unimportant, but if you
don't ifdef the above then you turn the careful ifdefs like this in
other parts of the file into nonsense.

Bruce


More information about the freebsd-standards mailing list