This manual page is for Mac OS X version 10.6.3

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



COMPAT(5)                                  BSD File Formats Manual                                 COMPAT(5)

NAME
     compat -- manipulate compatibility settings

SYNOPSIS
     COMMAND_MODE=legacy|unix2003

     #define _POSIX_C_SOURCE
     #define _DARWIN_C_SOURCE
     #define _NONSTD_SOURCE
     defined(__LP64__)

     #include <sys/cdefs.h>
     defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)

DESCRIPTION
     Setting the environment variable COMMAND_MODE to the value legacy causes utility programs to behave as
     closely to Mac OS X 10.3's utility programs as possible.  When in this mode all of 10.3's flags are
     accepted, and in some cases extra flags are accepted, but no flags that were used in 10.3 will have
     been removed or changed in meaning.  Any behavioral changes in this mode are documented in the LEGACY
     sections of the individual utilities.

     Setting the environment variable COMMAND_MODE to the value unix2003 causes utility programs to obey the
     Version 3 of the Single UNIX Specification (``SUSv3'') standards even if doing so would alter the
     behavior of flags used in 10.3.

     The value of COMMAND_MODE is case insensitive and if it is unset or set to something other than legacy
     or unix2003 it behaves as if it were set to unix2003.

32-BIT COMPILATION
     Defining _NONSTD_SOURCE causes library and kernel calls to behave as closely to Mac OS X 10.3's library
     and kernel calls as possible.  Any behavioral changes in this mode are documented in the LEGACY sec-tions sections
     tions of the individual function calls.

     Defining _POSIX_C_SOURCE or _DARWIN_C_SOURCE causes library and kernel calls to conform to the SUSv3
     standards even if doing so would alter the behavior of functions used in 10.3.  Defining
     _POSIX_C_SOURCE also removes functions, types, and other interfaces that are not part of SUSv3 from the
     normal C namespace, unless _DARWIN_C_SOURCE is also defined (i.e., _DARWIN_C_SOURCE is _POSIX_C_SOURCE
     with non-POSIX extensions).  In any of these cases, the _DARWIN_FEATURE_UNIX_CONFORMANCE feature macro
     will be defined to the SUS conformance level (it is undefined otherwise).

     Starting in Mac OS X 10.5, if none of the macros _NONSTD_SOURCE, _POSIX_C_SOURCE or _DARWIN_C_SOURCE
     are defined, and the environment variable MACOSX_DEPLOYMENT_TARGET is either undefined or set to 10.5
     or greater (or equivalently, the gcc(1) option -mmacosx-version-min is either not specified or set to
     10.5 or greater), then UNIX conformance will be on by default, and non-POSIX extensions will also be
     available (this is the equivalent of defining _DARWIN_C_SOURCE).  For version values less that 10.5,
     UNIX conformance will be off (the equivalent of defining _NONSTD_SOURCE).

64-BIT COMPILATION
     When compiling for 64-bit architectures, the __LP64__ macro will be defined to 1, and UNIX conformance
     is always on (the _DARWIN_FEATURE_UNIX_CONFORMANCE macro will also be defined to the SUS conformance
     level).  Defining _NONSTD_SOURCE will cause a compilation error.

STANDARDS
     With COMMAND_MODE set to unix2003 utility functions conform to Version 3 of the Single UNIX
     Specification (``SUSv3'').

     With _POSIX_C_SOURCE, _DARWIN_C_SOURCE, or __LP64__, system and library calls conform to Version 3 of
     the Single UNIX Specification (``SUSv3'').

BUGS
     Different parts of a program can be compiled with different compatibility settings.  The resultant pro-gram program
     gram will normally work as expected, for example a regex created by the SUSv3 regcomp(3) can be passed
     to the legacy regfree(3) with no unexpected results.  Some cases are less clear cut, for example what
     does the programmer intend when they use the SUSv3 regcomp(3) to compile a regex, but the legacy
     regexec(3) to execute it?  Any interpretation will surprise someone.

Darwin                                        October 23, 2005                                        Darwin

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation with the feedback links below.
Bug reports
Report bugs in the functionality of the described tool or API through Bug Reporter.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.

Did this document help you? Yes It's good, but... Not helpful...