The programs in the book are based on the combined UNIX standard (POSIX) as published by the IEEE in 2001 [50]. The POSIX standard consists of a base specification containing mandatory requirements and several optional extensions. Implementations that comply with this standard have the symbol _POSIX_VERSION
defined in unistd.h
as 200112L.
At the time this book was written, none of our test systems claimed to be fully compliant with even the base of this version of this POSIX standard. Table 1.3 on page 19 shows the POSIX extensions that seem to be supported by our test systems. That is, the documentation agrees with the POSIX standard and the programs from the book behave correctly. Until these systems claim compliance, we must take this on faith.
An implementation that defines _POSIX_VERSION
as 200112L must support the base standard. These systems support a particular extension if the corresponding symbol is defined in that implementation’s unistd.h
header file. Table E.1 lists the different extensions. The first column gives the code used by the POSIX manuals when describing a feature of an extension. The code appears in the margin of the manual. The second column gives the relevant symbol in unistd.h
, when appropriate. If this symbol is defined and is not equal to –1, then the corresponding extension is supported. The last column of the table describes the extension.
The proper way to check the values of these symbols is to use the sysconf
function described in Section 5.1. Call sysconf
with a name derived from the symbol by replacing POSIX
with SC
. For example, to test the value of _POSIX_THREADS
, call sysconf
with parameter _SC_THREADS
.
Table E.1. POSIX extensions. If the symbol is defined in unistd.h
, the system supports the corresponding POSIX extension.
POSIX code | symbol | extension description |
---|---|---|
ADV |
| advisory information |
AIO |
| asynchronous input and output |
BAR |
| barriers |
BE |
| batch environment services and utilities |
CD |
| C-language development utilities |
CPT |
| process CPU-time clocks |
CS |
| clock selection |
CX | extension to the ISO C standard (required) | |
FD |
| FORTRAN development utilities |
FR |
| FORTRAN runtime utilities |
FSC |
| file synchronization |
IP6 | IPV6 | |
MC1 | shorthand for ADV and either MF or SHM | |
MC2 | shorthand for MF, SHM or MPR | |
| job control (required) | |
MF |
| memory mapped files |
ML |
| process memory locking |
MLR |
| range memory locking |
MON |
| monotonic clock |
MPR |
| memory protection |
MSG |
| message passing |
MX | IEC 60559 floating-point option | |
OB | obsolescent | |
OF | output format incompletely specified | |
OH | optional header | |
PIO |
| prioritized input and output |
PS |
| processing scheduling |
RTS |
| realtime signals |
SD |
| software development utilities |
| process has saved set-user-ID (required) | |
SEM |
| semaphores |
SHM |
| shared memory objects |
SIO |
| synchronized input and output |
SPI |
| spin locks |
SPN |
| spawn |
SS |
| process sporadic server |
TCT |
| thread CPU-time clocks |
TEF |
| trace event filter |
THR |
| threads |
TMO |
| timeouts |
TMR |
| timers |
TPI |
| thread priority inheritance |
TPP |
| thread priority protection |
TPS |
| thread execution scheduling |
TRC |
| trace |
TRI |
| trace inherit |
TRL |
| trace log |
TSA |
| thread stack address attribute |
TSF |
| thread-safe functions |
TSH |
| thread process-shared synchronization |
TSP |
| thread sporadic server |
TSS |
| thread stack address size |
TYM |
| typed memory objects |
UP |
| user portability utilities |
XSI |
| XSI |
XSR |
| XSR streams |