return information on overall system statistics;
#include <sys/sysinfo.h>
int sysinfo(struct sysinfo *info);
struct sysinfo{
long uptime;
......
unsigned long totalram;//Total useable main memorysize
unsigned long freeram;//Available memory size(可用页的个数)
......
};
usage:
struct sysinfo aa;
sysinfo(&aa);
printf(...,aa.freeram);