Returns the total number of currently available pages of physical memory on the host machine.
#include <sys/sysinfo.h> long get_avphys_pages( void );
Returns the number of currently available pages of physical memory on the host machine. This function cannot fail.
This is a GNU extension and has been included in the library to aid the porting of open source code to NetWare. The standard way to obtain this information is with sysconf (_SC_AVPHYS_PAGES).
To calculate the amount of memory, you need to multiply the number of pages of physical memory by the page size.