This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]