This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: *bsd & darwin support in libiberty/physmem.c
- From: Krzysztof Parzyszek <kparz at iastate dot edu>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, apinski at apple dot com, dj at redhat dot com, kparz at iastate dot edu, pfeifer at dbai dot tuwien dot ac dot at, rearnsha at arm dot com, toa at pop dot agri dot ch
- Date: Sat, 22 Feb 2003 11:43:19 -0600
- Subject: Re: Patch: *bsd & darwin support in libiberty/physmem.c
- References: <200302212311.h1LNBwS20874@caip.rutgers.edu>
- Reply-to: kparz at iastate dot edu
On Fri, Feb 21, 2003 at 06:11:58PM -0500, Kaveh R. Ghazi wrote:
> > It applies cleanly against the current gcc trunk's libiberty. (I
> > made an update for irix6 earlier today.)
>
> This one applies cleanly after Rainer's install. Try it instead,
> thanks.
>
[snip]
> + if (sysctl(mib, ARRAY_SIZE(mib), &physmem, &len, NULL, 0) == 0)
> + return (double)physmem * pagesize;
> + }
[snip[
> + if (sysctl(mib, ARRAY_SIZE(mib), &usermem, &len, NULL, 0) == 0)
> + return (double)usermem * pagesize;
> + }
This causes the test code to produce
total=2082304.000000Mb avail=1836704.000000Mb
The values of physmem and usermem are in bytes, not in pages (at least
on 4.x).
Krzysztof