Appendix E. POSIX Extensions

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

_POSIX_ADVISORY_INFO

advisory information

AIO

_POSIX_ASYNCHRONOUS_IO

asynchronous input and output

BAR

_POSIX_BARRIERS

barriers

BE

_POSIX2_PBS

batch environment services and utilities

CD

_POSIX2_C_DEV

C-language development utilities

CPT

_POSIX_CPUTIME

process CPU-time clocks

CS

_POSIX_CLOCK_SELECTION

clock selection

CX

extension to the ISO C standard (required)

FD

_POSIX2_FORT_DEV

FORTRAN development utilities

FR

_POSIX2_FORT_RUN

FORTRAN runtime utilities

FSC

_POSIX_FSYNC

file synchronization

IP6

IPV6

MC1

shorthand for ADV and either MF or SHM

MC2

shorthand for MF, SHM or MPR

_POSIX_JOB_CONTROL

job control (required)

MF

_POSIX_MAPPED_FILES

memory mapped files

ML

_POSIX_MEMLOCK

process memory locking

MLR

_POSIX_MEMLOCK_RANGE

range memory locking

MON

_POSIX_MONOTONIC_CLOCK

monotonic clock

MPR

_POSIX_MEMORY_PROTECTION

memory protection

MSG

_POSIX_MESSAGE_PASSING

message passing

MX

IEC 60559 floating-point option

OB

obsolescent

OF

output format incompletely specified

OH

optional header

PIO

_POSIX_PRIORITIZED_IO

prioritized input and output

PS

_POSIX_PRIORITY_SCHEDULING

processing scheduling

RTS

_POSIX_REALTIME_SIGNALS

realtime signals

SD

_POSIX2_SW_DEV

software development utilities

_POSIX_SAVED_IDS

process has saved set-user-ID (required)

SEM

_POSIX_SEMAPHORES

semaphores

SHM

_POSIX_SHARED_MEMORY_OBJECTS

shared memory objects

SIO

_POSIX_SYNCHRONIZED_IO

synchronized input and output

SPI

_POSIX_SPIN_LOCKS

spin locks

SPN

_POSIX_SPAWN

spawn

SS

_POSIX_SPORADIC_SERVER

process sporadic server

TCT

_POSIX_THREAD_CPUTIME

thread CPU-time clocks

TEF

_POSIX_TRACE_EVENT_FILTER

trace event filter

THR

_POSIX_THREADS

threads

TMO

_POSIX_TIMEOUTS

timeouts

TMR

_POSIX_TIMERS

timers

TPI

_POSIX_PRIO_INHERIT

thread priority inheritance

TPP

_POSIX_PRIO_PROTECT

thread priority protection

TPS

_POSIX_PRIORITY_SCHEDULING

thread execution scheduling

TRC

_POSIX_TRACE

trace

TRI

_POSIX_TRACE_INHERIT

trace inherit

TRL

_POSIX_TRACE_LOG

trace log

TSA

_POSIX_THREAD_ATTR_STACKADDR

thread stack address attribute

TSF

_POSIX_THREAD_SAFE_FUNCTIONS

thread-safe functions

TSH

_POSIX_THREAD_PROCESS_SHARED

thread process-shared synchronization

TSP

_POSIX_THREAD_SPORADIC_SERVER

thread sporadic server

TSS

_POSIX_THREAD_ATTR_STACKSIZE

thread stack address size

TYM

_POSIX_TYPED_MEMORY_OBJECTS

typed memory objects

UP

_POSIX2_UPE

user portability utilities

XSI

_XOPEN_UNIX

XSI

XSR

_XOPEN_STREAMS

XSR streams

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset