6 .Nd manipulate compatibility settings
8 .Ev COMMAND_MODE=legacy|unix2003
10 .Fd #define _POSIX_C_SOURCE
11 .Fd #define _APPLE_C_SOURE
12 .Fd #define _NONSTD_SOURCE
15 Setting the environment variable
17 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.
19 Setting the environment variable
21 to the value unix03 causes utility programs to obey the
23 standards even if doing so would alter the behavior of flags used in 10.3.
26 value is case insensitive and if it is unset or set to something other than legacy or unix03 it behaves as if it were set to unix03.
30 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 sections of the individual function calls.
37 causes library and kernel calls to conform to
39 standards even if doing so would alter the behavior of functions used in 10.3. Defining
41 also removes functions, types, and other interfaces that are not part of
43 from the normal C namespace, while
47 Failing to define any of those symbols currently acts as if you have defined
49 but it is expected that in a future OS X release the default behavior will change to be as if
53 With COMMAND_MODE set to unix2003 utility functions conform to
61 system and library calls conform to
64 Different parts of a program can be compiled with different compatibility settings. The resultant program will normally work as expected, for example a regex created by the
67 can be passed to the legacy
69 with no unexpected results. Some cases are less clear cut, for example
70 what does the programmer intend when they use the
73 to compile a regex, but the legacy
75 to execute it? Any interpretation will surprise someone.