~ubuntu-branches/ubuntu/trusty/linuxlogo/trusty

« back to all changes in this revision

Viewing changes to libsysinfo-0.2.1/Linux/README

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-06-20 09:19:00 UTC
  • mfrom: (4.1.2 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080620091900-4xzuv7c7ntxvs7wt
Tags: 5.03-4
* Adding patch to fix FTBFS on s390x.
* Updating to standards 3.8.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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()