git: 9e0ba9536b7c - main - param.h: Document __FreeBSD_version better

Warner Losh imp at FreeBSD.org
Wed May 5 06:35:26 UTC 2021


The branch main has been updated by imp:

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

commit 9e0ba9536b7cbba0e81e561458e95aafb65ee485
Author:     Warner Losh <imp at FreeBSD.org>
AuthorDate: 2021-04-22 16:44:15 +0000
Commit:     Warner Losh <imp at FreeBSD.org>
CommitDate: 2021-05-05 06:33:56 +0000

    param.h: Document __FreeBSD_version better
    
    Document what __FreeBSD_version means a bit better by documenting the
    sorts of events it should be bumped for. Also include a handy shorthand
    for what it means. Add a some advice for how frequently to change this
    as well.
    
    Added a note about the approved way to parse this from the param.h file,
    though that was not in the review. All in-tree users have been updated
    to this method prior to this commit. Move and reword the comment that
    was on the same line.
    
    Suggestions by:         greg at unrelenting, arch@
    Reviewed by:            rgrimes@ (earlier version).
    Sponsored by:           Netflix
    Differential Revision:  https://reviews.freebsd.org/D29850
---
 sys/sys/param.h | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/sys/sys/param.h b/sys/sys/param.h
index 92161cae13ae..a1ebced4b9a1 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -54,13 +54,29 @@
  *
  *	documentation/content/en/books/porters-handbook/versions/_index.adoc
  *
- * scheme is:  <major><two digit minor>Rxx
+ * Encoding:	<major><two digit minor>Rxx
  *		'R' is in the range 0 to 4 if this is a release branch or
  *		X.0-CURRENT before releng/X.0 is created, otherwise 'R' is
  *		in the range 5 to 9.
+ * Short hand: MMmmXXX
+ *
+ * __FreeBSD_version is bumped every time there's a change in the base system
+ * that's noteworthy. A noteworthy change is any change which changes the
+ * kernel's KBI in -CURRENT, one that changes some detail about the system that
+ * external software (or the ports system) would want to know about, one that
+ * adds a system call, one that adds or deletes a shipped library, a secuirty
+ * fix, or similar change not specifically noted here. Bumps should be limited
+ * to one per day / a couple per week except for security fixes.
+ *
+ * The approved way to obtain this from a shell script is:
+ *	awk '/^\#define[[:space:]]*__FreeBSD_version/ {print $3}'
+ * Other methods to parse this file may work, but are not guaranteed against
+ * future changes. The above script works back to FreeBSD 3.x when this macro
+ * was introduced. This number is propigated to other places needing it that
+ * cannot include sys/param.h and should only be updated here.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1400013	/* Master, propagated to newvers */
+#define __FreeBSD_version 1400013
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,


More information about the dev-commits-src-main mailing list