Thanx arne ..
But can i get some c function which calculates the like the following which calculates the memory used in solaris.
#include <stdio.h>
#include <unistd.h>
int main()
{
long numPages, pageSize, freePages, totalSize, totalUsed, totalFree;
numPages = sysconf(_SC_PHYS_PAGES)/1024;
pageSize = sysconf(_SC_PAGESIZE)/1024;
freePages = sysconf( _SC_AVPHYS_PAGES)/1024;
totalSize = numPages * pageSize;
totalFree = pageSize * freePages;
totalUsed = totalSize - totalFree;
printf("total memory == %u MB\n",totalSize);
printf("total free memory == %u MB\n",totalFree);
printf("total used memory == %u MB\n",totalUsed);
return(0);
}