Allow user programs to ask for a version string for the components of a locale_t. The structure of the version string is undefined, but can be used to detect changes in the locale's definition.
The intended use-case is databases that use libc collations to implement indexes. When collation definitions change, database indexes are frequently corrupted. By exposing the CLDR version string, databases can detect the change and issue an error or force an index rebuild. Without such versioning, database projects (such as PostgreSQL) are forced to move to other collation implementations (eg libicu) just to protect themselves from silent collation definition changes. Motivation discussed in slightly more detail here: https://lists.freebsd.org/pipermail/freebsd-hackers/2018-September/053289.html
For now only LC_COLLATE components have a way to report their version. The LC_COLLATE file format is backwards and forwards compatible. Where previously 24 bytes held "BSD 1.0\n" followed by NUL characters, there are now 12 bytes for the file format identifier and then 12 bytes for the data version string.
I plan to file a POSIX defect report that proposes this new interface, but that process requires an existing implementation in a real operating system.
Not yet done in this patch: the procedure for building the definitions that ship with the base system (see README and scripts under tools/tools/locale) should be updated so that some representation of the CLDR version used is passed to localedef -V (the new switch added by this patch). The exact format of the string isn't important, but whenever new CLDR version is used the string must change.