On 20020805 DervishD wrote:
> Hi all :)
>
> The output of 'cat /proc/meminfo' is ugly by today standards,
> since is very frequent having more than 99 Mb of RAM and the current
> meminfo just supports 8 digits before outputting ugly tabulations.
>
> So, how about raising that 8 digits to at least 10, thus allowing
> pretty tabulations up to 9 Gb of RAM?
>
Why 10 ?
unsigned long k32= ~0;
unsigned long long k64 = ~0;
printf("%d %lu\n",sizeof(k32)*8,k32);
printf("%d %llu\n",sizeof(k64)*8,k64);
gives
32 4294967295
64 18446744073709551615
On a 64 bit box you could have 2^64 bytes.
Opps, and on a 32bit box you could have 16Gb of swap ?
1Tb is:
unsigned long long k64 = 1ULL<<40;
64 1099511627776
13 digits (nice number ;))
Sorry, late at night here...
-- J.A. Magallon \ Software is like sex: junk.able.es \ It's better when it's free Mandrake Linux release 9.0 (Cooker) for i586 Linux 2.4.19-jam0 (gcc 3.2 (Mandrake Linux 9.0 3.2-0.2mdk)) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:26 EST