From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,fe8bc39b11ec10a9 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-10-28 05:44:08 PST Newsgroups: comp.unix.osf.osf1 Path: nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!EU.net!CERN.ch!news From: danpop@cernapo.cern.ch (Dan Pop) Subject: Re: How much memory? Message-ID: Sender: news@news.cern.ch (USENET News System) Organization: CERN European Lab for Particle Physics References: <38oma6$s14@rlsaxp.bnsc.rl.ac.uk> <38oop7$dih@decuac.dec.com> Date: Fri, 28 Oct 1994 12:34:02 GMT In <38oop7$dih@decuac.dec.com> murphy@dco.dec.com (Rick Murphy) writes: >In article <38oma6$s14@rlsaxp.bnsc.rl.ac.uk>, djr@rlsaxp.bnsc.rl.ac.uk (David Rawlinson) writes: >>Apologies if this is simple but I can't for the life of me figure out >>how you find out "simply" how much memory there is on an OSF/1 system. >> ... >>Why haven't DEC provided the tool? > >getsysinfo GSI_PHYSMEM provides the hook. A little program that uses it is attached. > -Rick >#include >#include >#include > >main(argc, argv) >int argc; >char **argv; >{ > int memsize; > > getsysinfo(GSI_PHYSMEM, &memsize, sizeof(memsize), NULL, NULL); > printf("This machine has %d Kb of memory\n", memsize); > exit(0); >} Very nice, but it doesn't compile: ues5:~/bin 8> uname -a OSF1 ues5.cern.ch V2.1 250 alpha ues5:~/bin 9> cc mem.c /usr/lib/cmplrs/cc/cfe: Error: mem.c, line 11: 'GSI_PHYSMEM' undefined, reoccurrences will not be reported getsysinfo(GSI_PHYSMEM, &memsize, sizeof(memsize), 0L, 0L); ---------------^ After looking in , it seems that the magical incantation to get it compiled is: ues5:~/bin 12> cc -DULT_BIN_COMPAT mem.c ues5:~/bin 13> ./a.out This machine has 32768 Kb of memory Is there a more elegant way to do this? The man page for getsysinfo doesn't mention anything about the ULT_BIN_COMPAT macro. Dan -- Dan Pop CERN, CN Division Email: danpop@cernapo.cern.ch Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland