Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > S

standards(5)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

standards — UNIX standards behavior on HP-UX

DESCRIPTION

HP-UX conforms to various UNIX standards. In some cases, these standards conflict. This manpage describes the methods that programmers and users must follow to have an application conform and execute according to a particular UNIX standard.

UNIX Standard Conformant Programmer Environment

The following table lists feature test macros and environment variables that must be defined while compiling an application. Both a feature test macro and an environment variable must be defined while compiling the application so that the application conforms and executes according to a particular UNIX standard. Otherwise, the behavior is undefined.

Standard Feature Test Macros to be Environment variable defined during compilation to be set UNIX 95 _XOPEN_SOURCE_EXTENDED=1 UNIX95 or UNIX_STD=95 or UNIX_STD=1995 UNIX 2003 _XOPEN_SOURCE=600 UNIX_STD=2003

The compiler uses the feature test macros to obtain the appropriate namespace from the header files. The compiler uses the environment variable to link in an appropriate object file to the executable. Using the environment variable customizes libc to match UNIX standards for various functions.

If an application has already been compiled for default HP-UX behavior or for one particular standard, and needs to change to a particular UNIX standard behavior, recompile the application as specified in the above table.

For an HP-UX command to conform to a particular UNIX standard behavior, the application has to set the corresponding environment variable as specified in the above table before executing that command.

UNIX Standard Conformant User Environment

To enable a particular UNIX standard conformant user environment, set the corresponding environment variable as defined in the above table.

EXAMPLES

The following examples shows an application example. To have the system be conformant to UNIX2003 behavior, set the UNIX_STD environment variable to 2003 and define the _XOPEN_SOURCE=600 feature test macro before compilation.

$ export UNIX_STD=2003 $ c99 -D_XOPEN_SOURCE=600 foo.c

The following example changes the ls command to have UNIX95 behavior by setting one of the environment variables to UNIX95 or to UNIX_STD=95 before executing that command. There are three ways of setting the environment variable for UNIX95:

  • $ export UNIX95=1 $ ls options

    or

$ export UNIX_STD=95 $ ls options

or

$ export UNIX_STD=1995 $ ls options

SEE ALSO

cc(1), stdsyms(5).

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.