Fix a bug in netlist where glibtop_netlist.number was never initialized to

* Makefile.am:
	* cpu.c: (glibtop_get_cpu_p):
	* netlist.c: (glibtop_get_netlist_s):
	* netload.c: (glibtop_get_netload_p):
	* procmem.c: (glibtop_get_proc_mem_p):

	Fix a bug in netlist where glibtop_netlist.number was never initialized to 0
	(this resulted in a NULL pointer dereference in the network load feature
	of the multiload applet)

	* Add support for getting interface flags and packet counts even on interfaces
	without IP addresses (needed for the network load feature of the multiload applet)

	* Restore per-process limits in the !FreeBSD or __FreeBSD_version < 500013
	case

	* Add CPU interrupt time as IOWAIT to get support for the cpu load feature of
	the multiload applet.

	Patch from marcus@freebsd.org (Joe Marcus Clarke).
	Closes #168704.
This commit is contained in:
Benoît Dejean
2005-02-28 08:15:59 +00:00
parent fc7d872381
commit 2c0f291b3c
6 changed files with 120 additions and 88 deletions

View File

@@ -34,7 +34,8 @@
static const unsigned long _glibtop_sysdeps_cpu =
(1L << GLIBTOP_CPU_TOTAL) + (1L << GLIBTOP_CPU_USER) +
(1L << GLIBTOP_CPU_NICE) + (1L << GLIBTOP_CPU_SYS) +
(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY);
(1L << GLIBTOP_CPU_IDLE) + (1L << GLIBTOP_CPU_FREQUENCY) +
(1L << GLIBTOP_CPU_IOWAIT);
#ifndef KERN_CP_TIME
/* nlist structure for kernel access */
@@ -122,6 +123,8 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf)
buf->sys = cpts [CP_SYS];
/* set idle time */
buf->idle = cpts [CP_IDLE];
/* set iowait (really just interrupt) time */
buf->iowait = cpts [CP_INTR];
/* set frequency */
/*