Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpkern Create kern.hostname sysctl node. ...
details: https://anonhg.NetBSD.org/src/rev/304bd00b5227
branches: trunk
changeset: 753533:304bd00b5227
user: pooka <pooka%NetBSD.org@localhost>
date: Wed Mar 31 18:56:07 2010 +0000
description:
Create kern.hostname sysctl node. Using init_sysctl.c for creating
the nodes requires some weeding, so don't try to use it yet.
diffstat:
sys/rump/librump/rumpkern/rump.c | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diffs (53 lines):
diff -r a284a7c1a8ce -r 304bd00b5227 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c Wed Mar 31 18:40:26 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump.c Wed Mar 31 18:56:07 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump.c,v 1.157 2010/03/31 12:16:15 pooka Exp $ */
+/* $NetBSD: rump.c,v 1.158 2010/03/31 18:56:07 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.157 2010/03/31 12:16:15 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.158 2010/03/31 18:56:07 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -162,6 +162,26 @@
}
}
+/*
+ * Create kern.hostname. why only this you ask. well, init_sysctl
+ * is a kitchen sink in need of some gardening. but i want to use
+ * kern.hostname today.
+ */
+static void
+mksysctls(void)
+{
+
+ sysctl_createv(NULL, 0, NULL, NULL,
+ CTLFLAG_PERMANENT, CTLTYPE_NODE, "kern", NULL,
+ NULL, 0, NULL, 0, CTL_KERN, CTL_EOL);
+
+ /* XXX: setting hostnamelen is missing */
+ sysctl_createv(NULL, 0, NULL, NULL,
+ CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_STRING, "hostname",
+ SYSCTL_DESCR("System hostname"), NULL, 0,
+ &hostname, MAXHOSTNAMELEN, CTL_KERN, KERN_HOSTNAME, CTL_EOL);
+}
+
int
rump__init(int rump_version)
{
@@ -306,6 +326,7 @@
panic("aiodoned");
}
+ mksysctls();
sysctl_finalize();
module_init_class(MODULE_CLASS_ANY);
Home |
Main Index |
Thread Index |
Old Index