Unix Programming - sysinfo()

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > May 2004 > sysinfo()





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author sysinfo()
seand

2004-05-06, 8:37 pm

Hi all,

On a gnu/linux system, sysinfo()(3) and free(1) return diff result(i don't
think printf() with %u format caused this, but not sure):
/* sysinfo() result */
loads: 65536 66144 65824 totalram: 965817 freeram: 124591 sharedram:
247432 bufferram: 68788 totalswap: 524110 freeswap: 524110

# free result
total used free shared buffers cached
Mem: 3863268 3341292 521976 989728 275152 1523100
-/+ buffers/cache: 1543040 2320228
Swap: 2096440 0 2096440

and how to convert load average value 65536 to 1.** format?


TIA

-s


Martin Blume

2004-05-10, 5:44 pm

"seand" schrieb
> Hi all,
>
> On a gnu/linux system, sysinfo()(3) and free(1) return diff
> result ...
>


hard to say, without the source code, but
(1) did you take the trouble to have a look at the man-page
(2) did you take into account that sysinfo
... Since Linux 2.3.23(i386), 2.3.48 (all architectures)
the structure is
struct sysinfo {
...
unsigned long totalram;
...
unsigned int mem_unit;
...
and the sizes are given as multiples of
mem_unit bytes. ...
(according to man sysinfo)

Perhaps this can be a start towards the explanation.

HTH
Martin




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com