The function
.BR get_phys_pages ()
returns the total number of physical pages of memory available on the system.
-
+.PP
The function
.BR get_avphys_pages ()
returns the number of currently available physical pages of memory on the
.I MemFree
fields of
.IR /proc/meminfo .
-
+.PP
The following
.BR sysconf (3)
calls provide a portable means of obtaining the same information as the
functions described on this page.
-
+.PP
.nf
total_pages = sysconf(_SC_PHYS_PAGES); /* total pages */
avl_pages = sysconf(_SC_AVPHYS_PAGES); /* available pages */
and
.BR get_avphys_pages ()
can be used.
-
+.PP
.nf
#include <stdio.h>
#include <stdlib.h>