POSIX – Is It Prescriptive or Descriptive?

posix

Is POSIX a description of how applications have implemented each specific part of UNIX in the past or is it a prescriptive norm of how UNIX must be implemented ?

If descriptive, only the features that are common to all included implementations would be valid. While any implementation have not implemented a feature, that feature is "undefined".

If prescriptive: On which theoretical framework is it based? Math? C language? Experience?

Best Answer

It's prescriptive de jure, but mostly descriptive de facto.

POSIX is a set of specifications that implementations can be matched against, including both implementations that already exist when the document is published and future implementations. So it's prescriptive.

In practice, POSIX started mostly as a common subset of existing implementations. So in this sense, it's mostly descriptive. But POSIX sometimes mandates new behavior. Most commonly, for features that existed in many implementations but with different interfaces (function names, command line options, etc.), POSIX has introduced several functions and utilities, such as pax (a replacement for tar and cpio, which were very different across Unix variants) and various posix_xxx functions. POSIX also introduced new constant and command line options; for example, for ps, “The -A option is equivalent to the BSD -g and the SVID -e. Because the two systems differed, a mnemonic compromise was selected.”. The rationale sections often explains why this or that feature was included, often mentioning which implementations already had a feature, or why a choice was made or not made between incompatible implementations.