Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src BUILDINFO part 2: expose sysctl kern.buildinfo
details: https://anonhg.NetBSD.org/src/rev/5780975f27bb
branches: trunk
changeset: 331143:5780975f27bb
user: apb <apb%NetBSD.org@localhost>
date: Sun Aug 03 09:15:21 2014 +0000
description:
BUILDINFO part 2: expose sysctl kern.buildinfo
diffstat:
share/man/man7/sysctl.7 | 8 ++++++--
sys/kern/init_sysctl.c | 23 +++++++++++++++--------
sys/sys/systm.h | 3 ++-
3 files changed, 23 insertions(+), 11 deletions(-)
diffs (104 lines):
diff -r ec10c4c7d14f -r 5780975f27bb share/man/man7/sysctl.7
--- a/share/man/man7/sysctl.7 Sun Aug 03 09:13:11 2014 +0000
+++ b/share/man/man7/sysctl.7 Sun Aug 03 09:15:21 2014 +0000
@@ -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 @@
.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 @@
.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 )
diff -r ec10c4c7d14f -r 5780975f27bb sys/kern/init_sysctl.c
--- a/sys/kern/init_sysctl.c Sun Aug 03 09:13:11 2014 +0000
+++ b/sys/kern/init_sysctl.c Sun Aug 03 09:15:21 2014 +0000
@@ -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 @@
"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_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")
diff -r ec10c4c7d14f -r 5780975f27bb sys/sys/systm.h
--- a/sys/sys/systm.h Sun Aug 03 09:13:11 2014 +0000
+++ b/sys/sys/systm.h Sun Aug 03 09:15:21 2014 +0000
@@ -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 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 */
Home |
Main Index |
Thread Index |
Old Index