git: be54920c3b72 - main - cdefs: Add some notes about the different versions of POSIX

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 26 Jul 2022 03:34:06 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=be54920c3b72f0b9284ddaf95796df25dca3eaf5

commit be54920c3b72f0b9284ddaf95796df25dca3eaf5
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-07-25 22:19:28 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-07-26 03:34:34 +0000

    cdefs: Add some notes about the different versions of POSIX
    
    POSIX versions are a bit weird, so add some notes here.
    
    Sponsored by:           Netflix
---
 sys/sys/cdefs.h | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index 2295dd39f5ad..1ace5fbee787 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -637,15 +637,23 @@
  * POSIX.1 requires that the macros we test be defined before any standard
  * header file is included.
  *
- * Here's a quick run-down of the versions:
+ * Here's a quick run-down of the versions (and some informal names)
  *  defined(_POSIX_SOURCE)		1003.1-1988
+ *					encoded as 198808 below
  *  _POSIX_C_SOURCE == 1		1003.1-1990
+ *					encoded as 199009 below
  *  _POSIX_C_SOURCE == 2		1003.2-1992 C Language Binding Option
+ *					encoded as 199209 below
  *  _POSIX_C_SOURCE == 199309		1003.1b-1993
+ *					(1003.1 Issue 4, Single Unix Spec v1, Unix 93)
  *  _POSIX_C_SOURCE == 199506		1003.1c-1995, 1003.1i-1995,
  *					and the omnibus ISO/IEC 9945-1: 1996
- *  _POSIX_C_SOURCE == 200112		1003.1-2001
- *  _POSIX_C_SOURCE == 200809		1003.1-2008
+ *					(1003.1 Issue 5, Single	Unix Spec v2, Unix 95)
+ *  _POSIX_C_SOURCE == 200112		1003.1-2001 (1003.1 Issue 6, Unix 03)
+ *  _POSIX_C_SOURCE == 200809		1003.1-2008 (1003.1 Issue 7)
+ *					IEEE Std 1003.1-2017 (Rev of 1003.1-2008) is
+ *					1003.1-2008 with two TCs applied with
+ *					_POSIX_C_SOURCE=200809 and _XOPEN_SOURCE=700
  *
  * In addition, the X/Open Portability Guide, which is now the Single UNIX
  * Specification, defines a feature-test macro which indicates the version of