diff --git a/procinfo-14-misc.patch b/procinfo-14-misc.patch new file mode 100644 index 0000000000000000000000000000000000000000..7bdb033c10ad9f68ca9acad4f27d83eeb34f552a --- /dev/null +++ b/procinfo-14-misc.patch @@ -0,0 +1,24 @@ +--- procinfo-14/Makefile.misc Sun May 24 10:49:04 1998 ++++ procinfo-14/Makefile Thu Sep 10 11:06:29 1998 +@@ -4,7 +4,7 @@ + + CC = gcc -Wall -Wstrict-prototypes + +-CFLAGS = -O2 ++CFLAGS = $(RPM_OPT_FLAGS) + LDFLAGS = -s + + # If you get lots of `undefined references', you probably need -lncurses +@@ -33,9 +33,9 @@ + + install: procinfo procinfo.8 lsdev.pl socklist.pl lsdev.8 + -mkdir -p $(prefix)/bin +- install procinfo $(prefix)/bin/procinfo +- install lsdev.pl $(prefix)/bin/lsdev +- install socklist.pl $(prefix)/bin/socklist ++ install -m 755 -o 0 -g 0 procinfo $(prefix)/bin/procinfo ++ install -m 755 -o 0 -g 0 lsdev.pl $(prefix)/bin/lsdev ++ install -m 755 -o 0 -g 0 socklist.pl $(prefix)/bin/socklist + -mkdir -p $(prefix)/man/man8 + install -m 644 procinfo.8 $(prefix)/man/man8/procinfo.8 + install -m 644 lsdev.8 $(prefix)/man/man8/lsdev.8 diff --git a/procinfo-17-lsdev.patch b/procinfo-17-lsdev.patch new file mode 100644 index 0000000000000000000000000000000000000000..e7660b4e8332b6698bc45c8ac0ec81a847de1ded --- /dev/null +++ b/procinfo-17-lsdev.patch @@ -0,0 +1,43 @@ +--- procinfo-17/lsdev.pl.broken Thu Nov 16 13:38:17 2000 ++++ procinfo-17/lsdev.pl Thu Nov 16 13:48:42 2000 +@@ -16,6 +16,7 @@ + while () { + next if /^[ \t]*[A-Z]/; + chop; ++ s/^ +//g; + if (/PIC/) { + $n = (@line = split()); + } else { +@@ -32,6 +33,7 @@ + open (DMA, ") { + chop; ++ s/^ +//g; + @line = split(': '); + @tmp = split (/[ \(]/, $line[1]); + $name = $tmp[0]; +@@ -43,6 +45,7 @@ + open (IOPORTS, ") { + chop; ++ s/^ +//g; + @line = split(' : '); + @tmp = split (/[ \(]/, $line[1]); + $name = $tmp[0]; +@@ -51,12 +54,12 @@ + } + close (IOPORTS); + +-printf ("%-16s %4s%6s %s\n------------------------------------------------\n", +- "Device", "DMA", "IRQ", " I/O Ports"); ++printf "%-16s %4s%6s %s\n------------------------------------------------\n", ++ "Device", "DMA", "IRQ", " I/O Ports"; + + foreach $name (sort { uc($a) cmp uc($b) } keys %device) { +- printf ("%-16s %4s%6s %s\n", +- $name, $dma{$name}, $irq{$name}, $port{$name}); ++ printf "%-16s %4s%6s %s\n", ++ $name, $dma{$name}, $irq{$name}, $port{$name}; + } + + # The End #################################################################### diff --git a/procinfo-17-mandir.patch b/procinfo-17-mandir.patch new file mode 100644 index 0000000000000000000000000000000000000000..d44c9ad7711e1539bcdb116a6296a9179b39ca9b --- /dev/null +++ b/procinfo-17-mandir.patch @@ -0,0 +1,31 @@ +--- procinfo-17/Makefile.mandir Sun Jun 18 16:19:08 2000 ++++ procinfo-17/Makefile Sun Jun 18 16:19:49 2000 +@@ -1,6 +1,7 @@ + ### Makefile for procinfo. + + prefix=/usr ++mandir=$(prefix)/man + + CC = gcc -Wall -Wstrict-prototypes + +@@ -33,13 +34,13 @@ + + install: procinfo procinfo.8 lsdev.pl socklist.pl lsdev.8 + -mkdir -p $(prefix)/bin +- install -m 755 -o 0 -g 0 procinfo $(prefix)/bin/procinfo +- install -m 755 -o 0 -g 0 lsdev.pl $(prefix)/bin/lsdev +- install -m 755 -o 0 -g 0 socklist.pl $(prefix)/bin/socklist +- -mkdir -p $(prefix)/man/man8 +- install -m 644 procinfo.8 $(prefix)/man/man8/procinfo.8 +- install -m 644 lsdev.8 $(prefix)/man/man8/lsdev.8 +- install -m 644 socklist.8 $(prefix)/man/man8/socklist.8 ++ install -m 755 procinfo $(prefix)/bin/procinfo ++ install -m 755 lsdev.pl $(prefix)/bin/lsdev ++ install -m 755 socklist.pl $(prefix)/bin/socklist ++ -mkdir -p $(mandir) ++ install -m 644 procinfo.8 $(mandir)/man8/procinfo.8 ++ install -m 644 lsdev.8 $(mandir)/man8/lsdev.8 ++ install -m 644 socklist.8 $(mandir)/man8/socklist.8 + + clean: + rm -f procinfo procinfo.0 *.o *~ out diff --git a/procinfo-17-uptime.patch b/procinfo-17-uptime.patch new file mode 100644 index 0000000000000000000000000000000000000000..71923d79179ffef594d74f6aa8650a199ccb2bb2 --- /dev/null +++ b/procinfo-17-uptime.patch @@ -0,0 +1,33 @@ +--- procinfo-17/routines.c.uptime Thu Nov 16 14:21:02 2000 ++++ procinfo-17/routines.c Thu Nov 16 14:30:37 2000 +@@ -390,19 +390,19 @@ + unsigned int d, h, m, s; + static char buf[22]; + +- t = t * 100 / HZ; +- d = (int) (t / 8640000); +- t = t - (long) (d * 8640000); +- h = (int) (t / 360000); +- t = t - (long) (h * 360000); +- m = (int) (t / 6000); +- t = t - (long) (m * 6000); +- s = (int) (t / 100); +- t = t - (long) (s * 100); ++ t *= (100 / HZ); ++ d = (unsigned int) (t / 8640000); ++ t -= (unsigned long) (d * 8640000); ++ h = (unsigned int) (t / 360000); ++ t -= (unsigned long) (h * 360000); ++ m = (unsigned int) (t / 6000); ++ t -= (unsigned long) (m * 6000); ++ s = (unsigned int) (t / 100); ++ t -= (unsigned long) (s * 100); + if (d > 0) +- sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (int) t); ++ sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (unsigned int) t); + else +- sprintf (buf, " %2u:%02u:%02u.%02u", h, m, s, (int) t); ++ sprintf (buf, " %2u:%02u:%02u.%02u", h, m, s, (unsigned int) t); + return buf; + } + diff --git a/procinfo-18-acct.patch b/procinfo-18-acct.patch new file mode 100644 index 0000000000000000000000000000000000000000..e1f52916d0f04e96308833fd143624db42ff4275 --- /dev/null +++ b/procinfo-18-acct.patch @@ -0,0 +1,45 @@ +diff -urN procinfo-18.save/procinfo.c procinfo-18/procinfo.c +--- procinfo-18.save/procinfo.c 2001-02-25 06:29:16.000000000 -0500 ++++ procinfo-18/procinfo.c 2003-07-29 22:10:07.000000000 -0400 +@@ -249,6 +249,9 @@ + new.cpu_nice = VAL; + new.cpu_sys = VAL; + new.cpu_idle = VAL; ++ new.cpu_iowait = VAL; ++ new.cpu_irq = VAL; ++ new.cpu_softirq = VAL; + /* + * according to bug #1959, sometimes the cpu_idle + * seems to go backwards(!) on SMP boxes. This may +@@ -373,7 +376,9 @@ + putchar ('\n'); + + printf ("system: %s %s", +- hms (bDIFF (cpu_sys)), perc (bDIFF (cpu_sys), elapsed, nr_cpus)); ++ hms (bDIFF (cpu_sys) + bDIFF (cpu_irq) + bDIFF (cpu_softirq)), ++ perc (bDIFF (cpu_sys) + bDIFF (cpu_irq) + bDIFF (cpu_softirq), ++ elapsed, nr_cpus)); + printf (" swap in :%9lu", bDIFF (swin)); + if (new.disk_r[2]) + printf (" disk 3: %8lur%8luw\n", bDIFF (disk_r[2]), +@@ -384,7 +389,8 @@ + putchar ('\n'); + + printf ("idle : %s %s", +- hms (bDIFF (cpu_idle)), perc (bDIFF (cpu_idle), elapsed, nr_cpus)); ++ hms (bDIFF (cpu_idle) + bDIFF (cpu_iowait)), ++ perc (bDIFF (cpu_idle) + bDIFF (cpu_iowait), elapsed, nr_cpus)); + printf (" swap out:%9lu", bDIFF (swout)); + if (new.disk_r[3]) + printf (" disk 4: %8lur%8luw\n", bDIFF (disk_r[3]), +diff -urN procinfo-18.save/procinfo.h procinfo-18/procinfo.h +--- procinfo-18.save/procinfo.h 2001-02-24 18:30:45.000000000 -0500 ++++ procinfo-18/procinfo.h 2003-07-29 22:10:09.000000000 -0400 +@@ -82,6 +82,7 @@ + long m_to, m_us, m_fr, m_sh, m_bu, m_ca; + long s_to, s_us, s_fr; + unsigned long cpu_user, cpu_nice, cpu_sys, cpu_idle; ++ unsigned long cpu_iowait, cpu_irq, cpu_softirq; + unsigned long disk[5]; + unsigned long disk_r[5]; + unsigned long disk_w[5]; diff --git a/procinfo-18-cpu-steal.patch b/procinfo-18-cpu-steal.patch new file mode 100644 index 0000000000000000000000000000000000000000..44162248f90d92585039f4bd64d4dc6d9f4000c6 --- /dev/null +++ b/procinfo-18-cpu-steal.patch @@ -0,0 +1,45 @@ +--- procinfo-18/procinfo.h.steal 2006-04-21 01:09:52.000000000 +0200 ++++ procinfo-18/procinfo.h 2006-04-21 01:10:36.000000000 +0200 +@@ -81,7 +81,7 @@ + unsigned long uptime; + long m_to, m_us, m_fr, m_sh, m_bu, m_ca; + long s_to, s_us, s_fr; +- unsigned long cpu_user, cpu_nice, cpu_sys, cpu_idle; ++ unsigned long cpu_user, cpu_nice, cpu_sys, cpu_idle, cpu_steal; + unsigned long cpu_iowait, cpu_irq, cpu_softirq; + unsigned long disk[5]; + unsigned long disk_r[5]; +--- procinfo-18/procinfo.8.steal 2006-04-21 01:22:58.000000000 +0200 ++++ procinfo-18/procinfo.8 2006-04-21 01:24:01.000000000 +0200 +@@ -61,6 +61,10 @@ + The amount of time spent doing nothing. + + .TP ++.BI steal: ++The amount of time spent the virtual CPU waiting for physical CPU. ++ ++.TP + .BI uptime: + The time that the system has been up. The above four should more or + less add up to this one. +--- procinfo-18/procinfo.c.steal 2006-04-21 01:10:58.000000000 +0200 ++++ procinfo-18/procinfo.c 2006-04-21 01:22:25.000000000 +0200 +@@ -252,6 +252,8 @@ + new.cpu_iowait = VAL; + new.cpu_irq = VAL; + new.cpu_softirq = VAL; ++ new.cpu_steal = VAL; ++ + /* + * according to bug #1959, sometimes the cpu_idle + * seems to go backwards(!) on SMP boxes. This may +@@ -400,6 +402,9 @@ + else + putchar ('\n'); + ++ printf ("steal : %s %s\n", ++ hms (bDIFF (cpu_steal)), perc (bDIFF (cpu_steal), elapsed, nr_cpus)); ++ + printf ("uptime: %s context :%9lu", hms (new.uptime), + bDIFF (ctxt)); + if (new.syscalls) /* If we have this, we can use the old interrupts spot. */ diff --git a/procinfo-18-idle-overflow.patch b/procinfo-18-idle-overflow.patch new file mode 100644 index 0000000000000000000000000000000000000000..92424332ea26b12830157098a87d945b66d7bdc6 --- /dev/null +++ b/procinfo-18-idle-overflow.patch @@ -0,0 +1,20 @@ +--- procinfo-18/routines.c.orig 2011-02-11 03:32:17.000000000 +0530 ++++ procinfo-18/routines.c 2011-02-11 03:35:01.000000000 +0530 +@@ -392,13 +392,13 @@ + + t *= (100 / HZ); + d = (unsigned int) (t / 8640000); +- t -= (unsigned long) (d * 8640000); ++ t -= ((unsigned long) d * 8640000); + h = (unsigned int) (t / 360000); +- t -= (unsigned long) (h * 360000); ++ t -= ((unsigned long) h * 360000); + m = (unsigned int) (t / 6000); +- t -= (unsigned long) (m * 6000); ++ t -= ((unsigned long) m * 6000); + s = (unsigned int) (t / 100); +- t -= (unsigned long) (s * 100); ++ t -= ((unsigned long) s * 100); + if (d > 0) + sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (unsigned int) t); + else diff --git a/procinfo-18-intr.patch b/procinfo-18-intr.patch new file mode 100644 index 0000000000000000000000000000000000000000..23cbb4e9e707bebac39f73d39373fd07dc4f56ee --- /dev/null +++ b/procinfo-18-intr.patch @@ -0,0 +1,213 @@ +--- procinfo-18/routines.c.intr 2007-10-11 09:52:56.000000000 +0200 ++++ procinfo-18/routines.c 2007-10-10 16:38:41.000000000 +0200 +@@ -410,21 +410,24 @@ + char * + perc (unsigned long i, unsigned long t, int cpus) + { +- unsigned int v; ++ long double v; + static char buf[16]; + + if ((signed long) i == -1 || t == 0) + return "---.-%"; + +- v = (unsigned int) (i < 1000000 ? +- ((1000 * i + t / 2) / t) : +- ((i + t / 2000) / (t / 1000))); +- v /= cpus; ++ if (i < 1000000UL) ++ { ++ v = (1000.0 * i + t / 2.0) / t; ++ } ++ else ++ { ++ v = (i + t / 2000.0) / (t / 1000.0); ++ } ++ v = v / (cpus * 10.0); + +- /* if (v > 1000) +- return "+++.+%"; +- else */ +- sprintf (buf, "%3u.%u%%", v / 10, v % 10); ++ buf[0] = '\0'; ++ snprintf (buf, sizeof(buf), "%3.1Lf", v); + return buf; + } + +--- procinfo-18/procinfo.c.intr 2007-10-11 09:52:56.000000000 +0200 ++++ procinfo-18/procinfo.c 2007-10-10 16:40:01.000000000 +0200 +@@ -335,26 +335,6 @@ + + elapsed = new.uptime; + +-/* XXX Is this stuff still relevant/true? */ +- +-#ifdef __i386__ /* IRQ 0 is timer tick on i386's... */ +- if (nr_irqs) { +- if (fs && old.uptime) +- elapsed = DIFF (intr[0]); +- } else +-#endif +-#ifdef __sparc__ /* IRQ 10 is timer tick on sparc's... */ +- if (nr_irqs) { +- if (fs && old.uptime) +- elapsed = DIFF (intr[10]); +- } else +-#endif +- { +- /* This won't be exact... */ +- if (fs && old.uptime) +- elapsed = DIFF (uptime); +- } +- + printf ("user : %s %s", + hms (bDIFF (cpu_user)), perc (bDIFF (cpu_user), elapsed, nr_cpus)); + printf (" page in :%9lu", bDIFF (pgin)); +@@ -414,22 +394,31 @@ + + if (nr_irqs) { + char irq_label[nr_irqs][22]; ++ unsigned real_irq_nums[nr_irqs]; ++ unsigned real_nr_irqs = 0U; + + memset (irq_label, 0, nr_irqs * 22); + + if (interruptsfp) { +- int i; + + fseek (interruptsfp, 0L, SEEK_SET); + while (fgets (line, sizeof (line), interruptsfp)) { ++ char *endptr; + char *p; ++ int i; + + if (!strchr(line, ':')) /* skip " CPU0" */ + continue; + +- i = atol (strtok (line, ":")); /* Get the IRQ no. */ +- +- p = strtok (NULL, "\n"); ++ /* Get the IRQ no. */ ++ p = strtok(line, ":"); ++ endptr = NULL; ++ real_irq_nums[real_nr_irqs] = strtol(p, &endptr, 10); ++ if (endptr == p) /* Not a number */ ++ { ++ continue; ++ } ++ p = strtok (NULL, " "); + + /* + Left: p = " 31273 + serial" +@@ -438,38 +427,24 @@ + or whatever. + Anyway, let's first gobble up... + */ +- +- while (*p == ' ') /* ...spaces... */ +- p++; +- while (*p >= '0' && *p <= '9') /* ...digits... */ +- p++; +- while (*p == ' ' || *p == '+') /* ...and the rest. */ +- p++; ++ for (i = 0; i < nr_cpus; i++) ++ p = strtok(NULL, " "); + + /* Left: "serial" or "XT PIC serial" */ + + if (linux_version_code >= 0x20150) { +- /* +- I don't really like hardcoding version numbers, but +- since the label itself may contain spaces, I can't +- think of a fool-proof algorithm to detect a "XT PIC" +- style /proc/interrupts. +- */ +- char *q; +- +- if ((q = strstr (p, "PIC"))) { +- while (*q != ' ') /* eat up "PIC" or "PIC-foo" */ +- q++; +- while (*q == ' ') /* eat up spaces */ +- q++; +- p = q; +- } ++ p = strtok(NULL, " "); + } ++ if (p[strlen(p) - 1] == '\n') ++ p[strlen(p) - 1] = '\0'; ++ + + /* XXX Don't let NMI:, IPI: overwrite real values */ +- if (irq_label[i][0] == 0) +- strncpy (irq_label[i], p, 20); ++ if (irq_label[real_nr_irqs][0] == 0) { ++ strncpy (irq_label[real_nr_irqs], p, 20); ++ ++real_nr_irqs; + } ++ } + } + + +@@ -484,7 +459,7 @@ + while (fgets (line, sizeof (line), dmafp)) { + int foo = strcspn (&line[4], " \n"); + +- for (i = 0; i < nr_irqs; i++) { ++ for (i = 0; i < real_nr_irqs; i++) { + if (strncmp (&line[4], irq_label[i], foo) == 0) { + tmplen = snprintf (tmp, sizeof(tmp), " [%ld]", + atol (strtok (line, ":"))); +@@ -509,9 +484,9 @@ + char *label; + } squirqs[nr_irqs]; + +- for (i = 0; i < nr_irqs; i++) { ++ for (i = 0; i < real_nr_irqs; i++) { + if (new.intr[i] || irq_label[i][0]) { +- squirqs[howmany].nr = i; ++ squirqs[howmany].nr = real_irq_nums[i]; + squirqs[howmany].count = bDIFF(intr[i]); + squirqs[howmany].label = irq_label[i]; + howmany++; +@@ -523,11 +498,11 @@ + for (i = 0; i < rows; i++) { + /* The last row may be incomplete if howmany is odd, hence: */ + if (i == rows - 1 && howmany & 1) { +- printf ("irq%3d:%10lu %-21s\n", ++ printf ("irq%4d:%10lu %-21s\n", + squirqs[i].nr, squirqs[i].count, squirqs[i].label); + } else { +- printf ("irq%3d:%10lu %-21s " +- "irq%3d:%10lu %-21s\n", ++ printf ("irq%4d:%10lu %-21s " ++ "irq%4d:%10lu %-21s\n", + squirqs[i].nr, squirqs[i].count, squirqs[i].label, + squirqs[i+rows].nr, + squirqs[i+rows].count, +@@ -535,10 +510,10 @@ + } + } + } else { +- for (i = 0; i < nr_irqs / 2; i++) ++ for (i = 0; i < real_nr_irqs / 2; i++) + printf ("irq%3d:%10lu %-21s " + "irq%3d:%10lu %-21s\n", +- i, bDIFF (intr[i]), irq_label[i], ++ real_irq_nums[i], bDIFF (intr[i]), irq_label[i], + i + (nr_irqs / 2), + bDIFF (intr[i + (nr_irqs / 2)]), + irq_label[i + (nr_irqs / 2)]); +@@ -859,10 +834,10 @@ + for(i = 5; i < len; i++) + if(line[i] == ' ') + nr_irqs++; +- new.intr = my_xcalloc (nr_irqs, sizeof (unsigned int)); +- old.intr = my_xcalloc (nr_irqs, sizeof (unsigned int)); ++ new.intr = my_xcalloc (nr_irqs, sizeof (unsigned long)); ++ old.intr = my_xcalloc (nr_irqs, sizeof (unsigned long)); + memset (&base, 0, sizeof (struct info)); +- base.intr = my_xcalloc (nr_irqs, sizeof (unsigned int)); ++ base.intr = my_xcalloc (nr_irqs, sizeof (unsigned long)); + continue; + } + /* While we're at it, fill in booted. */ diff --git a/procinfo-18-intrprint.patch b/procinfo-18-intrprint.patch new file mode 100644 index 0000000000000000000000000000000000000000..90b35e0f31750d78bb7f17cd5182251c16a3c4a1 --- /dev/null +++ b/procinfo-18-intrprint.patch @@ -0,0 +1,18 @@ +diff -up procinfo-18/procinfo.c.intrprint procinfo-18/procinfo.c +--- procinfo-18/procinfo.c.intrprint 2010-10-12 13:37:18.000000000 +0200 ++++ procinfo-18/procinfo.c 2010-10-12 13:44:25.500001055 +0200 +@@ -498,11 +498,11 @@ first_page (long sl) + for (i = 0; i < rows; i++) { + /* The last row may be incomplete if howmany is odd, hence: */ + if (i == rows - 1 && howmany & 1) { +- printf ("irq%4d:%10lu %-21s\n", ++ printf ("irq%4d:%10lu %-20s\n", + squirqs[i].nr, squirqs[i].count, squirqs[i].label); + } else { +- printf ("irq%4d:%10lu %-21s " +- "irq%4d:%10lu %-21s\n", ++ printf ("irq%4d:%10lu %-20s " ++ "irq%4d:%10lu %-20s\n", + squirqs[i].nr, squirqs[i].count, squirqs[i].label, + squirqs[i+rows].nr, + squirqs[i+rows].count, diff --git a/procinfo-18-man-comment.patch b/procinfo-18-man-comment.patch new file mode 100644 index 0000000000000000000000000000000000000000..f0b22e1b0021639410a8648f7fdd76746d382ddd --- /dev/null +++ b/procinfo-18-man-comment.patch @@ -0,0 +1,14 @@ +diff -up procinfo-18/procinfo.8~ procinfo-18/procinfo.8 +--- procinfo-18/procinfo.8~ 2010-10-12 15:42:48.999001121 +0200 ++++ procinfo-18/procinfo.8 2010-10-12 15:42:49.007001089 +0200 +@@ -178,8 +178,8 @@ or + option). Modules with a use count larger than 0 are marked with an + asterisk. + +-." Deleted modules are marked with a `d', uninitialized +-." modules with a `u', and modules with a bad state flag with a `b'. ++.\" Deleted modules are marked with a `d', uninitialized ++.\" modules with a `u', and modules with a bad state flag with a `b'. + + .TP + .BI Character\ and\ Block\ Devices: diff --git a/procinfo-18-maxdev.patch b/procinfo-18-maxdev.patch new file mode 100644 index 0000000000000000000000000000000000000000..5a2806a7f74b164f816472e2c7716033f3af8c54 --- /dev/null +++ b/procinfo-18-maxdev.patch @@ -0,0 +1,28 @@ +--- procinfo-18/procinfo.h.maxdev 2004-12-16 18:02:26.000000000 +0100 ++++ procinfo-18/procinfo.h 2004-12-17 11:18:11.239523416 +0100 +@@ -69,10 +69,10 @@ + #define CDRV 0 + #define BDRV 1 + #ifndef MAX_CHRDEV +-#define MAX_CHRDEV 32 ++#define MAX_CHRDEV 512 + #endif + #ifndef MAX_BLKDEV +-#define MAX_BLKDEV 32 ++#define MAX_BLKDEV 512 + #endif + #define MAX_DEV MAX(MAX_CHRDEV, MAX_BLKDEV) + +--- procinfo-18/procinfo.c.maxdev 2004-12-17 11:19:52.421141472 +0100 ++++ procinfo-18/procinfo.c 2004-12-17 11:20:49.312492672 +0100 +@@ -613,7 +613,9 @@ + printf ("%s\nCharacter Devices: " + "Block Devices:\n", + fs ? ce : ""); +- while (fgets (line, sizeof (line), devicesfp)) { ++ while (fgets (line, sizeof (line), devicesfp) && ++ count[CDRV] < MAX_DEV && ++ count[BDRV] < MAX_DEV) { + switch (line[0]) { + case 'C': + which = CDRV; diff --git a/procinfo-18-mharris-use-sysconf.patch b/procinfo-18-mharris-use-sysconf.patch new file mode 100644 index 0000000000000000000000000000000000000000..ac4e58cd7276af565b29c4992a14a7cf4a638a08 --- /dev/null +++ b/procinfo-18-mharris-use-sysconf.patch @@ -0,0 +1,23 @@ +--- procinfo-18/procinfo.c.mharris-use-sysconf 2004-01-16 15:40:37.000000000 -0500 ++++ procinfo-18/procinfo.c 2004-01-17 02:01:16.000000000 -0500 +@@ -837,19 +837,7 @@ + } + + /* Count number of CPUs */ +- cpuinfofp = myfopen (PROC_DIR "cpuinfo"); +- if (cpuinfofp) { +- while (fgets (line, sizeof (line), cpuinfofp)) +- if (!strncmp ("processor", line, 9)) /* intel */ +- nr_cpus++; +- else if (!strncmp ("ncpus ", line, 6)) /* sparc */ +- nr_cpus = atoi(line+19); +- else if (!strncmp ("cpus detected", line, 13)) /* alpha */ +- nr_cpus = atoi(line+27); +- fclose (cpuinfofp); +- } +- if (nr_cpus == 0) +- nr_cpus = 1; ++ nr_cpus = sysconf (_SC_NPROCESSORS_ONLN); + + /* Gets called from winsz(), but in case stdout is redirected: */ + version = make_version (versionfp); diff --git a/procinfo-18-ranges.patch b/procinfo-18-ranges.patch new file mode 100644 index 0000000000000000000000000000000000000000..7bc1359b7e5417535a44eb84a0bbf20acc5d2d5f --- /dev/null +++ b/procinfo-18-ranges.patch @@ -0,0 +1,40 @@ +--- procinfo-18/procinfo.c.ranges 2005-10-12 12:07:20.000000000 +0200 ++++ procinfo-18/procinfo.c 2005-10-12 12:09:17.000000000 +0200 +@@ -231,8 +231,8 @@ + + fseek (loadavgfp, 0L, SEEK_SET); + fgets (line, sizeof (line), loadavgfp); +- strcpy (loadavg, line); +- loadavg[strlen (loadavg) - 1] = '\0'; ++ strncpy (loadavg, line, sizeof (loadavg)); ++ loadavg[sizeof (loadavg) - 1] = '\0'; + fgets (line, sizeof (line), loadavgfp); + + printf ("Bootup: %s Load average: %s\n\n", booted, loadavg); +@@ -481,7 +481,7 @@ + + for (i = 0; i < nr_irqs; i++) { + if (strncmp (&line[4], irq_label[i], foo) == 0) { +- tmplen = sprintf (tmp, " [%ld]", ++ tmplen = snprintf (tmp, sizeof(tmp), " [%ld]", + atol (strtok (line, ":"))); + + if (strlen (irq_label[i]) > (21 - tmplen)) { +@@ -686,7 +686,7 @@ + fs = strchr (line, '\t'); + fs = strtok (fs + 1, "\n"); + if (line[0] == 'n') { +- sprintf (tmp, "[%s]", fs); ++ snprintf (tmp, sizeof(tmp), "[%s]", fs); + printf ("%-20s", tmp); + } else + printf ("%-20s", fs); +@@ -1003,7 +1003,7 @@ + if (strlen (line) > 1) { + tmpsl = atof (line); + sl = (long) (tmpsl * 1000000.0); +- sprintf (line, "delay set to %f", tmpsl); ++ snprintf (line, sizeof(line), "delay set to %f", tmpsl); + message = line; + } + redrawn = 1; diff --git a/procinfo-18-socklist.patch b/procinfo-18-socklist.patch new file mode 100644 index 0000000000000000000000000000000000000000..aaf7ff39c7004709396c36f9622e454ead305c4f --- /dev/null +++ b/procinfo-18-socklist.patch @@ -0,0 +1,19 @@ +--- socklist.orig 2010-01-28 10:33:43.977683369 -0500 ++++ socklist.pl 2010-01-28 10:33:25.757680751 -0500 +@@ -87,12 +87,15 @@ + ($cmd) = ( $l=~/Name:\s*(\S+)/ ); + close(CMD); + } +- printf "%s %6d %10d %6d %6d %4d %s\n", ++ printf "%-4s%6d %10d %6d %6d %4d %s\n", + $_[0], $a ,$F[9], $F[7], $pid, $fd, $cmd; + } + close(FILE); + } + + scheck("tcp"); ++scheck("tcp6"); + scheck("udp"); ++scheck("udp6"); + scheck("raw"); ++scheck("raw6"); diff --git a/procinfo-18-version.patch b/procinfo-18-version.patch new file mode 100644 index 0000000000000000000000000000000000000000..1a602cdc2e2311b823ab47f0cbad046b9363c49a --- /dev/null +++ b/procinfo-18-version.patch @@ -0,0 +1,17 @@ +diff -up procinfo-18/routines.c.version procinfo-18/routines.c +--- procinfo-18/routines.c.version 2010-10-12 13:37:18.000000000 +0200 ++++ procinfo-18/routines.c 2010-10-12 13:40:29.166001055 +0200 +@@ -273,6 +273,13 @@ make_version (FILE * versionfp) + ret = sscanf (line, "Linux version %s (%[^)]) (gcc %[^(] (%*[^)])) #%s %[^\n]", + ver, host, gcc, compno, date); + ++ if (ret != 5) { /* Red Hat has different format of gcc version... */ ++ ret = sscanf (line, "Linux version %s (%[^)]) (gcc %[^)]) (%*[^)]) ) #%s %[^\n]", ++ ver, host, gcc, compno, date); ++ if(ret == 5) ++ strcat(gcc, ")"); ++ } ++ + if (ret == 3) { /* At least we've got ver & host right... */ + strcpy (gcc, "[can't parse]"); + strcpy (compno, "???"); diff --git a/procinfo-18.tar.gz b/procinfo-18.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8a6ce7dba42616a5cb86836001f4f011e7558a1e Binary files /dev/null and b/procinfo-18.tar.gz differ diff --git a/procinfo.spec b/procinfo.spec new file mode 100644 index 0000000000000000000000000000000000000000..efec18fb5751533e54ae252e5176cab1a2dcb4d3 --- /dev/null +++ b/procinfo.spec @@ -0,0 +1,75 @@ +Name: procinfo +Version: 18 +Release: 42 +Summary: A tool for displaying system information +License: GPL+ +Source: ftp://ftp.cistron.nl/pub/people/00-OLD/svm/procinfo-%{version}.tar.gz +Patch0: procinfo-14-misc.patch +Patch3: procinfo-17-mandir.patch +Patch5: procinfo-17-uptime.patch +Patch6: procinfo-17-lsdev.patch +Patch7: procinfo-18-acct.patch +Patch8: procinfo-18-mharris-use-sysconf.patch +Patch9: procinfo-18-maxdev.patch +Patch10: procinfo-18-ranges.patch +Patch11: procinfo-18-cpu-steal.patch +Patch12: procinfo-18-intr.patch +Patch13: procinfo-18-intrprint.patch +Patch14: procinfo-18-version.patch +Patch15: procinfo-18-man-comment.patch +Patch16: procinfo-18-socklist.patch +Patch17: procinfo-18-idle-overflow.patch + +BuildRequires: ncurses-devel gcc + +%package help +Summary: Documentation for procinfo + +%description +This package provides tools for displaying information about the system. +It is easy to install and use it. + +%description help +This package contains documentation for procinfo. + +%prep +%setup -q +%patch0 -p1 +%patch3 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p0 +%patch17 -p1 + +%build +make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -I/usr/include/ncurses" LDFLAGS= LDLIBS=-lncurses + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_bindir} +mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8 +make install prefix=$RPM_BUILD_ROOT/usr mandir=$RPM_BUILD_ROOT/%{_mandir} + +%files +%doc CHANGES README +%{_bindir}/procinfo +%{_bindir}/socklist +%{_bindir}/lsdev + +%files help +%{_mandir}/man8/lsdev.8* +%{_mandir}/man8/procinfo.8* +%{_mandir}/man8/socklist.8* + +%changelog +* Thu Feb 13 2020 openEuler Buildteam - 18-42 +- DESC:update the spec