get_phys_pages
(3)get total and available physical page counts
#include <sys/sysinfo.h> long get_phys_pages(void); long get_avphys_pages(void);
LIBRARY
DESCRIPTION
RETURN VALUE
ERRORS
- ENOSYS
- The system could not provide the required information (possibly because the /proc filesystem was not mounted).
STANDARDS
HISTORY
NOTES
EXAMPLES
The following example shows how get_phys_pages() and get_avphys_pages() can be used.
#include <stdio.h>
#include <stdlib.h>
#include <sys/sysinfo.h>
int
main(void)
{
printf("This system has %ld pages of physical memory and "
"%ld pages of physical memory available.\n",
get_phys_pages(), get_avphys_pages());
exit(EXIT_SUCCESS);
}