BUILDINFO part 2: expose sysctl kern.buildinfo

This commit is contained in:
apb 2014-08-03 09:15:21 +00:00
parent 7fa1ca92e5
commit 7f8e46d66a
3 changed files with 23 additions and 11 deletions

View File

@ -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 )

View File

@ -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 kern subtree setup")
"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 kern subtree setup")
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")

View File

@ -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 system version */
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 */