From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,b8a884c72ed0e02c,start X-Google-Attributes: gidfee84,public From: Peter Delgado Subject: Re: How can I find the real memory of a Digital Unix 3.x system Date: 1995/09/29 Message-ID: <44ha0o$i9@info1.sdrc.com>#1/1 X-Deja-AN: 116804411 distribution: world references: <44fe6o$erk@newsbf02.news.aol.com> content-type: text/plain; charset=us-ascii organization: PIG x-url: news:44fe6o$erk@newsbf02.news.aol.com mime-version: 1.0 newsgroups: comp.unix.osf.osf1 x-mailer: Mozilla 1.1 (X11; I; OSF1 V3.2 alpha) Here's code that will find the amount of RAM on a Digital UNIX system. I had to cast the integer address to a char to silence the compiler warning. Although the man page for getsysinfo indicates a integer pointer is expected for the argument, the compiler insists on a character pointer. I didn't really have the time to investigate the discrepancy so it stayed. Perhaps you might want to look at it! Compile with cc -std1 or cc -migrate (to get better error messages) #include #include #include #include #include int main(int argc, char *argv[]) { int TotalMemory; if (getsysinfo(GSI_PHYSMEM,(char *)&TotalMemory,(unsigned long)(sizeof(int)),0,NULL) !=-1) { TotalMemory += 512; fprintf(stdout,"Total Memory = %d MB\n",TotalMemory/1024); exit(0); } perror("PHYSMEM"); exit(1); } --Pete ------------------------------------------------------------------------------- Pete Delgado The opinions expressed are Software Development/Support Engineer my own and do not reflect Product Installation the official opinions of Structural Dynamics Research Corporation SDRC. 2000 Eastman Drive Milford, Ohio 45150 No user servicable parts inside! e-mail: Peter.Delgado@sdrc.com -------------------------------------------------------------------------------