Module Name: src
Committed By: apb
Date: Sun Aug 3 09:15:21 UTC 2014
Modified Files:
src/share/man/man7: sysctl.7
src/sys/kern: init_sysctl.c
src/sys/sys: systm.h
Log Message:
BUILDINFO part 2: expose sysctl kern.buildinfo
To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/share/man/man7/sysctl.7
cvs rdiff -u -r1.203 -r1.204 src/sys/kern/init_sysctl.c
cvs rdiff -u -r1.264 -r1.265 src/sys/sys/systm.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.84 src/share/man/man7/sysctl.7:1.85
--- src/share/man/man7/sysctl.7:1.84 Thu Jul 17 13:42:02 2014
+++ src/share/man/man7/sysctl.7 Sun Aug 3 09:15:21 2014
@@ -1,4 +1,4 @@
-.\" $NetBSD: sysctl.7,v 1.84 2014/07/17 13:42:02 njoly Exp $
+.\" $NetBSD: sysctl.7,v 1.85 2014/08/03 09:15:21 apb Exp $
.\"
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95
.\"
-.Dd July 17, 2014
+.Dd August 3, 2014
.Dt SYSCTL 7
.Os
.Sh NAME
@@ -280,6 +280,7 @@ privilege may change the value.
.It kern.argmax integer no
.It kern.boothowto integer no
.It kern.boottime struct timeval no
+.It kern.buildinfo string no
.\".It kern.bufq node not applicable
.It kern.ccpu integer no
.It kern.clockrate struct clockinfo no
@@ -398,6 +399,9 @@ A
.Vt struct timeval
structure is returned.
This structure contains the time that the system was booted.
+.It Li kern.buildinfo
+When the kernel is built, the build environment may optionally provide
+arbitrary information to be stored in this variable.
.\" .It Li kern.bufq
.\" XXX: Undocumented.
.It Li kern.ccpu ( KERN_CCPU )
Index: src/sys/kern/init_sysctl.c
diff -u src/sys/kern/init_sysctl.c:1.203 src/sys/kern/init_sysctl.c:1.204
--- src/sys/kern/init_sysctl.c:1.203 Thu May 8 08:21:53 2014
+++ src/sys/kern/init_sysctl.c Sun Aug 3 09:15:21 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: init_sysctl.c,v 1.203 2014/05/08 08:21:53 hannken Exp $ */
+/* $NetBSD: init_sysctl.c,v 1.204 2014/08/03 09:15:21 apb Exp $ */
/*-
* Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.203 2014/05/08 08:21:53 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.204 2014/08/03 09:15:21 apb Exp $");
#include "opt_sysv.h"
#include "opt_compat_netbsd.h"
@@ -610,6 +610,19 @@ SYSCTL_SETUP(sysctl_kern_setup, "sysctl
"it doesn't"),
NULL, 1, NULL, 0,
CTL_KERN, CTL_CREATE, CTL_EOL);
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_STRING, "configname",
+ SYSCTL_DESCR("Name of config file"),
+ NULL, 0, __UNCONST(kernel_ident), 0,
+ CTL_KERN, CTL_CREATE, CTL_EOL);
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT,
+ CTLTYPE_STRING, "buildinfo",
+ SYSCTL_DESCR("Information from build environment"),
+ NULL, 0, __UNCONST(buildinfo), 0,
+ CTL_KERN, CTL_CREATE, CTL_EOL);
+
/* kern.posix. */
sysctl_createv(clog, 0, NULL, &rnode,
CTLFLAG_PERMANENT,
@@ -623,12 +636,6 @@ SYSCTL_SETUP(sysctl_kern_setup, "sysctl
SYSCTL_DESCR("Maximal number of semaphores"),
NULL, 0, &ksem_max, 0,
CTL_CREATE, CTL_EOL);
- sysctl_createv(clog, 0, NULL, NULL,
- CTLFLAG_PERMANENT,
- CTLTYPE_STRING, "configname",
- SYSCTL_DESCR("Name of config file"),
- NULL, 0, __UNCONST(kernel_ident), 0,
- CTL_KERN, CTL_CREATE, CTL_EOL);
}
SYSCTL_SETUP(sysctl_hw_setup, "sysctl hw subtree setup")
Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.264 src/sys/sys/systm.h:1.265
--- src/sys/sys/systm.h:1.264 Thu Jul 17 14:55:32 2014
+++ src/sys/sys/systm.h Sun Aug 3 09:15:21 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: systm.h,v 1.264 2014/07/17 14:55:32 riastradh Exp $ */
+/* $NetBSD: systm.h,v 1.265 2014/08/03 09:15:21 apb Exp $ */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
@@ -73,6 +73,7 @@ extern const char osrelease[]; /* short
extern const char ostype[]; /* system type */
extern const char kernel_ident[];/* kernel configuration ID */
extern const char version[]; /* system version */
+extern const char buildinfo[]; /* infomation from build environment */
extern int autonicetime; /* time (in seconds) before autoniceval */
extern int autoniceval; /* proc priority after autonicetime */