From: Brian Furtaw (brian++at++sgi.com)
Date: 02/22/2000 09:51:07
Mark,
getinvent() database has an entry for memory size in MB so an int should
have plenty of room in it. Your searching the inventory for inv_class of
INV_MEMORY and inv_type of INV_MAIN_MB.
i.e
#include <invent.h>
#include <stdio.h>
main()
{
inventory_t *pinv;
setinvent();
while(pinv = getinvent()) {
if( pinv->inv_class == INV_MEMORY && (pinv->inv_type == INV_MAIN_MB) )
{
printf("Main Memory size is %ld Mbytes", pinv->inv_state);
if (pinv->inv_unit)
printf(", %d-way interleaved\n", pinv->inv_unit);
else
printf("\n");
}
}
}
Brian
"Acosta, Mark W [Magic Earth LLC]" wrote:
>
> I know this is a bit off topic but it does involve a Performer program. I'm
> trying to programmatically determine the physical amount of memory on the
> machine I'm running on. The only thing I've found so far that does this is
> "getinvent()" which, unfortunately, only returns a 32 bit int with the
> memory size and I need this to work on machines with more than 2GB of
> memory. The man page for getinvent shows the return value (inv_state) as a
> long but the header file has it as an int. Anyone know of some other way to
> do this? Thanks.
>
> Mark Acosta
> Magic Earth LLC
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
--
----oOOo---- ----oOOo---- ----oOOo---- ----oOOo----
Brian Furtaw (brian++at++sgi.com)
Graphics Guru Office:(301)572-3293 Fax: (301)572-3280
12200-G Plum Orchard Drive OpenGL/Performer/OpenInventor/ImageVision
Silver Spring, Maryland 20904 Optimizer/React/PCI Device Drivers
This archive was generated by hypermail 2b29 : Tue Feb 22 2000 - 10:24:14 PST