>Date: Fri, 17 Nov 2006 13:35:30 -0500 (EST)
>From: Glenn Fowler <gsf at research.att.com>
>
>On Fri, 17 Nov 2006 09:20:06 -0800 (PST) Don Cragun wrote:
>> >From: Glenn Fowler <gsf at research.att.com>
 ... ... ...
>
>> >is there a general rule laid out somewhere for the difference
>> >between FOO and _FOO, or is it on a name by name basis?
>
>> In general, getconf uses the <name> string specified by the underlying
>> standard.  There was, however, some some confusion in the underlying
>> standards on several <name>s.  XPG4 and XPG4v2 had a typo specifying
>> CS_PATH rather than _CS_PATH in their descriptions of getconf
>> <system_var> values.  There was an inconsistency in XPG5 between
>> normative text and examples in the c89 and getconf utility descriptions
>> as to whether a leading underscore should be present on some of the
>> programming environment <system_var> values.  Therefore, our
>> implementation allows _CS_PATH and _XBS5_* to be specified with or
>> without the leading underscore to help users who may have been confused
>> by these problems.
>
>for solaris 10 /usr/bin/getconf
>       POSIX2_* == _POSIX2_*
>except
>       POSIX2_SYMLINKS  1
>       _POSIX2_SYMLINKS invalid
>and
>       POSIX_V6_*      ok
>       _POSIX_V6_*     invalid
>except
>       POSIX_V6_ILP32_OFF32 == _POSIX_V6_ILP32_OFF32
>       POSIX_V6_ILP32_OFFBIG == _POSIX_V6_ILP32_OFFBIG
>       POSIX_V6_LP64_OFF64 == _POSIX_V6_LP64_OFF64
>       POSIX_V6_LPBIG_OFFBIG == _POSIX_V6_LPBIG_OFFBIG
>
>the POSIX2_SYMLINKS vs _ inconsistency seems like a bug, maybe it slipped
>because its a pathconf() instead of a sysconf() var?
>i.e., to be consistent with the other POSIX2_* names maybe
>_POSIX2_SYMLINKS should be accepted as an alias for POSIX2_SYMLINKS

Due to the inconsistencies mentioned before, all of the original
POSIX.2-1992 names starting with _POSIX2 are accepted with and without
the leading underscore.  POSIX2_SYMLINKS was added in
SUSv3/POSIX.1-2001.  Since there was no ambiguity in the latest version
of the standard we only added the form required by the standard.
([_]POSIX2_SYMLINKS doesn't appear in <unistd.h> nor in <limits.h>;
POSIX2_SYMLINKS is only listed in the description of the [f]pathconf()
functions.)

>
>POSIX_V6_* vs _ is self-consistent
>the category prefixes like POSIX_V6_ILP32_OFF32 allow leading _
>and the category specific values like POSIX_V6_ILP32_OFF32_LIBS do not

These are new in the last revision of the standard.  In my opinion, the
last revision of the standard is still ambiguous.  Most of the
POSIX_V6_* system_var variables (no leading underscore) that we accept
are required by the description of the getconf utility.  The real names
of the system variables (as defined by the description of <unistd.h>)
include a leading underscore.  We, therefore, chose to accept both
names.  The description of getconf doesn't specify
POSIX_V6_ILP32_OFF32, POSIX_V6_ILP32_OFFBIG, POSIX_V6_LP64_OFF64, nor
POSIX_V6_LPBIG_OFFBIG, but both underscore and non-underscore versions
are used in examples in the c99 description.  (Actually the leading
underscore versions are used as variable names there, and the versions
without leading underscores are used as option-arguments to the -v
option.  Since we don't have -v working correctly yet and since many
"normal" readers of the standard seem to miss this distinction, we
accept both forms.)

The advisory information option added variables in the last revision of
the standard in <limits.h> (POSIX_ALLOC_SIZE_MIN,
POSIX_REC_INCR_XFER_SIZE, POSIX_REC_MAX_XFER_SIZE,
POSIX_REC_MIN_XFER_SIZE, and POSIX_REC_XFER_ALIGN).  These are not
ambiguous and do not have a leading underscore.  We currently just
accept what the standard specified for these.

If you believe it is important for getconf to accept some of these with
and without the leading underscore, let me know which ones you want and
I'll file another RFE to add the missing synonyms.

 - Don

>
>-- Glenn Fowler -- AT&T Research, Florham Park NJ --


Reply via email to