summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_sysctl.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2002-03-20 00:27:58 +0000
committerchristos <christos@NetBSD.org>2002-03-20 00:27:58 +0000
commit50981e06bc0f6f8c7e7f11688b166a865cfbeeb7 (patch)
tree90e00e29304d504c3db3e0d0e9dceae3d2c3bc48 /sys/compat/linux/common/linux_sysctl.c
parent195539260e24ce360b37d300ef604d9fe47e33ba (diff)
emulation specific sysctls. Also change the kernel date to nov 11 as requested
by bad.
Diffstat (limited to 'sys/compat/linux/common/linux_sysctl.c')
-rw-r--r--sys/compat/linux/common/linux_sysctl.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/sys/compat/linux/common/linux_sysctl.c b/sys/compat/linux/common/linux_sysctl.c
index 9ca8dfc1553..7cb670b492e 100644
--- a/sys/compat/linux/common/linux_sysctl.c
+++ b/sys/compat/linux/common/linux_sysctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_sysctl.c,v 1.2 2002/02/20 17:02:48 christos Exp $ */
+/* $NetBSD: linux_sysctl.c,v 1.3 2002/03/20 00:27:58 christos Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.2 2002/02/20 17:02:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.3 2002/03/20 00:27:58 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -58,6 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.2 2002/02/20 17:02:48 christos Ex
#include <compat/linux/linux_syscallargs.h>
#include <compat/linux/common/linux_sysctl.h>
+#include <compat/linux/common/linux_exec.h>
int linux_kern_sysctl(int *, u_int, void *, size_t *, void *, size_t,
struct proc *);
@@ -178,7 +179,7 @@ linux_sys___sysctl(struct proc *p, void *v, register_t *retval)
*/
char linux_sysname[128] = "Linux";
char linux_release[128] = "2.0.38";
-char linux_version[128] = "#0 Sun Apr 1 11:11:11 MET 2000";
+char linux_version[128] = "#0 Sun Nov 11 11:11:11 MET 2000";
/*
* kernel related system variables.
@@ -207,6 +208,35 @@ linux_kern_sysctl(int *name, u_int nlen, void *oldp, size_t *oldlenp,
}
/*
+ * kernel related system variables.
+ */
+int
+sysctl_linux(int *name, u_int nlen, void *oldp, size_t *oldlenp,
+ void *newp, size_t newlen, struct proc *p)
+{
+ if (nlen != 2 || name[0] != EMUL_LINUX_KERN)
+ return EOPNOTSUPP;
+
+ /*
+ * Note that we allow writing into this, so that userland
+ * programs can setup things as they see fit. This is suboptimal.
+ */
+ switch (name[1]) {
+ case EMUL_LINUX_KERN_OSTYPE:
+ return sysctl_string(oldp, oldlenp, newp, newlen,
+ linux_sysname, sizeof(linux_sysname));
+ case EMUL_LINUX_KERN_OSRELEASE:
+ return sysctl_string(oldp, oldlenp, newp, newlen,
+ linux_release, sizeof(linux_release));
+ case EMUL_LINUX_KERN_VERSION:
+ return sysctl_string(oldp, oldlenp, newp, newlen,
+ linux_version, sizeof(linux_version));
+ default:
+ return EOPNOTSUPP;
+ }
+}
+
+/*
* hardware related system variables.
*/
int