"Fossies" - the Fresh Open Source Software Archive
Member "linux_logo-6.0/libsysinfo-0.3.0/Linux/README" (8 May 2020, 933 Bytes) of package /linux/misc/linux_logo-6.0.tar.gz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard
) with prefixed line numbers.
Alternatively you can here view
the uninterpreted source code file.
1 Linux sysinfo gathering:
3 cpuinfo is obtained from parsing /proc/cpuinfo.
4 This can be convoluted at times, especially since every stable
5 kernel release seems to change the format.
7 Thankfully with the advent of the 'cpuinfo' instruction things
8 have stabalized a bit.
10 Some complex parsing goes on to give cleaner output.
12 os_info is obtained using the uname() function.
14 hostname is also obtained using the uname() function
16 memory is obtained by a fstat() on /proc/kcore
18 this sometimes ends up a Megabyte short if ACPI or APM
19 are in use.
21 Other methods are available.
23 + /proc/meminfo tends to always turn up a few megabytes short
24 because it ignores reserved and kernel memory
26 + the sysinfo() function has similar problems
28 uptime is obtained from /proc/uptime
30 loadaverage is obtained from /proc/loadavg
32 + this is proc filesystem dependent of course.
33 Maybe I should look into sysinfo()