🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.linux.announce
1 messages
1 total messages Started by Gabor Herr Thu, 28 Jan 1993 18:51
0.99pl4 kernel patch for xsysinfo-1.1
#127
Author: Gabor Herr
Date: Thu, 28 Jan 1993 18:51
77 lines
2836 bytes
Hi,

the kernel patch included in the xsysinfo-1.1 archive doesn't work with
the new 0.99pl4 release of the Linux kernel. So here is a modified
patch relative to pl4.

I hope Linus will add these changes to the next kernel release, so
this patch will not be necessary in the future.

Gabor


diff -cr old/linux/fs/proc/array.c linux/fs/proc/array.c
*** old/linux/fs/proc/array.c	Tue Jan 26 23:07:32 1993
--- linux/fs/proc/array.c	Tue Jan 26 22:28:23 1993
***************
*** 46,51 ****
--- 46,62 ----
  	return sprintf(buffer,"%d\n",(jiffies+jiffies_offset)/HZ);
  }
  
+ /*
+  * the (absolute) idle time is the processing time of task 0, the unswappable
+  * idle task. The current ticks value is also returned, so the relative
+  * idle time can easily computed with two succesive reads of /proc/idle.
+  */
+ static int get_idle(char * buffer)
+ {
+ 	return sprintf(buffer,"%d %d\n",
+ 		task[0]->utime + task[0]->stime, jiffies + jiffies_offset);
+ }
+ 
  static int get_meminfo(char * buffer)
  {
  	struct sysinfo i;
***************
*** 306,311 ****
--- 317,325 ----
  			break;
  		case 6:
  			length = get_version(page);
+ 			break;
+ 		case 8:
+ 			length = get_idle(page);
  			break;
  		case 9:
  			length = get_env(pid, page);
diff -cr old/linux/fs/proc/root.c linux/fs/proc/root.c
*** old/linux/fs/proc/root.c	Tue Jan 26 23:07:32 1993
--- linux/fs/proc/root.c	Tue Jan 26 22:28:23 1993
***************
*** 57,63 ****
  	{ 4,7,"meminfo" },
  	{ 5,4,"kmsg" },
  	{ 6,7,"version" },
! 	{ 7,4,"self" }	/* will change inode # */
  };
  
  #define NR_ROOT_DIRENTRY ((sizeof (root_dir))/(sizeof (root_dir[0])))
--- 57,64 ----
  	{ 4,7,"meminfo" },
  	{ 5,4,"kmsg" },
  	{ 6,7,"version" },
! 	{ 7,4,"self" },	/* will change inode # */
!  	{ 8,4,"idle" }	
  };
  
  #define NR_ROOT_DIRENTRY ((sizeof (root_dir))/(sizeof (root_dir[0])))

-- 
############################################################################
Gabor Herr			Email: herr@iti.informatik.th-darmstadt.de
Computer Science Department
Technical University of Darmstadt, Germany

-- 
Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads