From b72e0d5382171ed086fc50fbcf585123777c85c2 Mon Sep 17 00:00:00 2001 From: manu Date: Fri, 4 Nov 2005 16:58:14 +0000 Subject: [PATCH] Fix machine name returned by uname on Linux --- sys/compat/linux/arch/amd64/linux_machdep.h | 5 +++-- sys/compat/linux/common/linux_misc.c | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/arch/amd64/linux_machdep.h b/sys/compat/linux/arch/amd64/linux_machdep.h index 5ead3a6f241f..4cfa92686651 100644 --- a/sys/compat/linux/arch/amd64/linux_machdep.h +++ b/sys/compat/linux/arch/amd64/linux_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.h,v 1.2 2005/05/20 12:48:27 fvdl Exp $ */ +/* $NetBSD: linux_machdep.h,v 1.3 2005/11/04 16:58:14 manu Exp $ */ /*- * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved. @@ -100,7 +100,6 @@ struct linux_rt_sigframe { struct linux_siginfo info; }; - #ifdef _KERNEL __BEGIN_DECLS void linux_syscall_intern __P((struct proc *)); @@ -111,4 +110,6 @@ __END_DECLS #define LINUX_VSYSCALL_SIZE 1024 #define LINUX_VSYSCALL_MAXNR 3 +#define LINUX_UNAME_ARCH machine_arch + #endif /* _AMD64_LINUX_MACHDEP_H */ diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c index 2cd7a4df1daa..95861283ae91 100644 --- a/sys/compat/linux/common/linux_misc.c +++ b/sys/compat/linux/common/linux_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc.c,v 1.141 2005/10/30 16:25:50 chs Exp $ */ +/* $NetBSD: linux_misc.c,v 1.142 2005/11/04 16:58:14 manu Exp $ */ /*- * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.141 2005/10/30 16:25:50 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.142 2005/11/04 16:58:14 manu Exp $"); #include #include @@ -452,7 +452,11 @@ linux_sys_uname(l, v, 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_domainname, domainname, sizeof(luts.l_domainname)); return copyout(&luts, SCARG(uap, up), sizeof(luts));