This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Call for testers: libiberty/physmem.c
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 21 Feb 2003 13:04:59 -0500
- Subject: Re: Call for testers: libiberty/physmem.c
>>>>> Kaveh R Ghazi writes:
Kaveh> Thanks for the info. Would you please ping somebody in AIX
Kaveh> development who can tell us whether there is a non-root way of getting
Kaveh> this information? (There sometimes is but it isn't always advertised.)
Kaveh> Unfortunately, in the source code for top-3.5beta12, it looks like it
Kaveh> peeks in kmem.
AIX development is not needed to answer this question. One query
the total physical memory in the system through the _system_configuration
implicitly exported symbol which returns the number of bytes of physical
memory as a long long int:
#include <stdio.h>
#include <sys/systemcfg.h>
int main(void)
{
printf ("total=%lld Mb\n",
_system_configuration.physmem / (1024 * 1024));
return 0;
}
Available memory requires querying the VMM system which is
privileged.
David