3735
Comment: mention the Austin Group, punctuation
|
5397
Observe why the POSIX register is pretty empty.
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
POSIX is a standard specifying source-code compatibility for C99 and Bourne-family shell programs. | POSIX is a standard specifying source-code compatibility for C99 and Bourne-family shell programs. The latest version currently available for free is http://pubs.opengroup.org/onlinepubs/9699919799, with the part on [[http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html|Shell and Utilities]] being the most important part to read if you want to write shell scripts that will work on more than one system. An important thing to realise about POSIX is that it generally does not restrict the commands it defines. It defines what features a given command or function should **at least** implement. To take an example: POSIX defines a certain set of options for the [[http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html|grep]] command. GNU grep, and recent versions of BSD grep, include a `-o` option that output only what matched each pattern, instead of the lines that contained a match. POSIX does not define a `-o` option, but both grep implementations are POSIX compliant since they implement all the required options and behaviour described by POSIX. This means that if you use grep with the `-o` option in a script, you can't expect the script to work the same on other POSIX compliant systems. While if you only use options and features described by POSIX, you **can** expect the script to work on any POSIX compliant system. |
Line 7: | Line 11: |
= The POSIX standard = | == The POSIX standard == |
Line 9: | Line 13: |
POSIX is published by 3 different organizations; the Open Group, IEEE, and ISO/IEC. The most recent version of POSIX is POSIX-2008, 2013 edition; that is: the 2008 version of POSIX, with the 2013 technical corrigendum applied. | POSIX is published by 3 different organizations; the Open Group, IEEE, and ISO/IEC. The most recent version of POSIX is POSIX-2008, 2016 edition; that is: the 2008 version of POSIX, with the 2016 "Technical Corrigendum 2" (TC2-2016) applied (replacing the 2013 "Technical Corrigendum 1"). |
Line 11: | Line 15: |
The Open Group calls this "C138"; that is standard "C082" (2008) with update "U130" (2013) applied. | The Open Group calls the 2013 edition "C138"; that is standard "C082" (2008) with update "U130" (2013) applied. TC2-2016 is "U160", but they have not (yet?) issued a new edition of the standard with it applied. |
Line 13: | Line 17: |
IEEE calls this "IEEE Std 1003.1-2008, 2013 Edition". Prior to 1997, there were three separate core POSIX documents; 1003.0 for base definitions, 1003.1 for C, and 1003.2 for shell (there were even other non-core documents, such as 1003.5 for Ada). Because of this, you may see references to "POSIX.1" for C things and "POSIX.2" for shell things. However, in 1997, C and shell got rolled into one document. | IEEE calls this "IEEE Std 1003.1-2008", and calls TC2 "1003.1-2008/Cor 2-2016". For TC1 they issued a new edition of 1003.1, but I don't believe they've (yet?) issued a 2016 edition of it. Prior to 1997, there were three separate core POSIX documents; 1003.0 for base definitions, 1003.1 for C, and 1003.2 for shell (there were even other non-core documents, such as 1003.5 for Ada). Because of this, you may see references to "POSIX.1" for C things and "POSIX.2" for shell things. However, in 1997, C and shell got rolled into one document. |
Line 15: | Line 19: |
ISO/IEC calls the base document "ISO/IEC 9945:2009", and calls the corrigendum "ISO/IEC/IEEE 9945:2009/Cor 1:2013". | ISO/IEC calls the base document "ISO/IEC 9945:2009", and calls TC1 "ISO/IEC/IEEE 9945:2009/Cor 1:2013"; TC2 has not yet been approved by ISO. |
Line 17: | Line 21: |
So, what's up with having 3 versions? They are all the same. I don't mean equivalent, I mean the same. As a product of a Open Group/IEEE joint working group, the [[http://www.opengroup.org/austin/|Austin Group]], the Open Group and IEEE publish their versions at the same time; identical documents, except with a differing cover page. Then the IEEE version goes to ISO/IEC where it gets approved (which takes time, hence the 2009 instead of 2008), and they insert 3 new pages before the IEEE cover page (ISO cover page, PDF disclaimer/copyright statement, forward with committee information). | So, what's up with having 3 versions from different publishers? They are all the same. I don't mean equivalent, I mean the same. As a product of a Open Group/IEEE joint working group, the [[http://www.opengroup.org/austin/|Austin Group]], the Open Group and IEEE publish their versions at the same time; identical documents, except with a differing cover page. Then the IEEE version goes to ISO/IEC where it gets approved (which takes time, hence the 2009 instead of 2008), and they insert 3 new pages before the IEEE cover page (ISO cover page, PDF disclaimer/copyright statement, forward with committee information). |
Line 21: | Line 25: |
= The POSIX certification = | == The POSIX certification == |
Line 23: | Line 27: |
There is a [[http://get.posixcertified.ieee.org/|POSIX certification]]. Getting a product certified allows it to use the POSIX mark in the marketing, and allows it to be listed in the [[http://get.posixcertified.ieee.org/register.html|POSIX register]]. However, the register is pretty empty; most certified products choose to not be listed. This certification, contrary to popular myth, does not entitle a system to the UNIX name; the Open Group UNIX certification is required for that. | There is a [[http://get.posixcertified.ieee.org/|POSIX certification]]. Getting a product certified allows it to use the POSIX mark in the marketing, and allows it to be listed in the [[http://get.posixcertified.ieee.org/register.html|POSIX register]]. However, the register is pretty empty; the certification requires a (costly) yearly renewal. This certification, contrary to popular myth, does not entitle a system to the UNIX name; the Open Group UNIX certification is required for that. |
Line 25: | Line 29: |
= The Single UNIX Specification = | == The Single UNIX Specification == |
Line 27: | Line 31: |
Related to POSIX is the Single Unix Specification (SUS). Back in the day, there were many differences between SUS and POSIX, but today SUS is just POSIX+Curses. SUSv4 is literally a document set (Open Group T101) of two separate documents; Open Group C138 (POSIX-2008), and Open Group C094 (X/Open Curses, Issue 7). | Related to POSIX is the Single Unix Specification (SUS). Back in the day, there were many differences between SUS and POSIX, but today SUS is just POSIX+Curses. SUSv4 is literally a document set (Open Group T101) of two separate documents; Open Group C138 (POSIX-2008, 2013 edition), and Open Group C094 (X/Open Curses, Issue 7). |
Line 29: | Line 33: |
= The UNIX certification = | == The UNIX certification == |
POSIX is a standard specifying source-code compatibility for C99 and Bourne-family shell programs. The latest version currently available for free is http://pubs.opengroup.org/onlinepubs/9699919799, with the part on Shell and Utilities being the most important part to read if you want to write shell scripts that will work on more than one system.
An important thing to realise about POSIX is that it generally does not restrict the commands it defines. It defines what features a given command or function should **at least** implement. To take an example:
POSIX defines a certain set of options for the grep command. GNU grep, and recent versions of BSD grep, include a -o option that output only what matched each pattern, instead of the lines that contained a match. POSIX does not define a -o option, but both grep implementations are POSIX compliant since they implement all the required options and behaviour described by POSIX. This means that if you use grep with the -o option in a script, you can't expect the script to work the same on other POSIX compliant systems. While if you only use options and features described by POSIX, you **can** expect the script to work on any POSIX compliant system.
It is often claimed that POSIX is a standard for UNIX-like operating systems. Superficially, this seems true, as C and shell are the primary ways of interacting with *NIX systems, but it isn't strictly true. Totally non-UNIXy systems such as IBM z/OS are POSIX certified.
There is also a lot of confusion with the relationship between POSIX and the Single UNIX Specification (SUS), and the UNIX trademark. This article will clarify that.
The POSIX standard
POSIX is published by 3 different organizations; the Open Group, IEEE, and ISO/IEC. The most recent version of POSIX is POSIX-2008, 2016 edition; that is: the 2008 version of POSIX, with the 2016 "Technical Corrigendum 2" (TC2-2016) applied (replacing the 2013 "Technical Corrigendum 1").
The Open Group calls the 2013 edition "C138"; that is standard "C082" (2008) with update "U130" (2013) applied. TC2-2016 is "U160", but they have not (yet?) issued a new edition of the standard with it applied.
IEEE calls this "IEEE Std 1003.1-2008", and calls TC2 "1003.1-2008/Cor 2-2016". For TC1 they issued a new edition of 1003.1, but I don't believe they've (yet?) issued a 2016 edition of it. Prior to 1997, there were three separate core POSIX documents; 1003.0 for base definitions, 1003.1 for C, and 1003.2 for shell (there were even other non-core documents, such as 1003.5 for Ada). Because of this, you may see references to "POSIX.1" for C things and "POSIX.2" for shell things. However, in 1997, C and shell got rolled into one document.
ISO/IEC calls the base document "ISO/IEC 9945:2009", and calls TC1 "ISO/IEC/IEEE 9945:2009/Cor 1:2013"; TC2 has not yet been approved by ISO.
So, what's up with having 3 versions from different publishers? They are all the same. I don't mean equivalent, I mean the same. As a product of a Open Group/IEEE joint working group, the Austin Group, the Open Group and IEEE publish their versions at the same time; identical documents, except with a differing cover page. Then the IEEE version goes to ISO/IEC where it gets approved (which takes time, hence the 2009 instead of 2008), and they insert 3 new pages before the IEEE cover page (ISO cover page, PDF disclaimer/copyright statement, forward with committee information).
There are other IEEE standards bearing the "POSIX" name, but they are not important (for example, IEEE Std 1387.2-1995, containing some administration utilities).
The POSIX certification
There is a POSIX certification. Getting a product certified allows it to use the POSIX mark in the marketing, and allows it to be listed in the POSIX register. However, the register is pretty empty; the certification requires a (costly) yearly renewal. This certification, contrary to popular myth, does not entitle a system to the UNIX name; the Open Group UNIX certification is required for that.
The Single UNIX Specification
Related to POSIX is the Single Unix Specification (SUS). Back in the day, there were many differences between SUS and POSIX, but today SUS is just POSIX+Curses. SUSv4 is literally a document set (Open Group T101) of two separate documents; Open Group C138 (POSIX-2008, 2013 edition), and Open Group C094 (X/Open Curses, Issue 7).
The UNIX certification
There is not a SUS certification; instead, the Open Group has a UNIX certification--but it isn't just testing for compliance with SUS! The Open Group UNIX V7 certification tests for SUSv4, and the UNIX RBAC (Role-Based Access Control; user and group permissions), which isn't in SUS/POSIX.
Similarly to the POSIX certification, there is a register. It is more populated than the POSIX register, but still doesn't have anything listed for UNIX V7; only the previous version, UNIX 03.