"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 or download the uninterpreted source code file.

    1 Linux sysinfo gathering:
    2 
    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.
    6 	
    7 	Thankfully with the advent of the 'cpuinfo' instruction things
    8 	have stabalized a bit.
    9 	
   10 	Some complex parsing goes on to give cleaner output.
   11 	
   12 os_info is obtained using the uname() function.
   13 
   14 hostname is also obtained using the uname() function
   15 
   16 memory is obtained by a fstat() on /proc/kcore
   17         
   18 	this sometimes ends up a Megabyte short if ACPI or APM
   19 	are in use.
   20 	
   21 	Other methods are available. 
   22 	
   23 	+ /proc/meminfo tends to always turn up a few megabytes short
   24 	  because it ignores reserved and kernel memory
   25 	  
   26 	+ the sysinfo() function has similar problems
   27 	
   28 uptime is obtained from /proc/uptime
   29 
   30 loadaverage is obtained from /proc/loadavg
   31 
   32 	+ this is proc filesystem dependent of course.
   33 	  Maybe I should look into sysinfo()