Table 1 summarizes the relationships between the feature test macros and the standards. ‘Yes’ indicates that a feature test macro makes visible the symbols related to a standard.
Feature test macros that do not apply to POSIX standards are not listed in this table.
Feature Test Macro | POSIX.1 | POSIX.1a | POSIX.2 | POSIX.4a | XPG4.2 | XPG4.2 Ext | SUSv3 |
---|---|---|---|---|---|---|---|
_ALL_SOURCE | Yes | Yes | Yes | Yes | Yes | Yes | |
_ALL_SOURCE_NO_THREADS | Yes | Yes | Yes | Yes | Yes | ||
_OE_SOCKETS | Yes | Yes | |||||
_OPEN_DEFAULT | Yes | Yes | Yes | ||||
_OPEN_SOURCE 1 | Yes | Yes | Yes | Yes | |||
_OPEN_SOURCE 2 | Yes | Yes | Yes | Yes | Yes | Yes | |
_OPEN_SOURCE 3 | Yes | Yes | Yes | Yes | Yes | Yes | |
_OPEN_SYS | Yes | Yes | Yes | Yes | |||
_OPEN_SYS_IPC_EXTENSIONS | Yes | Yes | Yes | ||||
_OPEN_SYS_PTY_EXTENSIONS | Yes | Yes | Yes | Yes | |||
_OPEN_SYS_SOCK_EXT | Yes | Yes | Yes | Yes | |||
_OPEN_THREADS | Yes | Yes | Yes | ||||
_POSIX1_SOURCE 1 | Yes | ||||||
_POSIX1_SOURCE 2 | Yes | Yes | |||||
_POSIX_C_SOURCE 1 | Yes | ||||||
_POSIX_C_SOURCE 2 | Yes | Yes | |||||
_POSIX_C_SOURCE 200112L | Yes | Yes | Yes | Yes | |||
_POSIX_SOURCE | Yes | ||||||
_XOPEN_SOURCE | Yes | Yes | Yes | ||||
_XOPEN_SOURCE_EXTENDED 1 | Yes | Yes | Yes | Yes | |||
_XOPEN_SOURCE 500 | Yes | Yes | Yes | Yes | |||
_XOPEN_SOURCE 600 | Yes | Yes | Yes | Yes | Yes | Yes |
The following feature test macros are supported:
This feature test macro exposes the following namespaces: POSIX.1, POSIX.1a, POSIX.2, POSIX.4a draft 6, XPG4, and XPG4.2, as well as additions to z/OS® UNIX drawn from Single UNIX Specification, Version 2.
In addition, defining _ALL_SOURCE makes visible a number of symbols which are not permitted under ANSI, POSIX or XPG4, but which are provided as an aid to porting C-language applications to z/OS UNIX System Services. Extensions made visible with the following feature test macros are implicit in _ALL_SOURCE:
If _OPEN_THREADS is not explicitly defined in the application, _ALL_SOURCE will define _OPEN_THREADS 1 except when any of the following are present:
_ALL_SOURCE does not expose functionality first introduced in Single UNIX Specification, Version 3 under macro definitions _XOPEN_SOURCE 600 or _POSIX_C_SOURCE 200112L, although it does tolerate interfaces made visible by defining _OPEN_THREADS to 2 or 3.
In order to stabilize the namespace, no future extensions, whether POSIX, XOPEN, or MVS™, will expand the definition of _ALL_SOURCE. Any future enhancement will require new, explicit feature test macros to add symbols to this namespace.
This feature test macro provides the same function as _ALL_SOURCE, except it does not expose threading services (_OPEN_THREADS).
In 1999, the C/C++ Runtime Library provided IEEE754 floating-point arithmetic support in support of the IBM® Java group. The Java™ language had a bit-wise requirement for its math library, meaning that all platforms needed to produce the same results as Sun Microsystems’ fdlibm (Freely Distributed LIBM) library. Therefore, Sun Microsystems’ fdlibm code was ported to the C/C++ Runtime Library to provide IEEE754 floating-point arithmetic support. Subsequent to the C/C++ Runtime Library’s 1999 release of IEEE754 floating-point math support, IBM’s Java group provided their own support of IEEE754 floating point arithmetic and no longer use the C/C++ Runtime Library for this support.
Beginning in z/OS V1R9, a subset of the original fdlibm functions are being replaced by new versions that are designed to provide improved performance and accuracy. The new versions of these functions are replaced at the existing entry points. However, as a migration aid, IBM has provided new entry points for the original fdlibm versions. Applications that take no action will automatically use the updated functions. There are two methods for accessing the original functions.
This feature test macro provides an environment for the following C/C++ functions:
Either of the above will cause the application to be running in what is called "variable" mode with respect to floating-point math functions called within the compile unit. See z/OS XL C/C++ Programming Guide for more details on the environment variable.
The second method is through a feature test macro, described here, that can be used by applications that do include <math.h> and do not define the _FP_MODE_VARIABLE feature test macro.
acos(), acosh(), asin(), asinh(), atan(), atanh(), atan2(),
cbrt(), cos(), cosh(), erf(), erfc(), exp(), expm1(), gamma(),
hypot(), lgamma(), log(), log1p(), log10(), pow(), rint(), sin(),
sinh(), tan(), tanh()
A recompile and relink of the application is required to access the original fdlibm versions.
This feature test macro makes available all interfaces associated with ISO/IEC 9899:1999 except for interfaces requiring a compiler that is designed to support C99. This feature test macro also exposes the namespace normally exposed by the _MSE_PROTOS feature test macro, unless _NOISOC99_SOURCE is defined. The _ISOC99_SOURCE feature test macro is not required when a compiler that is designed to support C99 is used.
The _LARGE_FILES feature test macro enables certain functions to operate on MVS data sets and z/OS UNIX files that are larger than 2 GB in size and VSAM extended addressability data sets larger than 4 GB in size. When this feature test macro is selected it must be used in conjunction with the compiler option LANGLVL(LONGLONG) to activate the long long data type.
creat(), fcntl(), fgetpos(), fopen(), freopen(), fseek(), fseeko(),
fsetpos(), fstat(), ftell(), ftello(), ftruncate(), getrlimit(),
lockf(), lseek(), lstat(), mmap(), open(), read(), setrlimit(),
stat(), truncate(), write()
The _LARGE_FILES feature test macro also enables the fseeko() and ftello() functions to operate on MVS data sets larger than 2 GB and VSAM data sets larger than 4 GB by expanding the parameter and return type width to 64 bits. The fgetpos(), fopen(), freopen(), and fsetpos() functions implicitly support operations on these sized data sets and therefore do not require the _LARGE_FILES feature test macro to be defined.
This feature test macro is provided for AMODE 31 applications that need access to AMODE 64 values. Use of large memory support requires LANGLVL(LONGLONG).
This feature test macro exposes new typedefs, structures, and functions so that an application can work with constructed calendar times up to and including the artificial limit of 23:59:59 on December 31, 9999 UTC.
access(), asctime(), atof(), atoi(), atol(), chdir(), chmod(),
chown(), creat(), ctime(), dllload(), dllqueryfn(), dynalloc()
ecvt(), execv(), execve(), execvp(), fcvt(), fdopen(), fopen(),
freopen(), ftok(), gcvt(), getcwd(), getenv(), getgrnam(),
gethostbyaddr(), gethostbyname(), gethostname(), getlogin(),
getopt(), getpass(), getpwnam(), getpwuid(), getservbyname(),
getwd(), inetaddr(), inet_ntoa(),isalnum(), isalpha(), iscntrl(),
isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(),
isupper(), isxdigit(), link(), localeconv(), mbstowcs(), mbtowc(),
mkdir(), mknod(), mktemp(), nl_langinfo(), open(), opendir(),
perror(), popen(), ptsname(), putenv(), readdir(), regcomp(),
remove(), rename(), rexec(), rmdir(), scanf(), setenv(), setkey(),
setlocale(), setvbuf(), sprintf(), sscanf(), stat(), statvfs(),
strcasecmp(), strerror(), strncasecmp(), strtod(), strtol(),
strtoul(), system(), tempnam(), tmpnam(), toascii(), tolower(),
toupper(), uname(), unlink(), utime(), utimes()
Programs compiled with the LONGNAME compiler option and which use POSIX functions must define _LONGMAP when using the Prelinker outside of a z/OS UNIX shell environment.
The _MSE_PROTOS feature test macro does the following:
This feature test macro prevents exposure of new interfaces that are part of the C99 standard. This feature test macro must be defined before inclusion of the first header in order to prevent new C99 interfaces from being exposed.
This feature test macro defines a BSD-like socket interface for the function prototypes and structures involved. This can be used with _XOPEN_SOURCE_EXTENDED 1 and the XPG4.2 socket interfaces will be replaced with the BSD-like interfaces.
When defined to 0, and if no other feature test macro is defined, then all symbols will be visible. If in addition to _OPEN_DEFAULT only POSIX and/or XPG4 feature test macros are defined, then only the symbols so requested will be visible. Otherwise, additional symbols (for example, those visible when the LNGLVL(EXTENDED) compiler options specified), may be exposed.
When defined to 1, this provides the base level of z/OS UNIX functionality, which is POSIX.1, POSIX.1a and POSIX.2.
This feature test macro defines an interface which enables use of select(), selectex() and poll() to monitor message and file descriptors.
When defined to 1, this defines all of the functionality that was available on MVS 5.1. This macro is equivalent to specifying _OPEN_SYS.
When defined to 2, this defines all of the functionality that is available on MVS 5.2.2, including XPG4, XPG4.2, and all of the z/OS UNIX extensions.
When defined to 3, this macro is equivalent to specifying _ALL_SOURCE.
If _OPEN_THREADS is not explicitly defined in the application, _OPEN_SOURCE will define _OPEN_THREADS 1 except when any of the following are present:
When defined to 1, this indicates that symbols required by POSIX.1, POSIX.1a, POSIX.2 are made visible. Any symbols defined by the _OPEN_THREADS macro are allowed.
If _OPEN_THREADS is not explicitly defined in the application, _OPEN_SYS will define _OPEN_THREADS 1 except when any of the following are present:
Additional symbols can be made visible if any of the exposed standards explicitly allows the symbol to appear in the header in question or if the symbol is defined as a z/OS UNIX System Services extension.
This feature test macro defines the interface and function prototypes for __opendir2() and __readdir2().
When defined to any value with #define, _OPEN_SYS_FILE_EXT indicates that symbols required for file conversion, file tagging, and file attributes manipulation functionality are made visible.
When defined to 1, this feature test macro exposes BSD-like socket definitions found in <net/if.h> and <sys/ioctl.h> that are needed to manipulate network interfaces. This feature test macro is made available beginning with z/OS V1R9.
This feature test macro defines z/OS UNIX extensions to the X/Open InterProcess Communications functions. When _OPEN_SYS_IPC_EXTENSIONS is defined, the POSIX.1, POSIX.1a, and the XPG4 symbols are visible. This macro should be used in conjunction with _XOPEN_SOURCE.
This feature test macro allows pthread condition variables and mutexes in shared memory. When this feature is defined, pthread_mutex_t and pthread_cond_t will grow significantly in size.
When either _XOPEN_SOURCE 600 or _UNIX03_THREADS are defined, the namespace includes all elements made visible by the _OPEN_SYS_MUTEX_EXT macro. In this case, _OPEN_SYS_MUTEX_EXT is redundant and does not need to be defined by the application.
This feature test macro defines z/OS UNIX extensions to the X/Open Pseudo TTY functions. When _OPEN_SYS_PTY_EXTENSIONS is defined, the POSIX.1, POSIX.1a, XPG4, and XPG4.2 symbols are visible. This macro should be used in conjunction with _XOPEN_SOURCE_EXTENDED 1.
This feature test macro defines the interface for function prototypes and structures for the extended sockets and bulk mode support.
This feature test macro defines the function prototype and interfaces for accept_and_recv().
This feature test macro defines the function prototypes and interfaces for multicast source filtering.
This feature test macro defines interfaces in netinet/in.h used for sending UDP reply packets on the same inbound interface as the request arrived.
When defined, indicates that symbols related to Internet Protocol Version 6 (IPv6) are made visible.
Defining _XOPEN_SOURCE to 600 will expose the IPv6 symbols required in Single Unix Specification, Version 3. However, these symbols only comprise a subset of the complete namespace associated with _OPEN_SYS_SOCK_IPV6. Although an application is allowed to define both macros, such an application may not be strictly conforming to Single UNIX Specification, Version 3.
When defined to 1, this indicates that symbols required by POSIX.1, POSIX.1a, and POSIX.4a(draft 6) are made visible.
When defined to 2, additional pthread functions introduced in z/OS V1R07 from Single UNIX Specification, Version 3 are made visible, along with those made visible when this is defined to 1. The following symbols are added to the namespace when _OPEN_THREADS is defined to 2:
Interfaces | Constants |
---|---|
pthread_getconcurrency() | PTHREAD_CANCEL_ENABLE |
pthread_setconcurrency() | PTHREAD_CANCEL_DISABLE |
pthread_setcancelstate() | PTHREAD_CANCEL_DEFERRED |
pthread_setcanceltype() | PTHREAD_CANCEL_ASYNCHRONOUS |
pthread_sigmask() | |
pthread_testcancel() | |
pthread_key_delete() |
When defined to 3, all pthread functions required for the Threads option of Single UNIX Specification, Version 3 are exposed, although behavior and function signatures are still based on the POSIX.4a draft 6 specification. In addition to the symbols exposed by _OPEN_THREADS 2, _OPEN_THREADS 3 adds the following symbols to the namespace:
Interfaces | Constants |
---|---|
pthread_atfork() | PTHREAD_CANCEL_CANCELED |
pthread_attr_getguardsize() | PTHREAD_COND_INITIALIZER |
pthread_attr_getschedparam() | PTHREAD_CREATE_DETACHED |
pthread_attr_getstack() | PTHREAD_CREATE_JOINABLE |
pthread_attr_getstackaddr() | PTHREAD_EXPLICIT_SCHED |
pthread_attr_setguardsize() | |
pthread_attr_setschedparam() | |
pthread_attr_setstack() | |
pthread_attr_setstackaddr() |
Thread interfaces listed above and first exposed by _OPEN_THREADS 2 or 3 are fully compliant with Single UNIX Specification, Version 3. However, the other threading interfaces in the library will not exhibit the new behavior or use function signatures changed in the new standard. Applications that define _UNIX03_THREADS or _XOPEN_SOURCE 600 will obtain threads support that complies fully with Single UNIX Specification, Version 3.
If _OPEN_THREADS is defined with _XOPEN_SOURCE 600, _OPEN_THREADS takes precedence and overrides the default threads behavior of _XOPEN_SOURCE 600. However, _OPEN_THREADS and _UNIX03_THREADS are mutually exclusive.
When defined to any value with #define, it indicates that symbols required by POSIX.1 are made visible. Additional symbols can be made visible if POSIX.1 explicitly allows the symbol to appear in the header in question.
This feature test macro provides access to POSIX and XPG4 external variables of an application from a dynamically loaded module such as a DLL. For those external variables that have a function to access a thread-specific value, it provides access to the thread-specific value of the external variable without having to explicitly invoke the function.
Individual variables can be externalized by using the feature test macros prefixed with _SHR_ and the feature test macros that are shown as follows. The entire set can be accessed by defining _SHARE_EXT_VARS.
To share access to the daylight external variable from a dynamically loaded module such as a DLL, define the _SHR_DAYLIGHT feature test macro and include time.h in your program source.
If you have declared char **environ in your program and want to access the environment variable array from a dynamically loaded module such as a DLL, define the _SHR_ENVIRON feature test macro and include stdlib.h in the program source.
To share access to the h_errno external variable from a dynamically loaded module such as a DLL, define the _SHR_H_ERRNO feature test macro and include netdb.h in your program source.
To share access to the __loc1 external variable from a dynamically loaded module such as a DLL, define _SHR__LOC1 feature test macro and include libgen.h in your program source.
To share access to the loc1 external variable from a dynamically loaded module such as a DLL, define _SHR_LOC1 feature test macro and include regexp.h in your program source.
To share access to the loc2 external variable from a dynamically loaded module such as a DLL, define _SHR_LOC2 feature test macro and include regexp.h in your program source.
To share access to the locs external variable from a dynamically loaded module such as a DLL, define _SHR_LOCS feature test macro and include regexp.h in your program source.
To share access to the optarg external variable from a dynamically loaded module such as a DLL, define the _SHR_OPTARG feature test macro and include unistd.h or stdio.h in your program source.
To share access to the opterr external variable from a dynamically loaded module such as a DLL, define the _SHR_OPTERR feature test macro and include unistd.h or stdio.h in your program source.
To share access to the optind external variable from a dynamically loaded module such as a DLL, define _SHR_OPTIND feature test macro and include unistd.h or stdio.h in your program source.
To share access to the optopt external variable from a dynamically loaded module such as a DLL, define the _SHR_OPTOPT feature test macro and include unistd.h or stdio.h in your program source.
To share access to the signgam external variable from a dynamically loaded module such as a DLL, define the _SHR_SIGNGAM feature test macro and include math.h in your program source.
To share access to the t_errno external variable from a dynamically loaded module such as a DLL, define the _SHR_T_ERRNO feature test macro and include xti.h in your program source.
To share access to the timezone external variable from a dynamically loaded module such as a DLL, define the _SHR_TIMEZONE feature test macro and include time.h in your program source. To avoid name space pollution when _SHR_TIMEZONE is defined, the timezone variable must be referred to as _timezone.
To share access to the tzname external variable from dynamically loaded module such as a DLL, define the _SHR_TZNAME feature test macro and include time.h in your program source.
This feature test macro is required by C++ applications wishing to expose macros for integer constants as documented in <stdint.h>.
This feature test macro is required by C++ applications wishing to expose macros for format specifiers as documented in <inttypes.h>.
This MACRO will be added to the C99 DFP specification (for C and C++). The user will define this MACRO when DFP support is wanted. It will cause all DFP-oriented definitions in <math.h> and other headers to be exposed if __IBM_DFP is defined.
This feature test macro is required by C++ applications wishing to expose limits of specified-width integer types and limits of other integer types as documented in <stdint.h>.
This feature test macro exposes the C++ TR1 C99 name space as described in Chapter 8 of ISO/IEC DTR 19768: Draft Technical Report on C++ Library Extensions.
When both the _TR1_C99 and _AIX_COMPATIBILITY Feature Test Macros are defined, the _AIX_COMPATIBILITY takes precedence. This affects the copysign(), scalbn(), and the floating point classification functions.
When both the _TR1_C99 and _FP_MODE_VARIABLE feature test macros are defined, float overloads are not supported for the following functions:
atan2(), copysign(), fdim(), fma(), fmax(), fmin(), fmod(), frexp(), hypot(), ldexp(), modf(), nextafter(), nexttoward(), pow(), remainder(), remquo(), scalbln(), and scalbn()
Also, when both the _TR1_C99 and _FP_MODE_VARIABLE feature test macros are set, the long double overloads are not supported for frexp() and ldexp().
This feature test macro requires the use of the z/OS V1.10 z/OS XL C++ compiler or later.
This feature test macro exposes new Single UNIX Specification, Version 3 interfaces. It does not change the behavior of existing APIs, nor expose interfaces controlled by feature test macros such as _XOPEN_SOURCE_EXTENDED. Functions and behavior exposed by _UNIX03_SOURCE are a subset and not the complete implementation of the Single UNIX Specification, Version 3. To expose the full Single UNIX Specification, Version 3 implementation available in the C/C++ Runtime, see _XOPEN_SOURCE or _POSIX_C_SOURCE.
Release | Interfaces Exposed with _UNIX03_SOURCE |
---|---|
z/OS V1R6 | dlclose(), dlerror(), dlopen(), dlsym() |
z/OS V1R7 | sched_yield(), strerror_r(), unsetenv() |
z/OS V1R8 | flockfile(), ftrylockfile(), funlockfile(), getc_unlocked(), getchar_unlocked(), putc_unlocked(), putchar_unlocked() |
z/OS V1R9 | posix_openpt(), pselect(), sockatmark() |
This feature test exposes all pthread functions, function signatures, and behaviors required for the Threads option of Single UNIX Specification, Version 3. The macro is available for compiles targeting z/OS V1R9 or later.
Defining _UNIX03_THREADS exposes the content covered by feature test macro _OPEN_SYS_MUTEX_EXT, so that the latter is redundant and need not be defined with _UNIX03_THREADS.
It is not necessary to define this feature test macro, if _XOPEN_SOURCE is defined to 600. Unless _OPEN_THREADS is defined, _XOPEN_SOURCE 600 will make available the same interfaces and behaviors as _UNIX03_THREADS.
_UNIX03_THREADS and _OPEN_THREADS are mutually exclusive.
Defining this feature test macro exposes any language elements, previously in the Legacy Feature Group or marked obsolescent, that have been removed from Single Unix Specification, Version 3. These elements would not otherwise be visible in the namespace exposed by compiling with _XOPEN_SOURCE 600 or POSIX_C_SOURCE 200112L.
The following withdrawn symbols are exposed when _UNIX03_WITHDRAWN is defined:
Functions | Constants |
---|---|
brk() | CLOCK_TICKS |
chroot() | IUCLC |
cuserid() | L_cuserid |
gamma() | NOSTR |
getdtablesize() | OLCUC |
getpagesize() | PASS_MAX |
getpass() | _SC_2_ C_VERSION |
getw() | _SC_PASS_MAX |
putw() | _SC_XOPEN_XCU_VERSION |
regcmp() | TMP_MAX |
regex() | XCASE |
sbrk() | YESSTR |
sigstack() | |
ttyslot() | |
valloc() | External Variable |
wait3() | __loc1 |
This feature test macro allows users of the va_arg, va_end, and va_start macros to define the va_list type differently.
This feature test macro defines the functionality defined in the XPG4 standard dated July 1992.
When defined to 500, this feature test macro makes available certain key functions that are associated with Single UNIX Specification, Version 2.
When defined to 600, this feature test macro exposes the complete implementation of the Single UNIX Specification, Version 3, including the namespace defined by _POSIX_C_SOURCE 200112L as well as namespaces associated with the X/Open System Interface (XSI) extension and these options and option groups:
The use of _XOPEN_SOURCE 600 exposes namespaces covered by several other feature test macros, and as such, makes those macros redundant. The following need not be defined when _XOPEN_SOURCE 600 is defined:
_ISOC99_SOURCE | _POSIX_C_SOURCE |
_UNIX03_THREADS | _OPEN_SYS_MUTEX_EXT |
_UNIX03_SOURCE | _POSIX_SOURCE |
_XOPEN_SOURCE_EXTENDED |
If _OPEN_THREADS is defined with _XOPEN_SOURCE 600, _OPEN_THREADS takes precedence and overrides Single UNIX Specification, Version 3 threads behavior. Whenever _OPEN_THREADS is in effect, the _OPEN_SYS_MUTEX_EXT extensions are also dropped, unless the application explicitly defines this macro.
The _XOPEN_SOURCE 600 definition is available beginning with z/OS V1R9. Targeting earlier releases will result in an error during compile-time.
Full support of Single UNIX Specification, Version 3 requires use of a C99 compliant compiler. Most of the namespace is available to older compilers, but some elements of Version 3 ( such as . <complex.h> or <tgmath.h> ) will not be visible.
When defined to 1, this defines the functionality defined in the XPG4 standard plus the set of “Common APIs for UNIX-based Operating Systems”, April, 1994, draft.