Hello community,
here is the log from the commit of package procps for openSUSE:Factory
checked in at Fri May 15 21:45:48 CEST 2009.
--------
--- procps/procps.changes 2009-03-11 15:54:17.000000000 +0100
+++ procps/procps.changes 2009-05-11 12:44:10.000000000 +0200
@@ -1,0 +2,24 @@
+Mon May 11 12:42:59 CEST 2009 - werner@suse.de
+
+- Update to procps-3.2.8
+ * ps: allow "+" in sort specifications, as in man page
+ * ps: recognize SCHED_ISO and SCHED_IDLE
+ * ps: document SCHED_BATCH and add a "see also" for stime
+ * ps: man page less ambiguous
+ * top: normal exit code should be 0
+ * top: misc fixes
+ * pgrep: usage error should exit with 2
+ * vmstat: use EXIT_FAILURE -- thanks Yoshio Nakamura
+ * sysctl: fix crash -- thanks Steinar Gunderson
+ * watch: tolerate umlauts
+ * pmap: range limits with -A low,high
+ * update /dev/tty* info to May 2009 devices.txt
+ * don't read off end of string const
+- Adapt our patches
+
+-------------------------------------------------------------------
+Fri May 8 15:51:36 CEST 2009 - werner@suse.de
+
+- top: shows correct values on 32bit arch (bnc#497544)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
procps-3.2.3-buffersize.diff
procps-3.2.5-pmap-smaps-rml-2.patch
procps-3.2.7-glibc-2.6.1.dif
procps-3.2.7-manycpus.diff
procps-3.2.7-pgrep_coption.dif
procps-3.2.7-pmap.patch
procps-3.2.7-slab.patch
procps-3.2.7.tar.bz2
procps-3.2.7-toosmall.dif
New:
----
procps-3.2.8-buffersize.diff
procps-3.2.8-glibc-2.6.1.dif
procps-3.2.8-manycpus.diff
procps-3.2.8-pgrep_coption.dif
procps-3.2.8-pmap-smaps-rml-2.patch
procps-3.2.8-slab.patch
procps-3.2.8.tar.bz2
procps-3.2.8-toosmall.dif
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ procps.spec ++++++
--- /var/tmp/diff_new_pack.pX7566/_old 2009-05-15 21:39:23.000000000 +0200
+++ /var/tmp/diff_new_pack.pX7566/_new 2009-05-15 21:39:23.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package procps (Version 3.2.7)
+# spec file for package procps (Version 3.2.8)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -26,8 +26,8 @@
Group: System/Monitoring
PreReq: %fillup_prereq %insserv_prereq
AutoReqProv: on
-Version: 3.2.7
-Release: 152
+Version: 3.2.8
+Release: 1
Summary: ps utilities for /proc
Provides: ps
Obsoletes: ps
@@ -40,27 +40,26 @@
Patch2: procps-3.2.5-eof.diff
Patch3: procps-3.2.2-ia64.diff
Patch4: procps-3.2.7-stealtime.patch
-Patch6: procps-3.2.7-manycpus.diff
+Patch6: procps-3.2.8-manycpus.diff
Patch7: procps-3.2.2-w-notruncate.diff
Patch8: procps-3.2.2-w-simply-work.diff
Patch9: procps-3.2.7-top.1.diff
Patch10: procps-3.2.2-top-termsize.patch
-Patch11: procps-3.2.3-buffersize.diff
+Patch11: procps-3.2.8-buffersize.diff
Patch12: pwdx-bufferoverflow.diff
-Patch13: procps-3.2.5-pmap-smaps-rml-2.patch
-Patch14: procps-3.2.7-pmap.patch
+Patch13: procps-3.2.8-pmap-smaps-rml-2.patch
Patch15: procps-3.2.5-top-rc.patch
Patch16: procps-3.2.7-cpu_hotplug.patch
Patch17: procps-3.2.5-CPU-states.patch
Patch18: procps-3.2.7-readeof.patch
Patch19: procps-3.2.7-btime-from-proc-stat.patch
-Patch20: procps-3.2.7-glibc-2.6.1.dif
-Patch21: procps-3.2.7-slab.patch
+Patch20: procps-3.2.8-glibc-2.6.1.dif
+Patch21: procps-3.2.8-slab.patch
Patch22: procps-3.2.7-selinux.patch
Patch23: procps-3.2.7-accuracy.dif
-Patch24: procps-3.2.7-toosmall.dif
+Patch24: procps-3.2.8-toosmall.dif
Patch25: procps-3.2.7-cgroups_flag.diff
-Patch26: procps-3.2.7-pgrep_coption.dif
+Patch26: procps-3.2.8-pgrep_coption.dif
Patch27: procps-3.2.7-terabyte.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -96,22 +95,21 @@
%patch2 -p1
%patch3 -p1
%patch4 -p0
-%patch6 -p1
+%patch6 -p0
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
-%patch11 -p1
+%patch11 -p0
%patch12 -p1
-%patch13 -p1
-%patch14 -p0
+%patch13 -p0
%patch15 -p1
%patch16 -p1
%patch17
%patch18
%patch19 -p1
%patch20
-%patch21 -p1
+%patch21 -p0
%patch22
%patch23
%patch24
@@ -183,6 +181,24 @@
%_mandir/man8/sysctl.8.gz
%changelog
+* Mon May 11 2009 werner@suse.de
+- Update to procps-3.2.8
+ * ps: allow "+" in sort specifications, as in man page
+ * ps: recognize SCHED_ISO and SCHED_IDLE
+ * ps: document SCHED_BATCH and add a "see also" for stime
+ * ps: man page less ambiguous
+ * top: normal exit code should be 0
+ * top: misc fixes
+ * pgrep: usage error should exit with 2
+ * vmstat: use EXIT_FAILURE -- thanks Yoshio Nakamura
+ * sysctl: fix crash -- thanks Steinar Gunderson
+ * watch: tolerate umlauts
+ * pmap: range limits with -A low,high
+ * update /dev/tty* info to May 2009 devices.txt
+ * don't read off end of string const
+- Adapt our patches
+* Fri May 08 2009 werner@suse.de
+- top: shows correct values on 32bit arch (bnc#497544)
* Wed Mar 11 2009 werner@suse.de
- top: show MB in case of TB of physical memory (bnc#484271)
* Mon Feb 09 2009 werner@suse.de
@@ -598,7 +614,7 @@
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Tue Sep 07 1999 werner@suse.de
- Avoid SEGV if /proc isn't mounted (e.g. in single user mode)
-* Mon Sep 06 1999 werner@suse.de
+* Tue Sep 07 1999 werner@suse.de
- Fix some maunal page (missed tbl mark, some nasty .TH's)
* Wed Aug 18 1999 werner@suse.de
- Update procinfo (ver 17), procps (ver 2.0.2) but hold
++++++ procps-3.2.7-terabyte.dif ++++++
--- /var/tmp/diff_new_pack.pX7566/_old 2009-05-15 21:39:23.000000000 +0200
+++ /var/tmp/diff_new_pack.pX7566/_new 2009-05-15 21:39:23.000000000 +0200
@@ -6,7 +6,7 @@
+ /* Show memory by default as kB */
+static int shift = 10;
-+#define S(X) (((unsigned long long)(X)<<10)>>shift)
++#define S(X) (unsigned long)(((unsigned long long)(X)<<10)>>shift)
+
// This is the select() timeout. Clear it in sig handlers to avoid a race.
// (signal happens just as we are about to select() and thus does not
++++++ procps-3.2.3-buffersize.diff -> procps-3.2.8-buffersize.diff ++++++
--- procps/procps-3.2.3-buffersize.diff 2006-02-20 11:59:48.000000000 +0100
+++ procps/procps-3.2.8-buffersize.diff 2009-05-11 12:43:56.000000000 +0200
@@ -1,10 +1,10 @@
---- procps-3.2.5/proc/sysinfo.c
-+++ procps-3.2.5/proc/sysinfo.c
-@@ -43,7 +43,7 @@
- #define VMINFO_FILE "/proc/vmstat"
- static int vminfo_fd = -1;
+--- proc/sysinfo.c
++++ proc/sysinfo.c 2009-05-11 11:18:28.142402352 +0200
+@@ -45,7 +45,7 @@ static int vminfo_fd = -1;
--static char buf[1024];
+ // As of 2.6.24 /proc/meminfo seems to need 888 on 64-bit,
+ // and would need 1258 if the obsolete fields were there.
+-static char buf[2048];
+static char buf[4096];
/* This macro opens filename only if necessary and seeks to 0 so
++++++ procps-3.2.7-glibc-2.6.1.dif -> procps-3.2.8-glibc-2.6.1.dif ++++++
--- procps/procps-3.2.7-glibc-2.6.1.dif 2008-02-14 12:04:47.000000000 +0100
+++ procps/procps-3.2.8-glibc-2.6.1.dif 2009-05-11 12:43:57.000000000 +0200
@@ -1,5 +1,5 @@
--- sysctl.c
-+++ sysctl.c 2008-02-14 12:04:35.540780685 +0100
++++ sysctl.c 2008-02-14 12:04:36.000000000 +0100
@@ -128,6 +128,7 @@ static int ReadSetting(const char *restr
char *restrict outname;
char inbuf[1025];
@@ -8,15 +8,6 @@
if (!name || !*name) {
fprintf(stderr, ERR_INVALID_KEY, name);
-@@ -135,7 +136,7 @@ static int ReadSetting(const char *restr
- }
-
- /* used to open the file */
-- tmpname = malloc(strlen(name)+strlen(PROC_PATH)+1);
-+ tmpname = malloc(strlen(name)+strlen(PROC_PATH)+2);
- strcpy(tmpname, PROC_PATH);
- strcat(tmpname, name);
- slashdot(tmpname+strlen(PROC_PATH),'.','/'); /* change . to / */
@@ -144,6 +145,23 @@ static int ReadSetting(const char *restr
outname = strdup(name);
slashdot(outname,'/','.'); /* change / to . */
++++++ procps-3.2.7-manycpus.diff -> procps-3.2.8-manycpus.diff ++++++
--- procps/procps-3.2.7-manycpus.diff 2006-06-26 17:02:25.000000000 +0200
+++ procps/procps-3.2.8-manycpus.diff 2009-05-11 12:43:59.000000000 +0200
@@ -1,6 +1,6 @@
---- procps-3.2.7/top.c
-+++ procps-3.2.7/top.c 2006-06-26 16:26:56.000000000 +0200
-@@ -2480,21 +2480,21 @@
+--- top.c
++++ top.c 2009-05-11 11:14:53.402401350 +0200
+@@ -2489,21 +2489,21 @@ static void do_key (unsigned c)
static const char err_num_cpus[] = "\aSorry, terminal is not big enough";
#ifdef WARN_NOT_SMP
// standardized 'smp' errors
@@ -10,7 +10,7 @@
switch (c) {
case '1':
- if (Cpu_tot+7 > Screen_rows && !CHKw(Curwin, View_CPUSUM)) {
+ if (Cpu_tot+7 > Screen_rows && CHKw(Curwin, View_CPUSUM)) {
show_msg(err_num_cpus);
- break;
- }
@@ -21,7 +21,7 @@
#else
TOGw(Curwin, View_CPUSUM);
#endif
-+ }
++ }
break;
case 'a':
++++++ procps-3.2.7-pgrep_coption.dif -> procps-3.2.8-pgrep_coption.dif ++++++
--- procps/procps-3.2.7-pgrep_coption.dif 2008-12-15 17:53:07.000000000 +0100
+++ procps/procps-3.2.8-pgrep_coption.dif 2009-05-11 12:44:01.000000000 +0200
@@ -1,5 +1,5 @@
--- pgrep.1
-+++ pgrep.1 2007-10-05 22:36:42.000000000 +1000
++++ pgrep.1 2007-10-05 14:36:42.000000000 +0200
@@ -7,7 +7,7 @@
pgrep, pkill \- look up or signal processes based on name and other attributes
@@ -9,7 +9,7 @@
.br
[\-s \fIsid\fP,...] [\-u \fIeuid\fP,...] [\-U \fIuid\fP,...] [\-G \fIgid\fP,...]
.br
-@@ -38,6 +38,9 @@
+@@ -38,6 +38,9 @@ to each process instead of listing them
.SH OPTIONS
.TP
@@ -20,8 +20,8 @@
Sets the string used to delimit each process ID in the output (by
default a newline). (\fBpgrep\fP only.)
--- pgrep.c
-+++ pgrep.c 2007-10-05 22:35:52.000000000 +1000
-@@ -54,6 +54,7 @@
++++ pgrep.c 2009-05-11 12:38:44.945901308 +0200
+@@ -54,6 +54,7 @@ static int opt_oldest = 0;
static int opt_newest = 0;
static int opt_negate = 0;
static int opt_exact = 0;
@@ -29,16 +29,7 @@
static int opt_signal = SIGTERM;
static int opt_lock = 0;
static int opt_case = 0;
-@@ -77,7 +78,7 @@
- if (i_am_pkill)
- fprintf (stderr, "Usage: pkill [-SIGNAL] [-fvx] ");
- else
-- fprintf (stderr, "Usage: pgrep [-flvx] [-d DELIM] ");
-+ fprintf (stderr, "Usage: pgrep [-cflvx] [-d DELIM] ");
- fprintf (stderr, "[-n|-o] [-P PPIDLIST] [-g PGRPLIST] [-s SIDLIST]\n"
- "\t[-u EUIDLIST] [-U UIDLIST] [-G GIDLIST] [-t TERMLIST] "
- "[PATTERN]\n");
-@@ -562,7 +563,7 @@
+@@ -564,7 +565,7 @@ static void parse_opts (int argc, char *
strcat (opts, "ld:");
}
@@ -47,17 +38,17 @@
while ((opt = getopt (argc, argv, opts)) != -1) {
switch (opt) {
-@@ -610,6 +611,9 @@
+@@ -612,6 +613,9 @@ static void parse_opts (int argc, char *
exit(EXIT_SUCCESS);
// case 'c': // Solaris: match by contract ID
// break;
-+ case 'c':
-+ opt_count = 1;
-+ break;
++ case 'c':
++ opt_count = 1;
++ break;
case 'd': // Solaris: change the delimiter
opt_delim = strdup (optarg);
break;
-@@ -721,10 +725,14 @@
+@@ -723,10 +727,14 @@ int main (int argc, char *argv[])
procs[i].num, strerror (errno));
}
} else {
++++++ procps-3.2.5-pmap-smaps-rml-2.patch -> procps-3.2.8-pmap-smaps-rml-2.patch ++++++
--- procps/procps-3.2.5-pmap-smaps-rml-2.patch 2006-02-20 11:59:48.000000000 +0100
+++ procps/procps-3.2.8-pmap-smaps-rml-2.patch 2009-05-11 12:44:03.000000000 +0200
@@ -1,11 +1,6 @@
- pmap.1 | 76 +++++---
- pmap.c | 559 +++++++++++++++++++++++++++++------------------------------------
- 2 files changed, 297 insertions(+), 338 deletions(-)
-
-diff -urN procps-3.2.5/pmap.1 procps/pmap.1
---- procps-3.2.5/pmap.1 2005-10-11 14:49:20.000000000 -0400
-+++ procps/pmap.1 2005-10-12 10:39:28.000000000 -0400
-@@ -1,39 +1,57 @@
+--- pmap.1
++++ pmap.1 2009-05-11 12:14:59.377902682 +0200
+@@ -1,39 +1,60 @@
-'\" t
-.\" (The preceding line is a note to broken versions of man to tell
-.\" them to pre-process this man page with tbl)
@@ -27,7 +22,7 @@
-pmap [ -x | -d ] [ -q ] pids...
-pmap -V
-.fi
-+.BI "pmap [ \-d | \-q | \-h | \-V ] " pid
++.BI "pmap [ \-d | \-q | \-h | \-V | \-A\ low,high ] " pid
.SH DESCRIPTION
-The pmap command reports the memory map of a process or processes.
@@ -61,6 +56,9 @@
+.B\-d, \-\^\-device
+Display major and minor device numbers.
+.TP
++.B\-A, \-\-limit=low,high
++Limit results to the given range.
++.TP
+.B\-q, \-\^\-quiet
+Hide header and memory statistics.
+.TP
@@ -92,10 +90,9 @@
-to .
+The procps package is maintained by Albert Calahan. Please send
+bug reports to .
-diff -urN procps-3.2.5/pmap.c procps/pmap.c
---- procps-3.2.5/pmap.c 2005-10-11 14:49:21.000000000 -0400
-+++ procps/pmap.c 2005-10-12 10:52:09.000000000 -0400
-@@ -1,331 +1,272 @@
+--- pmap.c
++++ pmap.c 2009-05-11 12:12:27.653901642 +0200
+@@ -1,372 +1,395 @@
/*
- * Copyright 2002 by Albert Cahalan; all rights reserved.
- * This file may be used subject to the terms and conditions of the
@@ -109,28 +106,32 @@
+ *
+ * Chris Rivera
+ * Robert Love
++ * Werner Fink
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, v2, as
+ * published by the Free Software Foundation
+ *
+ * Copyright (C) 2003, 2005 Chris Rivera
++ * Copyright (C) 2009 Werner Fink
*/
#include
++#include
#include
-#include
-#include
-#include
-#include
#include
--#include
--
--#include
--#include
+#include
+#include
++#include
+ #include
+-#include
+-#include
+-
#include "proc/readproc.h"
#include "proc/version.h"
-#include "proc/escape.h"
@@ -138,15 +139,19 @@
-static void usage(void) NORETURN;
-static void usage(void){
- fprintf(stderr,
-- "Usage: pmap [-x | -d] [-q] pid...\n"
+- "Usage: pmap [-x | -d] [-q] [-A low,high] pid...\n"
- "-x show details\n"
- "-d show offset and device number\n"
- "-q quiet; less header/footer info\n"
- "-V show the version number\n"
+- "-A limit results to the given range\n"
- );
- exit(1);
-}
-
+-
+-static unsigned KLONG range_low;
+-static unsigned KLONG range_high = ~0ull;
-static int V_option;
-static int r_option; // ignored -- for SunOS compatibility
@@ -154,7 +159,6 @@
-static int d_option;
-static int q_option;
-
--
-static unsigned shm_minor = ~0u;
-
-static void discover_shm_minor(void){
@@ -194,24 +198,39 @@
- }
- }
+#define BUFFERSIZE 4096
-+#define OBJECTSIZE 128
++#define OBJECTSIZE 1024
- if(shmdt(addr)) perror("shmdt");
+-
+-out_destroy:
+- if(shmctl(shmid, IPC_RMID, NULL)) perror("IPC_RMID");
+struct smap {
+ unsigned long size;
+ unsigned long rss;
++ unsigned long pss;
+ unsigned long shared_clean;
+ unsigned long shared_dirty;
+ unsigned long private_clean;
+ unsigned long private_dirty;
++ unsigned long referenced;
++ unsigned long swap;
+};
+
++static unsigned long long range_low;
++static unsigned long long range_high = ~0ULL;
+static unsigned long mapped;
+static unsigned long shared;
+static unsigned long private;
+static unsigned long rss;
++static unsigned long pss;
+static unsigned long dirty;
++static unsigned long referenced;
++static unsigned long swap;
+static FILE *smaps_fp;
++static int maj, min, patch, dopss, noref, doswap;
++static long lbits;
++#define BLK ((lbits==64)?" ":"")
++#define WDT ((lbits==64)?16:8)
+
+static void usage(const char *cmd)
+{
@@ -220,14 +239,15 @@
+ "display offset and device numbers\n");
+ fprintf(stderr, " -q, --quiet "
+ "hide header and memory statistics\n");
++ fprintf(stderr, " -A, --limit=low,high "
++ "limit results to the given range\n");
+ fprintf(stderr, " -V, --version "
+ "display version information\n");
+ fprintf(stderr, " -h, --help "
+ "display this help\n");
+}
--out_destroy:
-- if(shmctl(shmid, IPC_RMID, NULL)) perror("IPC_RMID");
+- return;
+static int get_smap_data(struct smap *smap)
+{
+ unsigned long long data;
@@ -261,6 +281,18 @@
+ smap->rss = data;
+ rss += data;
+
++ if (dopss) {
++ /* get pss */
++ if (!fgets(buff, BUFFERSIZE, smaps_fp))
++ return 1;
++
++ assigned = sscanf(buff, "Pss: %lld", &data);
++ if (assigned != 1)
++ return 1;
++ smap->pss = data;
++ pss += data;
++ }
++
+ /* get shared clean */
+ if (!fgets(buff, BUFFERSIZE, smaps_fp))
+ return 1;
@@ -298,8 +330,33 @@
+ return 1;
+ smap->private_dirty = data;
+ dirty += data;
-
-- return;
++
++ if (noref)
++ goto out;
++
++ /* get referenced */
++ if (!fgets(buff, BUFFERSIZE, smaps_fp))
++ return 1;
++
++ assigned = sscanf(buff, "Referenced: %lld", &data);
++ if (assigned != 1)
++ return 1;
++ smap->referenced = data;
++ referenced += data;
++
++ if (!doswap)
++ goto out;
++
++ /* get swap */
++ if (!fgets(buff, BUFFERSIZE, smaps_fp))
++ return 1;
++
++ assigned = sscanf(buff, "Swap: %lld", &data);
++ if (assigned != 1)
++ return 1;
++ smap->swap = data;
++ swap += data;
++out:
+ return 0;
}
@@ -307,7 +364,7 @@
+{
+ unsigned long long low, high, size, offset;
+ unsigned long major, minor;
-+ struct smap smap = { .rss = 0 };
++ struct smap smap = { .rss = 0, .pss = 0 };
+ int assigned;
+ char read_perm, write_perm, exec_perm, access_type;
+ char obj_buff[OBJECTSIZE] = "[anon]";
@@ -336,16 +393,26 @@
+ else if (access_type == 'p' && write_perm == 'w')
+ private += size;
+
-+ printf("%08llx %6lluK ", low, size);
++ if(low > range_high)
++ return;
++ if(high < range_low)
++ return;
++
++ printf("%0*llx %6lluK ", WDT, low, size);
+
+ if (smaps_fp) {
+ printf("%6luK ", smap.rss);
++ if (dopss)
++ printf("%6luK ", smap.pss);
+ printf("%6luK ", smap.private_dirty + smap.shared_dirty);
++ if (doswap)
++ printf("%6luK ", smap.swap);
+ }
-static const char *mapping_name(proc_t *p, unsigned KLONG addr, unsigned KLONG len, const char *mapbuf, unsigned showpath, unsigned dev_major, unsigned dev_minor, unsigned long long inode){
- const char *cp;
--
++ printf("%c%c%c%c ", read_perm, write_perm, exec_perm, access_type);
+
- if(!dev_major && dev_minor==shm_minor && strstr(mapbuf,"/SYSV")){
- static char shmbuf[64];
- snprintf(shmbuf, sizeof shmbuf, " [ shmid=0x%Lx ]", inode);
@@ -368,7 +435,8 @@
- if( (p->start_stack >= addr) && (p->start_stack <= addr+len) ) cp = " [ stack ]";
- return cp;
-}
-+ printf("%c%c%c%c ", read_perm, write_perm, exec_perm, access_type);
++ if (show_devices)
++ printf("%0*llx %02lx:%02lx ", WDT, offset, major, minor);
-static int one_proc(proc_t *p){
- char buf[32];
@@ -406,6 +474,12 @@
- unsigned long long file_offset, inode;
- unsigned dev_major, dev_minor;
- sscanf(mapbuf,"%"KLF"x-%"KLF"x %31s %Lx %x:%x %Lu", &start, &end, flags, &file_offset, &dev_major, &dev_minor, &inode);
+-
+- if(start > range_high)
+- break;
+- if(end < range_low)
+- continue;
+-
- tmp = strchr(mapbuf,'\n');
- if(tmp) *tmp='\0';
- tmp = mapbuf;
@@ -468,6 +542,9 @@
-
- }
-
+-
+-
+-
- if(!q_option){
- if(x_option){
- if(sizeof(KLONG)==8){
@@ -497,9 +574,7 @@
- else printf(" total %8ldK\n", (total_shared + total_private_writeable + total_private_readonly) >> 10);
- }
- }
-+ if (show_devices)
-+ printf("%08llx %02lx:%02lx ", offset, major, minor);
-
+-
- return 0;
+ printf("%s\n", obj_buff);
}
@@ -511,17 +586,37 @@
+ char path[PATH_MAX];
+ char buff[BUFFERSIZE];
+ int o, show_devices = 0, quiet = 0;
++ struct utsname uts;
+ pid_t pid;
+
++ if (uname(&uts) < 0) {
++ fprintf(stderr, "error getting information about current kernel: %m\n");
++ exit(EXIT_FAILURE);
++ }
++ sscanf(uts.release, "%d.%d.%d", &maj, &min, &patch);
++
++ if ((maj > 2) || ((maj == 2) && ((min > 6) || ((min == 6) && (patch >= 27)))))
++ doswap++;
++ if ((maj > 2) || ((maj == 2) && ((min > 6) || ((min == 6) && (patch >= 25)))))
++ dopss++;
++ if ((maj < 2) || ((maj == 2) && ((min < 6) || ((min == 6) && (patch < 22)))))
++ noref++;
++
++ if ((lbits = sysconf(_SC_LONG_BIT)) < 0) {
++ fprintf(stderr, "error getting information about current kernel: %m\n");
++ exit(EXIT_FAILURE);
++ }
++
+ struct option longopts[] = {
+ { "help", 0, NULL, 'h' },
+ { "version", 0, NULL, 'V' },
+ { "quiet", 0, NULL, 'q' },
+ { "device", 0, NULL, 'd' },
++ { "limit", 0, NULL, 'A' },
+ { NULL, 0, NULL, 0 }
+ };
+
-+ while ((o = getopt_long(argc, argv, "hqdV", longopts, NULL)) != -1) {
++ while ((o = getopt_long(argc, argv, "hqdA:V", longopts, NULL)) != -1) {
+ switch (o) {
+ case 'V':
+ display_version();
@@ -532,6 +627,27 @@
+ case 'd':
+ show_devices = 1;
+ break;
++ case 'A':
++ if (!optarg || *optarg == 0) {
++ usage(argv[0]);
++ return 1;
++ } else {
++ char *low = optarg;
++ char *high = strchr(low, ',');
++ if (high) {
++ *high = '\0';
++ high++;
++ }
++ if (low)
++ range_low = strtoull(low, &low, 16);
++ if (high)
++ range_high = strtoull(high, &high, 16);
++ if (*low || *high) {
++ usage(argv[0]);
++ return 1;
++ }
++ }
++ break;
+ case 'h':
+ usage(argv[0]);
+ return 0;
@@ -572,11 +688,15 @@
+ smaps_fp = fopen(path, "r");
+
+ if (!quiet) {
-+ printf("START SIZE ");
++ printf("START%s SIZE ", BLK);
+
+ if (smaps_fp) {
+ printf(" RSS ");
++ if (dopss)
++ printf(" PSS ");
+ printf(" DIRTY ");
++ if (doswap)
++ printf(" SWAP ");
+ }
+
+ if (show_devices)
@@ -589,13 +709,25 @@
+ parse_line(pid, buff, show_devices);
+
+ if (!quiet) {
-+ if (smaps_fp)
-+ printf("Total: %6luK %6luK %6luK\n\n", mapped, rss, dirty);
-+ else
++ if (smaps_fp) {
++ printf("Total:%s ", BLK);
++ printf(" %6luK", mapped);
++ printf(" %6luK", rss);
++ if (dopss)
++ printf(" %6luK", pss);
++ printf(" %6luK", dirty);
++ if (doswap)
++ printf(" %6luK", swap);
++ printf("\n\n");
++ } else
+ printf("mapped: %luK ", mapped);
+
-+ printf("%luK writable-private, %luK readonly-private, and %luK shared\n",
-+ private, mapped - private - shared, shared);
++ if (noref)
++ printf("%luK writable-private, %luK readonly-private, and %luK shared\n",
++ private, mapped - private - shared, shared);
++ else
++ printf("%luK writable-private, %luK readonly-private, %luK shared, and %luK referenced\n",
++ private, mapped - private - shared, shared, referenced);
+ }
-int main(int argc, char *argv[]){
@@ -633,6 +765,35 @@
- case 'q':
- q_option++;
- break;
+- case 'A':{
+- char *arg1;
+- if(walk[1]){
+- arg1 = walk+1;
+- walk += strlen(walk)-1;
+- }else{
+- arg1 = *++argv;
+- if(!arg1)
+- usage();
+- }
+- char *arg2 = strchr(arg1,',');
+- if(arg2)
+- *arg2 = '\0';
+- arg2 = arg2 ? arg2++ : arg1;
+-
+- if(*arg1)
+- range_low = STRTOUKL(arg1,&arg1,16);
+- if(*arg2)
+- range_high = STRTOUKL(arg2,&arg2,16);
+- if(*arg1 || *arg2)
+- usage();
+- }
+- break;
+- case 'a': // Sun prints anon/swap reservations
+- case 'F': // Sun forces hostile ptrace-like grab
+- case 'l': // Sun shows unresolved dynamic names
+- case 'L': // Sun shows lgroup info
+- case 's': // Sun shows page sizes
+- case 'S': // Sun shows swap reservations
- default:
- usage();
- }
++++++ procps-3.2.7-slab.patch -> procps-3.2.8-slab.patch ++++++
--- procps/procps-3.2.7-slab.patch 2008-07-10 18:23:35.000000000 +0200
+++ procps/procps-3.2.8-slab.patch 2009-05-11 12:44:05.000000000 +0200
@@ -13,74 +13,58 @@
| Bart.
|
|
---- procps-3.2.7/proc/library.map
-+++ procps-3.2.7/proc/library.map 2008-03-08 10:17:01.000000000 +0100
-@@ -18,6 +18,8 @@
+--- proc/library.map
++++ proc/library.map 2009-05-11 12:30:56.561900807 +0200
+@@ -18,6 +18,8 @@ global:
kb_main_free; kb_main_total; kb_main_used; kb_swap_free;
kb_swap_total; kb_swap_used; kb_main_shared;
kb_low_total; kb_low_free; kb_high_total; kb_high_free;
-+ kb_swap_cached; kb_anon_pages; kb_bounce; kb_nfs_unstable;
-+ kb_slab_reclaimable; kb_slab_unreclaimable;
++ kb_swap_cached; kb_anon_pages; kb_bounce; kb_commit_limit;
++ kb_nfs_unstable; kb_swap_reclaimable; kb_swap_unreclaimable;
vm_pgpgin; vm_pgpgout; vm_pswpin; vm_pswpout;
free_slabinfo; put_slabinfo; get_slabinfo; get_proc_stats;
local: *;
---- procps-3.2.7/proc/sysinfo.c
-+++ procps-3.2.7/proc/sysinfo.c 2008-03-08 10:30:14.000000000 +0100
+--- proc/sysinfo.c
++++ proc/sysinfo.c 2009-05-11 12:32:54.873901042 +0200
@@ -8,6 +8,8 @@
// File for parsing top-level /proc entities. */
//
// June 2003, Fabian Frederick, disk and slab info
+// Copyright (c) 2003 Fabian Frederick.
+// Copyright (c) 2008 Bart Van Assche.
-
+
#include
#include
-@@ -503,6 +505,11 @@
- unsigned long kb_swap_free;
- unsigned long kb_swap_total;
- /* recently introduced */
+@@ -560,12 +562,12 @@ static unsigned long kb_vmalloc_chunk;
+ static unsigned long kb_vmalloc_total;
+ static unsigned long kb_vmalloc_used;
+ // seen on 2.6.24-rc6-git12
+-static unsigned long kb_anon_pages;
+-static unsigned long kb_bounce;
+-static unsigned long kb_commit_limit;
+-static unsigned long kb_nfs_unstable;
+-static unsigned long kb_swap_reclaimable;
+-static unsigned long kb_swap_unreclaimable;
+unsigned long kb_anon_pages;
+unsigned long kb_bounce;
++unsigned long kb_commit_limit;
+unsigned long kb_nfs_unstable;
-+unsigned long kb_slab_reclaimable;
-+unsigned long kb_slab_unreclaimable;
- unsigned long kb_high_free;
- unsigned long kb_high_total;
- unsigned long kb_low_free;
-@@ -539,6 +546,8 @@
- char *tail;
- static const mem_table_struct mem_table[] = {
- {"Active", &kb_active}, // important
-+ {"AnonPages", &kb_anon_pages},
-+ {"Bounce", &kb_bounce},
- {"Buffers", &kb_main_buffers}, // important
- {"Cached", &kb_main_cached}, // important
- {"Committed_AS", &kb_committed_as},
-@@ -556,10 +565,13 @@
- {"MemFree", &kb_main_free}, // important
- {"MemShared", &kb_main_shared}, // important, but now gone!
- {"MemTotal", &kb_main_total}, // important
-+ {"NFS_Unstable", &kb_nfs_unstable},
- {"PageTables", &kb_pagetables}, // kB version of vmstat nr_page_table_pages
- {"ReverseMaps", &nr_reversemaps}, // same as vmstat nr_page_table_pages
- {"Slab", &kb_slab}, // kB version of vmstat nr_slab
- {"SwapCached", &kb_swap_cached},
-+ {"SReclaimable", &kb_slab_reclaimable},
-+ {"SUnreclaim", &kb_slab_unreclaimable},
- {"SwapFree", &kb_swap_free}, // important
- {"SwapTotal", &kb_swap_total}, // important
- {"VmallocChunk", &kb_vmalloc_chunk},
-@@ -603,6 +615,7 @@
++unsigned long kb_swap_reclaimable;
++unsigned long kb_swap_unreclaimable;
+
+ void meminfo(void){
+ char namebuf[16]; /* big enough to hold any row name */
+@@ -645,6 +647,7 @@ nextline:
}
kb_swap_used = kb_swap_total - kb_swap_free;
kb_main_used = kb_main_total - kb_main_free;
-+ kb_main_cached += kb_slab_reclaimable + kb_swap_cached + kb_nfs_unstable;
++ kb_main_cached += kb_swap_reclaimable + kb_swap_cached + kb_nfs_unstable;
}
-
+
/*****************************************************************/
---- procps-3.2.7/proc/sysinfo.h
-+++ procps-3.2.7/proc/sysinfo.h 2008-03-08 10:15:41.000000000 +0100
-@@ -30,6 +30,11 @@
+--- proc/sysinfo.h
++++ proc/sysinfo.h 2008-03-08 10:15:41.000000000 +0100
+@@ -31,6 +31,11 @@ extern unsigned long kb_main_total;
extern unsigned long kb_swap_free;
extern unsigned long kb_swap_total;
/* recently introduced */
++++++ procps-3.2.7.tar.bz2 -> procps-3.2.8.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/Makefile new/procps-3.2.8/Makefile
--- old/procps-3.2.7/Makefile 2006-06-24 11:02:25.000000000 +0200
+++ new/procps-3.2.8/Makefile 2009-05-10 20:50:48.000000000 +0200
@@ -18,7 +18,7 @@
VERSION := 3
SUBVERSION := 2
-MINORVERSION := 7
+MINORVERSION := 8
TARVERSION := $(VERSION).$(SUBVERSION).$(MINORVERSION)
############ vars
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/NEWS new/procps-3.2.8/NEWS
--- old/procps-3.2.7/NEWS 2006-06-25 08:43:15.000000000 +0200
+++ new/procps-3.2.8/NEWS 2009-05-10 21:45:02.000000000 +0200
@@ -1,3 +1,19 @@
+procps-3.2.7 --> procps-3.2.8
+
+ps: allow "+" in sort specifications, as in man page rh208217
+ps: recognize SCHED_ISO and SCHED_IDLE
+ps: document SCHED_BATCH and add a "see also" for stime
+ps: man page less ambiguous
+top: normal exit code should be 0 #341272 #354255 rh199174
+top: misc fixes
+pgrep: usage error should exit with 2 #413383
+vmstat: use EXIT_FAILURE -- thanks Yoshio Nakamura #425492
+sysctl: fix crash -- thanks Steinar Gunderson #423704
+watch: tolerate umlauts #207103
+pmap: range limits with -A low,high
+update /dev/tty* info to May 2009 devices.txt
+don't read off end of string const rh469495 rh498182
+
procps-3.2.6 --> procps-3.2.7
top: document H option -- thanks Tony Ernst
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/pgrep.c new/procps-3.2.8/pgrep.c
--- old/procps-3.2.7/pgrep.c 2006-06-25 02:39:25.000000000 +0200
+++ new/procps-3.2.8/pgrep.c 2007-05-28 02:11:07.000000000 +0200
@@ -70,18 +70,21 @@
static char *opt_pattern = NULL;
static char *opt_pidfile = NULL;
-
static int usage (int opt) NORETURN;
static int usage (int opt)
{
+ int err = (opt=='?'); /* getopt() uses '?' to mark an error */
+ FILE *fp = err ? stderr : stdout;
+
if (i_am_pkill)
- fprintf (stderr, "Usage: pkill [-SIGNAL] [-fvx] ");
+ fprintf (fp, "Usage: pkill [-SIGNAL] [-fvx] ");
else
- fprintf (stderr, "Usage: pgrep [-flvx] [-d DELIM] ");
- fprintf (stderr, "[-n|-o] [-P PPIDLIST] [-g PGRPLIST] [-s SIDLIST]\n"
+ fprintf (fp, "Usage: pgrep [-flvx] [-d DELIM] ");
+ fprintf (fp, "[-n|-o] [-P PPIDLIST] [-g PGRPLIST] [-s SIDLIST]\n"
"\t[-u EUIDLIST] [-U UIDLIST] [-G GIDLIST] [-t TERMLIST] "
"[PATTERN]\n");
- exit (opt == '?' ? EXIT_SUCCESS : EXIT_USAGE);
+
+ exit(err ? EXIT_USAGE : EXIT_SUCCESS);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/pmap.c new/procps-3.2.8/pmap.c
--- old/procps-3.2.7/pmap.c 2005-01-11 02:41:30.000000000 +0100
+++ new/procps-3.2.8/pmap.c 2008-10-19 21:34:34.000000000 +0200
@@ -28,23 +28,26 @@
static void usage(void) NORETURN;
static void usage(void){
fprintf(stderr,
- "Usage: pmap [-x | -d] [-q] pid...\n"
+ "Usage: pmap [-x | -d] [-q] [-A low,high] pid...\n"
"-x show details\n"
"-d show offset and device number\n"
"-q quiet; less header/footer info\n"
"-V show the version number\n"
+ "-A limit results to the given range\n"
);
exit(1);
}
+static unsigned KLONG range_low;
+static unsigned KLONG range_high = ~0ull;
+
static int V_option;
static int r_option; // ignored -- for SunOS compatibility
static int x_option;
static int d_option;
static int q_option;
-
static unsigned shm_minor = ~0u;
static void discover_shm_minor(void){
@@ -155,6 +158,12 @@
unsigned long long file_offset, inode;
unsigned dev_major, dev_minor;
sscanf(mapbuf,"%"KLF"x-%"KLF"x %31s %Lx %x:%x %Lu", &start, &end, flags, &file_offset, &dev_major, &dev_minor, &inode);
+
+ if(start > range_high)
+ break;
+ if(end < range_low)
+ continue;
+
tmp = strchr(mapbuf,'\n');
if(tmp) *tmp='\0';
tmp = mapbuf;
@@ -217,6 +226,9 @@
}
+
+
+
if(!q_option){
if(x_option){
if(sizeof(KLONG)==8){
@@ -286,6 +298,35 @@
case 'q':
q_option++;
break;
+ case 'A':{
+ char *arg1;
+ if(walk[1]){
+ arg1 = walk+1;
+ walk += strlen(walk)-1;
+ }else{
+ arg1 = *++argv;
+ if(!arg1)
+ usage();
+ }
+ char *arg2 = strchr(arg1,',');
+ if(arg2)
+ *arg2 = '\0';
+ arg2 = arg2 ? arg2++ : arg1;
+
+ if(*arg1)
+ range_low = STRTOUKL(arg1,&arg1,16);
+ if(*arg2)
+ range_high = STRTOUKL(arg2,&arg2,16);
+ if(*arg1 || *arg2)
+ usage();
+ }
+ break;
+ case 'a': // Sun prints anon/swap reservations
+ case 'F': // Sun forces hostile ptrace-like grab
+ case 'l': // Sun shows unresolved dynamic names
+ case 'L': // Sun shows lgroup info
+ case 's': // Sun shows page sizes
+ case 'S': // Sun shows swap reservations
default:
usage();
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/proc/devname.c new/procps-3.2.8/proc/devname.c
--- old/procps-3.2.7/proc/devname.c 2005-01-27 04:44:53.000000000 +0100
+++ new/procps-3.2.8/proc/devname.c 2009-05-03 08:39:54.000000000 +0200
@@ -22,6 +22,7 @@
// This is the buffer size for a tty name. Any path is legal,
// which makes PAGE_SIZE appropriate (see kernel source), but
// that is only 99% portable and utmp only holds 32 anyway.
+// We need at least 20 for guess_name().
#define TTY_NAME_SIZE 128
/* Who uses what:
@@ -45,10 +46,11 @@
typedef struct tty_map_node {
struct tty_map_node *next;
- unsigned major_number;
- unsigned minor_first, minor_last;
+ unsigned short devfs_type; // bool
+ unsigned short major_number;
+ unsigned minor_first;
+ unsigned minor_last;
char name[16];
- char devfs_type;
} tty_map_node;
static tty_map_node *tty_map = NULL;
@@ -65,7 +67,7 @@
if(bytes == -1) goto fail;
buf[bytes] = '\0';
p = buf;
- while(( p = strstr(p, " /dev/") )){
+ while(( p = strstr(p, " /dev/") )){ // " /dev/" is the second column
tty_map_node *tmn;
int len;
char *end;
@@ -82,7 +84,9 @@
len -= 2;
tmn->devfs_type = 1;
}
- strncpy(tmn->name, p, len);
+ if(len >= sizeof tmn->name)
+ len = sizeof tmn->name - 1; // mangle it to avoid overflow
+ memcpy(tmn->name, p, len);
p = end; /* set p to point past the %d as well if there is one */
while(*p == ' ') p++;
tmn->major_number = atoi(p);
@@ -130,7 +134,7 @@
}
// major 204 is a mess -- "Low-density serial ports"
-static const char low_density_names[][4] = {
+static const char low_density_names[][6] = {
"LU0", "LU1", "LU2", "LU3",
"FB0",
"SA0", "SA1", "SA2",
@@ -142,8 +146,48 @@
"SG0",
"SMX0", "SMX1", "SMX2",
"MM0", "MM1",
+"CPM0", "CPM1", "CPM2", "CPM3", /* "CPM4", "CPM5", */ // bad allocation?
+"IOC0", "IOC1", "IOC2", "IOC3", "IOC4", "IOC5", "IOC6", "IOC7",
+"IOC8", "IOC9", "IOC10", "IOC11", "IOC12", "IOC13", "IOC14", "IOC15",
+"IOC16", "IOC17", "IOC18", "IOC19", "IOC20", "IOC21", "IOC22", "IOC23",
+"IOC24", "IOC25", "IOC26", "IOC27", "IOC28", "IOC29", "IOC30", "IOC31",
+"VR0", "VR1",
+"IOC84", "IOC85", "IOC86", "IOC87", "IOC88", "IOC89", "IOC90", "IOC91",
+"IOC92", "IOC93", "IOC94", "IOC95", "IOC96", "IOC97", "IOC98", "IOC99",
+"IOC100", "IOC101", "IOC102", "IOC103", "IOC104", "IOC105", "IOC106", "IOC107",
+"IOC108", "IOC109", "IOC110", "IOC111", "IOC112", "IOC113", "IOC114", "IOC115",
+"SIOC0", "SIOC1", "SIOC2", "SIOC3", "SIOC4", "SIOC5", "SIOC6", "SIOC7",
+"SIOC8", "SIOC9", "SIOC10", "SIOC11", "SIOC12", "SIOC13", "SIOC14", "SIOC15",
+"SIOC16", "SIOC17", "SIOC18", "SIOC19", "SIOC20", "SIOC21", "SIOC22", "SIOC23",
+"SIOC24", "SIOC25", "SIOC26", "SIOC27", "SIOC28", "SIOC29", "SIOC30", "SIOC31",
+"PSC0", "PSC1", "PSC2", "PSC3", "PSC4", "PSC5",
+"AT0", "AT1", "AT2", "AT3", "AT4", "AT5", "AT6", "AT7",
+"AT8", "AT9", "AT10", "AT11", "AT12", "AT13", "AT14", "AT15",
+"NX0", "NX1", "NX2", "NX3", "NX4", "NX5", "NX6", "NX7",
+"NX8", "NX9", "NX10", "NX11", "NX12", "NX13", "NX14", "NX15",
+"J0", // minor is 186
+"UL0","UL1","UL2","UL3",
+"xvc0", // FAIL -- "/dev/xvc0" lacks "tty" prefix
+"PZ0","PZ1","PZ2","PZ3",
+"TX0","TX1","TX2","TX3","TX4","TX5","TX6","TX7",
+"SC0","SC1","SC2","SC3",
+"MAX0","MAX1","MAX2","MAX3",
};
+#if 0
+// test code
+#include
+#define AS(x) (sizeof(x)/sizeof((x)[0]))
+int main(int argc, char *argv[]){
+ int i = 0;
+ while(i 255) return 0; // should never happen; array index protection
t0 = "pqrstuvwxyzabcde"[tmpmin>>4];
t1 = "0123456789abcdef"[tmpmin&0x0f];
sprintf(buf, "/dev/tty%c%c", t0, t1);
break;
+ case 4:
+ if(min<64){
+ sprintf(buf, "/dev/tty%d", min);
+ break;
+ }
+ sprintf(buf, "/dev/ttyS%d", min-64);
+ break;
case 11: sprintf(buf, "/dev/ttyB%d", min); break;
case 17: sprintf(buf, "/dev/ttyH%d", min); break;
case 19: sprintf(buf, "/dev/ttyC%d", min); break;
@@ -195,13 +236,17 @@
case 188: sprintf(buf, "/dev/ttyUSB%d", min); break; /* bummer, 9-char */
case 204:
if(min >= sizeof low_density_names / sizeof low_density_names[0]) return 0;
- sprintf(buf, "/dev/tty%s", low_density_names[min]);
+ memcpy(buf,"/dev/tty",8);
+ memcpy(buf+8, low_density_names[min], sizeof low_density_names[0]);
+ buf[8 + sizeof low_density_names[0]] = '\0';
+// snprintf(buf, 9 + sizeof low_density_names[0], "/dev/tty%.*s", sizeof low_density_names[0], low_density_names[min]);
break;
case 208: sprintf(buf, "/dev/ttyU%d", min); break;
- case 216: sprintf(buf, "/dev/ttyUB%d", min); break;
+ case 216: sprintf(buf, "/dev/ttyUB%d", min); break; // "/dev/rfcomm%d" now?
case 224: sprintf(buf, "/dev/ttyY%d", min); break;
case 227: sprintf(buf, "/dev/3270/tty%d", min); break; /* bummer, HUGE */
case 229: sprintf(buf, "/dev/iseries/vtty%d", min); break; /* bummer, HUGE */
+ case 256: sprintf(buf, "/dev/ttyEQ%d", min); break;
default: return 0;
}
if(stat(buf, &sbuf) < 0) return 0;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/proc/smaps.c new/procps-3.2.8/proc/smaps.c
--- old/procps-3.2.7/proc/smaps.c 1970-01-01 01:00:00.000000000 +0100
+++ new/procps-3.2.8/proc/smaps.c 2008-10-20 10:53:06.000000000 +0200
@@ -0,0 +1,171 @@
+#if 0
+#include "procps.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "procps.h"
+
+struct smap_entry {
+ unsigned KLONG start;
+ unsigned KLONG beyond;
+ long long offset;
+ char flags[8];
+ unsigned dev_major;
+ unsigned dev_minor;
+ unsigned long long inode;
+
+ unsigned long rss;
+ unsigned long pss;
+ unsigned long sclean;
+ unsigned long sdirty;
+ unsigned long pclean;
+ unsigned long pdirty;
+ unsigned long ref;
+ unsigned long swap;
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// This code will surely make normal programmers cry. I need speed though,
+// and /proc/*/smaps should make anybody cry. (WTF kind of brain damage...?)
+
+struct smap_summary {
+ unsigned long size;
+ unsigned long rss;
+ unsigned long pss;
+ unsigned long sclean;
+ unsigned long sdirty;
+ unsigned long pclean;
+ unsigned long pdirty;
+ unsigned long ref;
+ unsigned long swap;
+};
+
+struct ssjt {
+ char str[16];
+ int len;
+ int offset;
+};
+
+#define JTE(o,x) {#x,sizeof(#x)-1,o}
+
+void get_smap_sums(struct smap_summary *restrict ss, const char *restrict const filename){
+ static struct ssjt table[] = {
+ JTE(-1,default),
+ JTE( 1,Rss),
+ JTE(-1,default),
+ JTE( 2,Pss),
+ JTE( 8,Swap),
+ JTE( 5,Private_Clean),
+ JTE( 6,Private_Dirty),
+ JTE(-1,default),
+ JTE( 7,Referenced),
+ JTE(-1,default),
+ JTE( 0,Size),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE(-1,default), // KernelPageSize would go here
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE( 4,Shared_Dirty),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE( 3,Shared_Clean),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE(-1,default),
+ JTE(-1,default),
+ };
+ char buf[20480];
+ int p1 = 0;
+ int p2 = 0;
+ memset(ss,0,sizeof *ss);
+ int fd = open(filename,O_RDONLY);
+ if(fd==-1)
+ return;
+ for(;;){
+ char *nlp = memchr(buf+p1,'\n',p2-p1);
+ if(!nlp){
+ if(p1){
+ // the memmove should never do anything, because the
+ // kernel seems to give us the greatest number of
+ // complete lines of text that fit in a single page
+ // (and thus p2-p1 is zero)
+ memmove(buf,buf+p1,p2-p1);
+ p2 -= p1;
+ p1 = 0;
+ }
+ ssize_t rb = read(fd,buf+p1,sizeof buf - p1);
+ if(rb < 1)
+ break;
+ p2 += rb;
+ nlp = memchr(buf+p1,'\n',p2-p1);
+ if(!nlp)
+ break;
+ }
+ char *s = buf+p1;
+ int len = nlp-s;
+ p1 += len+1;
+ if(len<27)
+ continue;
+//printf("j <%13.13s>\n",s);
+ if(s[0]<'A' || s[0]>'Z')
+ continue;
+ unsigned hash = ( (s[8]&15) + (s[1]&15) ) ^ (s[0]&3);
+ hash &= 31;
+//printf("x %2d <%13.13s>\n",hash,s);
+ if(s[table[hash].len] != ':')
+ continue;
+//printf("y %2d <%13.13s>\n",hash,s);
+ if(memcmp(table[hash].str,s,table[hash].len))
+ continue;
+//printf("z %2d <%13.13s>\n",hash,s);
+ s += table[hash].len;
+ while(*++s==' ')
+ ;
+ unsigned long ul = 0;
+ for(;;){
+ char c = *s++;
+ if(c != ' '){
+ ul *= 10;
+ ul += c-'0';
+ continue;
+ }
+ break;
+ }
+// if(table[hash].offset == 2)
+// printf("Pss:%20lu kB\n",ul);
+ unsigned long *ulp = &ss->size + table[hash].offset;
+ *ulp += ul;
+// memcpy(ss+table[hash].offset*sizeof(unsigned long), &ul, sizeof(unsigned long));
+ }
+ close(fd);
+}
+
+int main(int argc, char *argv[]){
+ struct smap_summary ss;
+ get_smap_sums(&ss, argv[1]);
+ printf("%9lu\n",ss.size);
+ printf("%9lu\n",ss.rss);
+ printf("%9lu\n",ss.pss);
+ printf("%9lu\n",ss.sclean);
+ printf("%9lu\n",ss.sdirty);
+ printf("%9lu\n",ss.pclean);
+ printf("%9lu\n",ss.pdirty);
+ printf("%9lu\n",ss.ref);
+ printf("%9lu\n",ss.swap);
+ return 0;
+}
+#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/proc/sysinfo.c new/procps-3.2.8/proc/sysinfo.c
--- old/procps-3.2.7/proc/sysinfo.c 2006-06-25 08:41:48.000000000 +0200
+++ new/procps-3.2.8/proc/sysinfo.c 2008-03-24 05:33:43.000000000 +0100
@@ -43,7 +43,9 @@
#define VMINFO_FILE "/proc/vmstat"
static int vminfo_fd = -1;
-static char buf[1024];
+// As of 2.6.24 /proc/meminfo seems to need 888 on 64-bit,
+// and would need 1258 if the obsolete fields were there.
+static char buf[2048];
/* This macro opens filename only if necessary and seeks to 0 so
* that successive calls to the functions are more efficient.
@@ -153,6 +155,7 @@
case 95 ... 105 : Hertz = 100; break; /* normal Linux */
case 124 ... 132 : Hertz = 128; break; /* MIPS, ARM */
case 195 ... 204 : Hertz = 200; break; /* normal << 1 */
+ case 247 ... 252 : Hertz = 250; break;
case 253 ... 260 : Hertz = 256; break;
case 393 ... 408 : Hertz = 400; break; /* normal << 2 */
case 790 ... 808 : Hertz = 800; break; /* normal << 3 */
@@ -530,6 +533,13 @@
static unsigned long kb_vmalloc_chunk;
static unsigned long kb_vmalloc_total;
static unsigned long kb_vmalloc_used;
+// seen on 2.6.24-rc6-git12
+static unsigned long kb_anon_pages;
+static unsigned long kb_bounce;
+static unsigned long kb_commit_limit;
+static unsigned long kb_nfs_unstable;
+static unsigned long kb_swap_reclaimable;
+static unsigned long kb_swap_unreclaimable;
void meminfo(void){
char namebuf[16]; /* big enough to hold any row name */
@@ -539,8 +549,11 @@
char *tail;
static const mem_table_struct mem_table[] = {
{"Active", &kb_active}, // important
+ {"AnonPages", &kb_anon_pages},
+ {"Bounce", &kb_bounce},
{"Buffers", &kb_main_buffers}, // important
{"Cached", &kb_main_cached}, // important
+ {"CommitLimit", &kb_commit_limit},
{"Committed_AS", &kb_committed_as},
{"Dirty", &kb_dirty}, // kB version of vmstat nr_dirty
{"HighFree", &kb_high_free},
@@ -556,8 +569,11 @@
{"MemFree", &kb_main_free}, // important
{"MemShared", &kb_main_shared}, // important, but now gone!
{"MemTotal", &kb_main_total}, // important
+ {"NFS_Unstable", &kb_nfs_unstable},
{"PageTables", &kb_pagetables}, // kB version of vmstat nr_page_table_pages
{"ReverseMaps", &nr_reversemaps}, // same as vmstat nr_page_table_pages
+ {"SReclaimable", &kb_swap_reclaimable}, // "swap reclaimable" (dentry and inode structures)
+ {"SUnreclaim", &kb_swap_unreclaimable},
{"Slab", &kb_slab}, // kB version of vmstat nr_slab
{"SwapCached", &kb_swap_cached},
{"SwapFree", &kb_swap_free}, // important
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/procps.spec new/procps-3.2.8/procps.spec
--- old/procps-3.2.7/procps.spec 2006-06-25 12:40:59.000000000 +0200
+++ new/procps-3.2.8/procps.spec 2009-05-10 20:25:17.000000000 +0200
@@ -3,7 +3,7 @@
Name: procps
%define major_version 3
%define minor_version 2
-%define revision 7
+%define revision 8
%define version %{major_version}.%{minor_version}.%{revision}
Version: %{version}
Release: 1
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/ps/output.c new/procps-3.2.8/ps/output.c
--- old/procps-3.2.7/ps/output.c 2006-06-19 01:27:02.000000000 +0200
+++ new/procps-3.2.8/ps/output.c 2009-05-10 21:24:50.000000000 +0200
@@ -606,13 +606,16 @@
static int pr_class(char *restrict const outbuf, const proc_t *restrict const pp){
switch(pp->sched){
case -1: return snprintf(outbuf, COLWID, "-"); // not reported
- case 0: return snprintf(outbuf, COLWID, "TS"); // SCHED_OTHER
+ case 0: return snprintf(outbuf, COLWID, "TS"); // SCHED_OTHER SCHED_NORMAL
case 1: return snprintf(outbuf, COLWID, "FF"); // SCHED_FIFO
case 2: return snprintf(outbuf, COLWID, "RR"); // SCHED_RR
- case 3: return snprintf(outbuf, COLWID, "B"); // SCHED_BATCH? (will be "B")
- case 4: return snprintf(outbuf, COLWID, "#4"); // SCHED_ISO? (Con Kolivas)
- case 5: return snprintf(outbuf, COLWID, "#5"); //
+ case 3: return snprintf(outbuf, COLWID, "B"); // SCHED_BATCH
+ case 4: return snprintf(outbuf, COLWID, "ISO"); // reserved for SCHED_ISO (Con Kolivas)
+ case 5: return snprintf(outbuf, COLWID, "IDL"); // SCHED_IDLE
+ case 6: return snprintf(outbuf, COLWID, "#6"); //
+ case 7: return snprintf(outbuf, COLWID, "#7"); //
case 8: return snprintf(outbuf, COLWID, "#8"); //
+ case 9: return snprintf(outbuf, COLWID, "#9"); //
default: return snprintf(outbuf, COLWID, "?"); // unknown value
}
}
@@ -968,6 +971,12 @@
}
#endif
+// This one is always thread-specific pending. (from Dragonfly BSD)
+static int pr_tsig(char *restrict const outbuf, const proc_t *restrict const pp){
+ return help_pr_sig(outbuf, pp->_sigpnd);
+}
+// This one is (wrongly?) thread-specific when printing thread lines,
+// but process-pending otherwise.
static int pr_sig(char *restrict const outbuf, const proc_t *restrict const pp){
return help_pr_sig(outbuf, pp->signal);
}
@@ -1328,7 +1337,6 @@
{"fuser", "FUSER", pr_fuser, sr_fuser, 8, USR, LNX, ET|USER},
{"gid", "GID", pr_egid, sr_egid, 5, 0, SUN, ET|RIGHT},
{"group", "GROUP", pr_egroup, sr_egroup, 8, GRP, U98, ET|USER},
-{"iac", "IAC", pr_nop, sr_nop, 4, 0, BSD, AN|RIGHT}, // DragonFly
{"ignored", "IGNORED", pr_sigignore,sr_nop, 9, 0, BSD, TO|SIGNAL}, /*sigignore*/
{"inblk", "INBLK", pr_nop, sr_nop, 5, 0, BSD, AN|RIGHT}, /*inblock*/
{"inblock", "INBLK", pr_nop, sr_nop, 5, 0, DEC, AN|RIGHT}, /*inblk*/
@@ -1423,7 +1431,7 @@
{"sgroup", "SGROUP", pr_sgroup, sr_sgroup, 8, GRP, LNX, ET|USER},
{"share", "-", pr_nop, sr_share, 1, MEM, LNX, PO|RIGHT},
{"sid", "SID", pr_sess, sr_session, 5, 0, XXX, PO|PIDMAX|RIGHT}, /* Sun & HP */
-{"sig", "PENDING", pr_sig, sr_nop, 9, 0, XXX, ET|SIGNAL}, /*pending*/
+{"sig", "PENDING", pr_sig, sr_nop, 9, 0, XXX, ET|SIGNAL}, /*pending -- Dragonfly uses this for whole-proc and "tsig" for thread */
{"sig_block", "BLOCKED", pr_sigmask, sr_nop, 9, 0, LNX, TO|SIGNAL},
{"sig_catch", "CATCHED", pr_sigcatch, sr_nop, 9, 0, LNX, TO|SIGNAL},
{"sig_ignore", "IGNORED",pr_sigignore, sr_nop, 9, 0, LNX, TO|SIGNAL},
@@ -1465,6 +1473,7 @@
{"tsess", "TSESS", pr_nop, sr_nop, 5, 0, BSD, PO|PIDMAX|RIGHT},
{"tsession", "TSESS", pr_nop, sr_nop, 5, 0, DEC, PO|PIDMAX|RIGHT},
{"tsid", "TSID", pr_nop, sr_nop, 5, 0, BSD, PO|PIDMAX|RIGHT},
+{"tsig", "PENDING", pr_tsig, sr_nop, 9, 0, BSD, ET|SIGNAL}, /* Dragonfly used this for thread-specific, and "sig" for whole-proc */
{"tsiz", "TSIZ", pr_tsiz, sr_nop, 4, 0, BSD, PO|RIGHT},
{"tt", "TT", pr_tty8, sr_tty, 8, 0, BSD, PO|LEFT},
{"tty", "TT", pr_tty8, sr_tty, 8, 0, U98, PO|LEFT}, /* Unix98 requires "TT" but has "TTY" too. :-( */ /* was 3 wide */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/ps/parser.c new/procps-3.2.8/ps/parser.c
--- old/procps-3.2.7/ps/parser.c 2006-06-25 09:14:58.000000000 +0200
+++ new/procps-3.2.8/ps/parser.c 2007-05-28 21:28:06.000000000 +0200
@@ -729,17 +729,6 @@
trace("x Select processes without controlling ttys\n");
simple_select |= SS_B_x;
break;
-#if 0
- case 'y':
- // DragonFlyBSD iac (interactivity measure) format
- // uid,pid,ppid,cpu,pri,iac,nice,wchan,state,tt,time,command
- // (they use 'Y' to sort by this "iac" thing; 'y' implies 'Y')
- // Range is -127 .. 127, with lower numbers being more
- // interactive and higher numbers more batch-like.
- trace("y Display interactivity measure\n");
- format_flags |= FF_Bv;
- break;
-#endif
case '-':
return "Embedded '-' among BSD options makes no sense.";
break;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/ps/ps.1 new/procps-3.2.8/ps/ps.1
--- old/procps-3.2.7/ps/ps.1 2005-10-30 03:44:03.000000000 +0100
+++ new/procps-3.2.8/ps/ps.1 2009-05-10 21:38:17.000000000 +0200
@@ -176,7 +176,7 @@
\fBt\fR option without any argument.
.opt \-a
-Select all processes except session leaders (see \fIgetsid\fR(2)) and
+Select all processes except both session leaders (see \fIgetsid\fR(2)) and
processes not associated with a terminal.
.opt a
@@ -884,6 +884,7 @@
than 24 hours ago, the output format is "\ HH:MM",
else it is "mmm\ dd"
(where mmm is the three letters of the month).
+See also \fBlstart\fR, \fBstart\fR, \fBstart_time\fR, and \fBstime\fR.
T}
bsdtime TIME T{
@@ -915,6 +916,12 @@
.br
RR SCHED_RR
.br
+B SCHED_BATCH
+.br
+ISO SCHED_ISO
+.br
+IDL SCHED_IDLE
+.br
? unknown value
T}
@@ -930,6 +937,12 @@
.br
RR SCHED_RR
.br
+B SCHED_BATCH
+.br
+ISO SCHED_ISO
+.br
+IDL SCHED_IDLE
+.br
? unknown value
T}
@@ -1065,6 +1078,7 @@
lstart STARTED T{
time the command started.
+See also \fBbsdstart\fR, \fBstart\fR, \fBstart_time\fR, and \fBstime\fR.
T}
lwp LWP T{
@@ -1132,6 +1146,12 @@
.br
RR SCHED_RR
.br
+B SCHED_BATCH
+.br
+ISO SCHED_ISO
+.br
+IDL SCHED_IDLE
+.br
? unknown value
T}
@@ -1189,8 +1209,9 @@
T}
sched SCH T{
-scheduling policy of the process. The policies sched_other, sched_fifo,
-and sched_rr are respectively displayed as 0,\ 1,\ and\ 2.
+scheduling policy of the process. The policies SCHED_OTHER (SCHED_NORMAL),
+SCHED_FIFO, SCHED_RR, SCHED_BATCH, SCHED_ISO, and SCHED_IDLE are respectively
+displayed as 0,\ 1,\ 2,\ 3,\ 4,\ and\ 5.
T}
sess SESS T{
@@ -1255,6 +1276,7 @@
the output format is "HH:MM:SS",
else it is "\ \ mmm\ dd"
(where mmm is a three\-letter month\ name).
+See also \fBlstart\fR, \fBbsdstart\fR, \fBstart_time\fR, and \fBstime\fR.
T}
start_time START T{
@@ -1263,6 +1285,7 @@
started the same year \fBps\fR was invoked,
or\ "mmmdd" if\ it was not started the same day,
or\ "HH:MM" otherwise.
+See also \fBbsdstart\fR, \fBstart\fR, \fBlstart\fR, and \fBstime\fR.
T}
stat STAT T{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/ps/sortformat.c new/procps-3.2.8/ps/sortformat.c
--- old/procps-3.2.7/ps/sortformat.c 2005-10-30 02:09:19.000000000 +0200
+++ new/procps-3.2.8/ps/sortformat.c 2007-05-28 05:40:30.000000000 +0200
@@ -325,6 +325,8 @@
if(*spec == '-'){
reverse = 1;
spec++;
+ } else if(*spec == '+'){
+ spec++;
}
fs = search_format_array(spec);
if(fs){
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/skill.c new/procps-3.2.8/skill.c
--- old/procps-3.2.7/skill.c 2004-09-09 15:49:38.000000000 +0200
+++ new/procps-3.2.8/skill.c 2008-03-24 06:48:39.000000000 +0100
@@ -309,6 +309,14 @@
pid = strtol(argv[argc],&endp,10);
if(!*endp){
if(!kill((pid_t)pid,signo)) continue;
+ // The UNIX standard contradicts itself. If at least one process
+ // is matched for each PID (as if processes could share PID!) and
+ // "the specified signal was successfully processed" (the systcall
+ // returned zero?) for at least one of those processes, then we must
+ // exit with zero. Note that an error might have also occured.
+ // The standard says we return non-zero if an error occurs. Thus if
+ // killing two processes gives 0 for one and EPERM for the other,
+ // we are required to return both zero and non-zero. Quantum kill???
exitvalue = 1;
continue;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/sysctl.c new/procps-3.2.8/sysctl.c
--- old/procps-3.2.7/sysctl.c 2006-06-25 02:51:51.000000000 +0200
+++ new/procps-3.2.8/sysctl.c 2007-05-28 03:54:22.000000000 +0200
@@ -135,7 +135,7 @@
}
/* used to open the file */
- tmpname = malloc(strlen(name)+strlen(PROC_PATH)+1);
+ tmpname = malloc(strlen(name)+strlen(PROC_PATH)+2);
strcpy(tmpname, PROC_PATH);
strcat(tmpname, name);
slashdot(tmpname+strlen(PROC_PATH),'.','/'); /* change . to / */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/TODO new/procps-3.2.8/TODO
--- old/procps-3.2.7/TODO 2005-06-21 23:59:48.000000000 +0200
+++ new/procps-3.2.8/TODO 2008-10-13 01:08:43.000000000 +0200
@@ -37,13 +37,22 @@
Add all the stuff Solaris has. This would also replace ptrace.
+---------------------- watch --------------------------
+
+Tolerate UTF-8.
+
+Tolerate color, bold, underline, etc. #129334
+
+Tolerate stderr. #420377 #155227 #225549
+
+Tolerate VT100 line-drawing characters. Maybe translate them.
+
---------------------- w --------------------------
The LOGIN@ column sometimes has a space in it. This makes correct
scripting difficult.
-Verify that DNS control does not give a user the power to specify
-arbitrary data for the FROM column. (could set root's VGA color map!)
+Time formats are demented.
---------------------- vmstat --------------------------
@@ -54,6 +63,8 @@
Stop storing fields with duplicate info (often different
units: kB and pages, seconds and jiffies) in the proc_t struct.
+Use own readdir code (assembly language) because glibc sucks ass.
+
---------------------- top -------------------------
Share more stuff with ps.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/top.c new/procps-3.2.8/top.c
--- old/procps-3.2.7/top.c 2006-06-25 08:41:48.000000000 +0200
+++ new/procps-3.2.8/top.c 2007-05-28 18:04:00.000000000 +0200
@@ -405,11 +405,13 @@
* Normal end of execution.
* catches:
* SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT and SIGTERM */
-static void end_pgm (int dont_care_sig) NORETURN;
-static void end_pgm (int dont_care_sig)
-{
- (void)dont_care_sig;
- bye_bye(stdout, 1, NULL);
+// FIXME: can't do this shit in a signal handler
+static void end_pgm (int sig) NORETURN;
+static void end_pgm (int sig)
+{
+ if(sig)
+ sig |= 0x80; // for a proper process exit code
+ bye_bye(stdout, sig, NULL);
}
@@ -458,6 +460,7 @@
* Suspend ourself.
* catches:
* SIGTSTP, SIGTTIN and SIGTTOU */
+// FIXME: can't do this shit in a signal handler!
static void suspend (int dont_care_sig)
{
(void)dont_care_sig;
@@ -477,7 +480,7 @@
putp(Cap_rmam);
}
-
+
/*###### Misc Color/Display support ####################################*/
/* macro to test if a basic (non-color) capability is valid
@@ -653,9 +656,12 @@
while ((lin_end = strchr(glob, '\n'))) {
/* create a local copy we can extend and otherwise abuse */
- memcpy(lin, glob, (unsigned)(lin_end - glob));
+ size_t amt = lin_end - glob;
+ if(amt > sizeof lin - 1)
+ amt = sizeof lin - 1; // shit happens
+ memcpy(lin, glob, amt);
/* zero terminate this part and prepare to parse substrings */
- lin[lin_end - glob] = '\0';
+ lin[amt] = '\0';
room = Screen_cols;
sub_beg = sub_end = lin;
*(rp = row) = '\0';
@@ -668,6 +674,9 @@
cap = Curwin->captab[(int)*sub_end];
*sub_end = '\0';
snprintf(tmp, sizeof(tmp), "%s%.*s%s", cap, room, sub_beg, Caps_off);
+ amt = strlen(tmp);
+ if(rp - row + amt + 1 > sizeof row)
+ goto overflow; // shit happens
rp = scat(rp, tmp);
room -= (sub_end - sub_beg);
sub_beg = ++sub_end;
@@ -677,7 +686,7 @@
}
if (unlikely(0 >= room)) break; /* skip substrings that won't fit */
}
-
+overflow:
if (interact) PUTT("%s%s\n", row, Cap_clr_eol);
else PUFF("%s%s\n", row, Cap_clr_eol);
glob = ++lin_end; /* point to next line (maybe) */
@@ -2485,7 +2494,7 @@
switch (c) {
case '1':
- if (Cpu_tot+7 > Screen_rows && !CHKw(Curwin, View_CPUSUM)) {
+ if (Cpu_tot+7 > Screen_rows && CHKw(Curwin, View_CPUSUM)) {
show_msg(err_num_cpus);
break;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/vmstat.c new/procps-3.2.8/vmstat.c
--- old/procps-3.2.7/vmstat.c 2006-06-25 08:41:48.000000000 +0200
+++ new/procps-3.2.8/vmstat.c 2007-05-28 02:14:57.000000000 +0200
@@ -290,7 +290,7 @@
fDiskstat=fopen("/proc/diskstats","rb");
if(!fDiskstat){
fprintf(stderr, "Your kernel doesn't support diskstat. (2.5.70 or above required)\n");
- exit(0);
+ exit(EXIT_FAILURE);
}
fclose(fDiskstat);
@@ -400,7 +400,7 @@
}
}else{
fprintf(stderr, "Your kernel doesn't support diskstat (2.5.70 or above required)\n");
- exit(0);
+ exit(EXIT_FAILURE);
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/procps-3.2.7/watch.c new/procps-3.2.8/watch.c
--- old/procps-3.2.7/watch.c 2006-06-17 11:18:38.000000000 +0200
+++ new/procps-3.2.8/watch.c 2007-05-28 05:13:23.000000000 +0200
@@ -296,10 +296,10 @@
}
move(y, x);
if (option_differences) {
- int oldch = inch();
+ chtype oldch = inch();
char oldc = oldch & A_CHARTEXT;
attr = !first_screen
- && (c != oldc
+ && ((char)c != oldc
||
(option_differences_cumulative
&& (oldch & A_ATTRIBUTES)));
++++++ procps-3.2.7-toosmall.dif -> procps-3.2.8-toosmall.dif ++++++
--- procps/procps-3.2.7-toosmall.dif 2008-12-10 16:30:05.000000000 +0100
+++ procps/procps-3.2.8-toosmall.dif 2009-05-11 12:44:06.000000000 +0200
@@ -1,15 +1,6 @@
--- top.c
+++ top.c 2008-12-10 16:28:41.000000000 +0100
-@@ -2514,7 +2514,7 @@ static void do_key (unsigned c)
-
- switch (c) {
- case '1':
-- if (Cpu_tot+7 > Screen_rows && !CHKw(Curwin, View_CPUSUM)) {
-+ if (Cpu_tot+7 > Screen_rows && CHKw(Curwin, View_CPUSUM)) {
- show_msg(err_num_cpus);
- } else {
- #ifdef WARN_NOT_SMP
-@@ -2984,7 +2984,7 @@ static proc_t **summary_show (void)
+@@ -2993,7 +2993,7 @@ static proc_t **summary_show (void)
p_table = procs_refresh(p_table, Frames_libflags);
// Display Uptime and Loadavg
@@ -18,7 +9,7 @@
if (!Rc.mode_altscr) {
show_special(0, fmtmk(LOADAV_line, Myname, sprint_uptime()));
} else {
-@@ -3001,7 +3001,7 @@ static proc_t **summary_show (void)
+@@ -3010,7 +3010,7 @@ static proc_t **summary_show (void)
}
// Display Task and Cpu(s) States
@@ -27,7 +18,7 @@
show_special(
0,
fmtmk(
-@@ -3015,21 +3015,29 @@ static proc_t **summary_show (void)
+@@ -3024,21 +3024,29 @@ static proc_t **summary_show (void)
if (CHKw(Curwin, View_CPUSUM)) {
// display just the 1st /proc/stat line
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org