[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Kooldown on IRIX 6.5 laundry list of build notes (cont.)
From: Jesse Barnes <jbarnes () sgi ! com>
Date: 2000-08-24 19:56:01
[Download RAW message or body]
Jesse Barnes wrote:
> * kcontrol/info/memory_sgi.cpp is written for IRIX 6.2. I rewrote this
> for 6.5 and as soon as I test it I'll post it to the list.
Here's the patch for this, I guess it somehow has to be integrated into
the current memory_sgi.cpp file. I guess that means we need a #define
for the version of IRIX that's running (uname -r will tell you).
The memory info panel now works well on my system, but I didn't get the
share mem stats working. Maybe I'll put together some more stuff for
the info tree a little later.
Thanks,
Jesse
["memory.diff" (text/plain)]
+++ memory_sgi.cpp Thu Aug 24 12:48:35 2000
@@ -1,16 +1,10 @@
-
-#include <stdio.h>
#include <unistd.h>
#include <sys/sysmp.h>
-#include <sys/ipc.h>
-
-// The following define is needed for SGI IRIX 6.2
-#define _KMEMUSER
#include <sys/shm.h>
-
#include <sys/param.h>
#include <sys/swap.h>
+#define UBSIZE 512
void KMemoryWidget::update()
{
@@ -23,7 +17,7 @@
Memory_Info[FREE_MEM] = MEMORY(rmi.freemem*pagesize); // total free physical \
memory (without swaps) Memory_Info[BUFFER_MEM] = MEMORY(rmi.bufmem*pagesize);
- long val;
+ off_t val;
swapctl(SC_GETSWAPTOT, &val);
Memory_Info[SWAP_MEM] = MEMORY(val*UBSIZE); // total size of all \
swap-partitions
@@ -30,33 +24,6 @@
swapctl(SC_GETFREESWAP, &val);
Memory_Info[FREESWAP_MEM] = MEMORY(val*UBSIZE); // free memory in swap-partitions
- FILE *kmem = fopen("/dev/kmem", "r");
- if( kmem == 0 ) {
- Memory_Info[SHARED_MEM] = NO_MEMORY_INFO;
- return;
- }
-
- long shmip = sysmp(MP_KERNADDR, MPKA_SHMINFO);
- fseek( kmem, shmip, 0 );
- struct shminfo shmi;
- fread( &shmi, sizeof(shmi), 1, kmem );
-
- long shmem = sysmp(MP_KERNADDR, MPKA_SHM);
-
- val = 0;
- long pos;
- struct shmid_ds shmid;
- for( int i=0 ; i<shmi.shmmni ; i++ ) {
- fseek( kmem, shmem, 0 );
- shmem += sizeof(shmem);
- fread( &pos, sizeof(shmem), 1, kmem );
- if(pos != 0) {
- fseek( kmem, pos, 0 );
- fread( &shmid, sizeof(shmid), 1, kmem );
- val += shmid.shm_segsz;
- }
- }
- Memory_Info[SHARED_MEM] = MEMORY(val);
-
- fclose(kmem);
+ Memory_Info[SHARED_MEM] = NO_MEMORY_INFO;
+ return;
}
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic