I suppose this can't really be considered a kernel bug, although
it does seem odd that on my system (a 486DX2/66) the intr line in
/proc/stat has 225 numbers on it, most of which are zero as there
are only 16 IRQs.
This is the diff showing what I changed to get xosview working
again.
--- xosview-1.6.1.a/linux/cpumeter.cc.old Fri Apr 3 09:17:19 1998
+++ xosview-1.6.1.a/linux/cpumeter.cc Fri Feb 19 20:55:01 1999
@@ -48,7 +48,7 @@
void CPUMeter::getcputime( void ){
total_ = 0;
- char tmp[256];
+ char tmp[4096];
ifstream stats( STATFILENAME );
if ( !stats ){
@@ -58,7 +58,7 @@
// read until we are at the right line.
for (int i = 0 ; i < _lineNum ; i++)
- stats.getline(tmp, 256);
+ stats.getline(tmp, sizeof(tmp));
stats >>tmp >>cputime_[cpuindex_][0]
>>cputime_[cpuindex_][1]
@@ -86,9 +86,9 @@
}
int line = -1;
- char buf[256];
+ char buf[4096];
while (!stats.eof()){
- stats.getline(buf, 256);
+ stats.getline(buf, sizeof(buf));
if (!stats.eof()){
line++;
if (!strncmp(cpuID, buf, strlen(cpuID)) && buf[strlen(cpuID)] == ' ')
@@ -111,9 +111,9 @@
}
int cpuCount = 0;
- char buf[256];
+ char buf[4096];
while (!stats.eof()){
- stats.getline(buf, 256);
+ stats.getline(buf, sizeof(buf));
if (!stats.eof()){
if (!strncmp(buf, "cpu", 3) && buf[3] != ' ')
cpuCount++;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/