implement emul.linux.kern.machine, which can be set to "i686", like

some applications seem to want.
This commit is contained in:
mrg 2007-03-23 04:16:13 +00:00
parent 491de95b00
commit 2cdaa49944
5 changed files with 24 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc.c,v 1.168 2007/03/14 12:44:39 njoly Exp $ */
/* $NetBSD: linux_misc.c,v 1.169 2007/03/23 04:16:13 mrg Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.168 2007/03/14 12:44:39 njoly Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.169 2007/03/23 04:16:13 mrg Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ptrace.h"
@ -462,11 +462,7 @@ linux_sys_uname(struct lwp *l, void *v, register_t *retval)
strncpy(luts.l_nodename, hostname, sizeof(luts.l_nodename));
strncpy(luts.l_release, linux_release, sizeof(luts.l_release));
strncpy(luts.l_version, linux_version, sizeof(luts.l_version));
# ifdef LINUX_UNAME_ARCH
strncpy(luts.l_machine, LINUX_UNAME_ARCH, sizeof(luts.l_machine));
# else
strncpy(luts.l_machine, machine, sizeof(luts.l_machine));
# endif
strncpy(luts.l_machine, linux_machine, sizeof(luts.l_machine));
strncpy(luts.l_domainname, domainname, sizeof(luts.l_domainname));
return copyout(&luts, SCARG(uap, up), sizeof(luts));

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldolduname.c,v 1.61 2007/02/09 21:55:19 ad Exp $ */
/* $NetBSD: linux_oldolduname.c,v 1.62 2007/03/23 04:16:13 mrg Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.61 2007/02/09 21:55:19 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.62 2007/03/23 04:16:13 mrg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -69,7 +69,7 @@ linux_sys_oldolduname(struct lwp *l, void *v,
strncpy(luts.l_nodename, hostname, sizeof(luts.l_nodename));
strncpy(luts.l_release, linux_release, sizeof(luts.l_release));
strncpy(luts.l_version, linux_version, sizeof(luts.l_version));
strncpy(luts.l_machine, machine, sizeof(luts.l_machine));
strncpy(luts.l_machine, linux_machine, sizeof(luts.l_machine));
return copyout(&luts, SCARG(uap, up), sizeof(luts));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_olduname.c,v 1.61 2007/02/09 21:55:19 ad Exp $ */
/* $NetBSD: linux_olduname.c,v 1.62 2007/03/23 04:16:13 mrg Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_olduname.c,v 1.61 2007/02/09 21:55:19 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_olduname.c,v 1.62 2007/03/23 04:16:13 mrg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -71,7 +71,7 @@ linux_sys_olduname(struct lwp *l, void *v, register_t *retval)
strncpy(luts.l_nodename, hostname, sizeof(luts.l_nodename));
strncpy(luts.l_release, linux_release, sizeof(luts.l_release));
strncpy(luts.l_version, linux_version, sizeof(luts.l_version));
strncpy(luts.l_machine, machine, sizeof(luts.l_machine));
strncpy(luts.l_machine, linux_machine, sizeof(luts.l_machine));
return copyout(&luts, SCARG(uap, up), sizeof(luts));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_sysctl.c,v 1.25 2007/02/09 21:55:19 ad Exp $ */
/* $NetBSD: linux_sysctl.c,v 1.26 2007/03/23 04:16:13 mrg Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.25 2007/02/09 21:55:19 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.26 2007/03/23 04:16:13 mrg Exp $");
#if defined (_KERNEL_OPT)
#include "opt_ktrace.h"
@ -73,6 +73,7 @@ char linux_version[128] = "#0 Wed Feb 20 20:00:02 CET 2002";
char linux_release[128] = "2.0.38";
char linux_version[128] = "#0 Sun Nov 11 11:11:11 MET 2000";
#endif
char linux_machine[128] = "";
#ifndef _LKM
static
@ -114,6 +115,16 @@ SYSCTL_SETUP(linux_sysctl_setup, "linux emulated sysctl subtree setup")
NULL, 0, linux_version, sizeof(linux_version),
LINUX_KERN_VERSION, CTL_EOL);
#ifndef LINUX_UNAME_ARCH
#define LINUX_UNAME_ARCH machine
#endif
strlcpy(linux_machine, LINUX_UNAME_ARCH, sizeof(linux_machine));
sysctl_createv(clog, 0, &node, NULL,
CTLFLAG_PERMANENT,
CTLTYPE_STRING, "machine", NULL,
NULL, 0, linux_machine, sizeof(linux_machine),
LINUX_KERN_VERSION, CTL_EOL);
linux_sysctl_root.sysctl_flags &= ~CTLFLAG_READWRITE;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_types.h,v 1.25 2007/03/14 12:44:40 njoly Exp $ */
/* $NetBSD: linux_types.h,v 1.26 2007/03/23 04:16:14 mrg Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -80,6 +80,7 @@ struct linux_utsname {
extern char linux_sysname[];
extern char linux_release[];
extern char linux_version[];
extern char linux_machine[];
struct linux_tms {
linux_clock_t ltms_utime;