Advanced Programming in the UNIX® Environment

(lily) #1
ptg10805159

54 UNIX Standardization and Implementations Chapter 2


For each option, we have three possibilities for a platform’s support status.


  1. If the symbolic constant is either undefined or defined to have the value−1, then
    the corresponding option is unsupported by the platform at compile time. It is
    possible to run an old application on a newer system wherethe optionis
    supported, so a runtime check might indicate the option is supported even
    though the option wasn’t supported at the time the application was compiled.

  2. If the symbolic constant is defined to be greater than zero, then the
    corresponding option is supported.

  3. If the symbolic constant is defined to be equal to zero, then we must call
    sysconf, pathconf,or fpathconf to determine whether the option is
    supported.


The symbolic constants used withpathconfandfpathconfaresummarized in
Figure2.18. Figure2.19 summarizes the nonobsolete options and their symbolic
constants that can be used withsysconf, in addition to those listed in Figure2.5. Note
that we omit options associated with utility commands.
As with the system limits, thereare several points to note regarding how options
aretreated bysysconf,pathconf,andfpathconf.


  1. The value returned for _SC_VERSION indicates the four-digit year and
    two-digit month of the standard. This value can be 198808L, 199009L, 199506L,
    or some other value for a later version of the standard. The value associated
    with Version 3 of the Single UNIX Specification is 200112L (the 2001 edition of
    POSIX.1). The value associated with Version 4 of the Single UNIX Specification
    (the 2008 edition of POSIX.1) is 200809L.

  2. The value returned for_SC_XOPEN_VERSIONindicates the version of the XSI
    that the system supports. The value associated with Version 3 of the Single
    UNIX Specification is 600. The value associated with Version 4 of the Single
    UNIX Specification (the 2008 edition of POSIX.1) is 700.

  3. The values_SC_JOB_CONTROL, _SC_SAVED_IDS,and_PC_VDISABLEno
    longer represent optional features. Although XPG4 and prior versions of the
    Single UNIX Specification required that these features be supported, Version 3
    of the Single UNIX Specification is the earliest version wherethese features are
    no longer optional in POSIX.1. These symbols areretained for backward
    compatibility.

  4. Platforms conforming to POSIX.1-2008 arealso required to support the
    following options:

    • _POSIX_ASYNCHRONOUS_IO

    • _POSIX_BARRIERS

    • _POSIX_CLOCK_SELECTION

    • _POSIX_MAPPED_FILES

    • _POSIX_MEMORY_PROTECTION



Free download pdf