From: Acosta, Mark W [Magic Earth LLC] (acostmw++at++texaco.com)
Date: 02/22/2000 12:01:20
Thanks Brian. That did the trick. While I have your attention, do you know
of a way to get the value for the kernel parameter "shmmax"? I've looked
through everything I can think of and I can't find any way to do this.
Thanks again.
Mark Acosta
Magic Earth LLC
-----Original Message-----
From: Brian Furtaw
To: Acosta, Mark W [Magic Earth LLC]
Cc: 'info-performer++at++sgi.com'
Sent: 2/22/00 11:51 AM
Subject: Re: How to find memory size.
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 - 12:02:10 PST