Defect Report concerning: IEEE Std. 1003.2-1992, ISO/IEC 9945-2:1993 - Shell & Utilities
Clause: 4.26
PASC Interpretation Ref: pasc-1003.2-89
Topic: getconf


This is an unapproved interpretation of PASC 1003.2-1992, ISO/IEC 9945-2:1993 - Shell & Utilities.

Use of the information contained in this unapproved document is at your own risk.

Last update: 20 April,2001


								1003.2-92  #89

 _____________________________________________________________________________

	Interpretation Number:	XXXX
	Topic:			getconf
	Relevant Sections:	4.26


Interpretation Request: (Defect Report)
-----------------------


	Date: Wed, 30 Nov 1994 11:56:58 -0800

I would like to request an official, binding interpretation from the
IEEE concerning the following point in IEEE Std 1003.2-1992 (POSIX.2).

Subclause 4.26 of POSIX.2 specifies the semantics of the "getconf"
utility, and in particular subclause 4.26.6.1 describes the standard
output of "getconf".  This section says:

	If the specified variable is defined on the system and its
	value is described to be available from the function in 7.8.1
	[confstr() in the C binding], its value shall be written in
	the following format:

		"%s\n", <value>

	Otherwise, if the specified variable is defined on the system,
	its value shall be written in the following format:

		"%d\n", <value>

	If the specified variable is valid, but is undefined on the
	system, getconf shall write using the following format:

		"undefined\n"

	If the variable name is invalid or an error occurs, nothing
	shall be written to standard output.

My question has to do with the meaning of the phrases "the specified
variable is defined on this system" and "the specified variable is
valid, but is undefined on the system", when the variable in question
is one of those listed in Table 2-19 in subclause 2.13.2 of POSIX.2.
If an implementation wishes to indicate that it does not support the
facilities associated with one of the symbols listed in this table,
then must a call to

	getconf <symbol>

write
	"undefined\n"

to standard output, or is it conforming for such an implementation
to write

	"-1\n"

to standard output?  Relevant text in subclause 2.13.2 reads:

	Each of these symbols shall be considered valid names
	by the implementation.  Each shall be defined on the
	system with a value of 1 if the corresponding option is
	supported; otherwise the symbol shall be undefined.

One can interpret this to mean that the only valid outputs from such a
call to "getconf" are "undefined" or "-1", or one can interpret it to
mean that "getconf" can write anything, and that anything other than
"1" is to be interpreted as indicating that the symbol is undefined.
Which of these interpretations is correct?

Thank you for your attention to this matter.


IEEE Interpretation for 1003.2-1992
-----------------------------------

In the description of getconf it says that if the symbol is defined 
on the system, it prints that value.  If it is valid, but undefined 
getconf shall write "undefined" as described in section 4.26.6.1.

For the value from table 2-19, section 2.13.2 specifies that the corresponding
value shall be 1 if the option is supported.  Otherwise, the symbol is
undefined.

Putting these two together, getconf shall either print the value 1 or 
the string "undefined" for the symbols listed in table 2-19.

The standard clearly states behavior for getconf and conforming 
implementations must conform to this.

Rationale
-------------
None.

Forwarded to Interpretations group: 1 Dec 94

Response received: Feb 10 1995
Proposed Resoln forwarded: 13th Feb 1995
Finalised: March 28th 1995
 _____________________________________________________________________________