- The sysinfo system call fills a structure with system statistics. Its only argument is a pointer to a struct sysinfo.
- Some of the more interesting fields of struct sysinfo
that are filled include these:
- uptime Time elapsed since the system booted, in seconds.
- totalram Total available physical RAM
- freeram Free physical RAM
- procs Number of processes on the system
- The http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/sysinfo.c program in Fig. 8 prints some statistics about the current system.
Figure 8:
Print System Statistics.
|
2006-04-27