Glenn Fowler writes:
> there is a mismatch between xpg4 compiled user programs and 
> /usr/xpg4/bin/getconf
> maybe I didn't get the feature test macros right for xpg4/xpg4v2?
> could you run the script on a solaris 11 machine and post the output

I get the right answers when compiling for XPG4 (as per the
standards(5) man page):

$ c89 -D_XOPEN_SOURCE -D_XOPEN_VERSION=4 foo.c -o foo
$ ./foo
PASS_MAX=8 PATH=/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin

> it is getting a bit clearer:
> a user application with PATH=$(getconf PATH) can use getconf to
> check the parameters for any other utility/application on $PATH
> but once PATH is modified, some utilities/applications may not
> correspond to getconf

I'm not quite sure I follow.  If an application uses PATH=$(getconf
PATH), then it has entered the POSIX.2 environment.  If it was
previously in XPG6, it stays there (as that's a superset), but if it
was in any "lower" environment, it goes to POSIX.2.

> for xpg in 000 300 400 402 500 600
> do
>       case $xpg in
>       600)    cc=c99 ;;
>       *)      cc=cc ;;

"cc" doesn't give you a standards-compliant XPG4 environment, per the
standards(5) man page.  It's used for SVID3 and CAE XPG3.

-- 
James Carlson, KISS Network                    <james.d.carlson at sun.com>
Sun Microsystems / 1 Network Drive         71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

Reply via email to