United States-English |
|
|
HP-UX Reference > Sstandards(5)HP-UX 11i Version 3: February 2007 |
|
NAMEstandards — UNIX standards behavior on HP-UX DESCRIPTIONHP-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 EnvironmentThe 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. EXAMPLESThe 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 UNIX_STD=95 $ ls options or $ export UNIX_STD=1995 $ ls options |
Printable version | ||
|