Re: [PATCH] fix for sysinfo(2) in 2.4.0-test1

From: Andries Brouwer (aeb@veritas.com)
Date: Sun Jun 04 2000 - 04:15:40 EST


On Sun, Jun 04, 2000 at 01:35:51AM -0600, Erik Andersen wrote:

> The following patch reinstates the traditional sysinfo(2) interface by
> returning bytes (not units of PAGE_SIZE) for memory values.

> + /* These are in units of PAGE_SIZE, but this interface
> + * has always returned bytes. Make it return bytes */
> + val.totalram*=PAGE_SIZE;
> + val.freeram*=PAGE_SIZE;
> + val.sharedram*=PAGE_SIZE;
> + val.bufferram*=PAGE_SIZE;
> + val.totalswap*=PAGE_SIZE;
> + val.freeswap*=PAGE_SIZE;
> + val.totalhigh*=PAGE_SIZE;
> + val.freehigh*=PAGE_SIZE;

You forgot setting mem_unit to 1.
Why can't your application multiply by mem_unit?

The present patch is no good, I suppose. For example, it wouldnt
allow more than 4 GiB memory or swap on a 32-bit machine.

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:18 EST