According to the "Topics in IRIX Programming" manual, it should be fairly easy to determine the amount of physical and free main memory using the sysmp system call.
But when I execute the following simple test program:
I get the following results:
The sysmp call succeeds (return value: 0), but all rminfo fields are set to zero with the exception of field freemem, which is left untouched.
Any hints, what is going wrong?
P.S.: Tested on an O2 and a MAME-Indy running IRIX 6.5.22 and gcc 3.4.6.
But when I execute the following simple test program:
#include <stdio.h>#include <sys/types.h>#include <sys/sysmp.h>#include <sys/sysinfo.h>int main(int argc, char *argv[]){ int retVal; struct rminfo rmstruct = { 123 }; retVal = sysmp(MP_KERNADDR, MPSA_RMINFO, &rmstruct); printf("retVal=%d\n", retVal); printf("freemem=%d\n",rmstruct.freemem); printf("availsmem=%d\n",rmstruct.availsmem); printf("availrmem=%d\n",rmstruct.availrmem); printf("bufmem=%d\n",rmstruct.bufmem); printf("physmem=%d\n",rmstruct.physmem); printf("dchunkpages=%d\n",rmstruct.dchunkpages); printf("pmapmem=%d\n",rmstruct.pmapmem); printf("strmem=%d\n",rmstruct.strmem); printf("chunkpages=%d\n",rmstruct.chunkpages); printf("dpages=%d\n",rmstruct.dpages); printf("emptymem=%d\n",rmstruct.emptymem); printf("ravailrmem=%d\n",rmstruct.ravailrmem); return 0;}I get the following results:
retVal=0freemem=123availsmem=0availrmem=0bufmem=0physmem=0dchunkpages=0pmapmem=0strmem=0chunkpages=0dpages=0emptymem=0ravailrmem=0The sysmp call succeeds (return value: 0), but all rminfo fields are set to zero with the exception of field freemem, which is left untouched.
Any hints, what is going wrong?
P.S.: Tested on an O2 and a MAME-Indy running IRIX 6.5.22 and gcc 3.4.6.