[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] freebsd-meminfo on amd64
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] freebsd-meminfo on amd64
- From: Rong-En Fan <rafan (at) infor.org>
- Date: Sun, 22 Oct 2006 18:15:32 +0800
- References: <20061022100750.GA41151@svm.csie.ntu.edu.tw>
- User-agent: Mutt/1.5.13 (2006-08-11)
On Sun, Oct 22, 2006 at 06:07:51PM +0800, Rong-En Fan wrote:
> Hi,
>
> I'm running 4.2.0 and found there is a problem of freebsd-meminfo
> on amd64. I have 2G memory and got the following:
>
> Total:2033
> Free:31335125091216
>
> Change the following line
>
> printf("Free:%lu\n", (pagesize / 1024)*(vmdata.t_free / 1024));
>
> to
>
> printf("Free:%lu\n", ((int)pagesize / 1024)*(vmdata.t_free / 1024));
>
> Then it works as expected.
This is not right. According to sysctl.h,
hw.pagesize is a int, so the correct patch should be
- unsigned long pagesize;
+ int pagesize;
Thanks,
Rong-En Fan