get_avphys_pages

Returns the total number of currently available pages of physical memory on the host machine.

Library:LibC
Classification:Linux
Service:System Information

Syntax

  #include <sys/sysinfo.h> 
   
  long get_avphys_pages( void );
  

Return Values

Returns the number of currently available pages of physical memory on the host machine. This function cannot fail.

Remarks

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.

See Also