summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_misc.c
diff options
context:
space:
mode:
authormanu <manu@NetBSD.org>2006-09-13 19:55:49 +0000
committermanu <manu@NetBSD.org>2006-09-13 19:55:49 +0000
commit717102f4bb9e8c8b09f23b93cdf07c4e9de56db1 (patch)
tree4a308b227f66e814d3a5570536fe6b7f832a2325 /sys/compat/linux/common/linux_misc.c
parent99bb1b27be46d5da4604db5bff5671318d10746e (diff)
Jumbo COMPAT_LINUX/COMPAT_LINUX32 bugfix, with the help of Nicolas Joly
- Fix shmat return value on amd64: it uses no black magic with retval[0] - Fix integer overflows in sysinfo - Implement sysinfo, mmap2, sched_getparam, sched_getscheduler, mremap, and madvise in COMPAT_LINUX32 - Fix improper types used in setgroups16/getgroups16 - Implement mmap2 for COMPAT_LINUX32 - Ifdef debug messages by DEBUG_LINUX
Diffstat (limited to 'sys/compat/linux/common/linux_misc.c')
-rw-r--r--sys/compat/linux/common/linux_misc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c
index 5d226ae0214..80bd9368bd9 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.161 2006/09/01 21:20:47 matt Exp $ */
+/* $NetBSD: linux_misc.c,v 1.162 2006/09/13 19:55:49 manu 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.161 2006/09/01 21:20:47 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.162 2006/09/13 19:55:49 manu Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ptrace.h"
@@ -1637,12 +1637,13 @@ linux_sys_sysinfo(l, v, retval)
si.loads[0] = la->ldavg[0] * LINUX_SYSINFO_LOADS_SCALE / la->fscale;
si.loads[1] = la->ldavg[1] * LINUX_SYSINFO_LOADS_SCALE / la->fscale;
si.loads[2] = la->ldavg[2] * LINUX_SYSINFO_LOADS_SCALE / la->fscale;
- si.totalram = ctob(physmem);
- si.freeram = uvmexp.free * uvmexp.pagesize;
+ si.totalram = ctob((u_long)physmem);
+ si.freeram = (u_long)uvmexp.free * uvmexp.pagesize;
si.sharedram = 0; /* XXX */
- si.bufferram = uvmexp.filepages * uvmexp.pagesize;
- si.totalswap = uvmexp.swpages * uvmexp.pagesize;
- si.freeswap = (uvmexp.swpages - uvmexp.swpginuse) * uvmexp.pagesize;
+ si.bufferram = (u_long)uvmexp.filepages * uvmexp.pagesize;
+ si.totalswap = (u_long)uvmexp.swpages * uvmexp.pagesize;
+ si.freeswap =
+ (u_long)(uvmexp.swpages - uvmexp.swpginuse) * uvmexp.pagesize;
si.procs = nprocs;
/* The following are only present in newer Linux kernels. */