summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gottinger <achim@gentoo.org>2001-02-19 17:44:49 +0000
committerAchim Gottinger <achim@gentoo.org>2001-02-19 17:44:49 +0000
commit1b12464197d252feb596814d3f8bc542020310e6 (patch)
treed70142d878249e3d967cd19e4486143933f3dfbe /sys-apps/procps/files
parentfix (diff)
downloadhistorical-1b12464197d252feb596814d3f8bc542020310e6.tar.gz
historical-1b12464197d252feb596814d3f8bc542020310e6.tar.bz2
historical-1b12464197d252feb596814d3f8bc542020310e6.zip
*** empty log message ***
Diffstat (limited to 'sys-apps/procps/files')
-rw-r--r--sys-apps/procps/files/digest-procps-2.0.61
-rw-r--r--sys-apps/procps/files/digest-procps-2.0.7-r31
-rw-r--r--sys-apps/procps/files/procps-2.0.6.diff3401
-rw-r--r--sys-apps/procps/files/procps-2.0.7.diff321
4 files changed, 3724 insertions, 0 deletions
diff --git a/sys-apps/procps/files/digest-procps-2.0.6 b/sys-apps/procps/files/digest-procps-2.0.6
new file mode 100644
index 000000000000..765fe621dd40
--- /dev/null
+++ b/sys-apps/procps/files/digest-procps-2.0.6
@@ -0,0 +1 @@
+MD5 2e6e156f0791b0e209d05aaf7204a219 procps-2.0.6.tar.gz
diff --git a/sys-apps/procps/files/digest-procps-2.0.7-r3 b/sys-apps/procps/files/digest-procps-2.0.7-r3
new file mode 100644
index 000000000000..47a95728f6a2
--- /dev/null
+++ b/sys-apps/procps/files/digest-procps-2.0.7-r3
@@ -0,0 +1 @@
+MD5 bd8d68a9fd0c3f37365f924e75009c8a procps-2.0.7.tar.gz
diff --git a/sys-apps/procps/files/procps-2.0.6.diff b/sys-apps/procps/files/procps-2.0.6.diff
new file mode 100644
index 000000000000..24a24004414d
--- /dev/null
+++ b/sys-apps/procps/files/procps-2.0.6.diff
@@ -0,0 +1,3401 @@
+--- procps-2.0.6.orig/proc/Makefile
++++ procps-2.0.6/proc/Makefile
+@@ -66,8 +66,8 @@
+ $(INSTALL) $(LIBOWN) lib$(NAME).a $(LIBDIR)
+ ifeq ($(SHARED),1)
+ $(INSTALL) $(LIBOWN) $(SONAME) $(SHLIBDIR)
+- cd $(SHLIBDIR) && ln -sf $(SONAME) lib$(NAME).so
+- ldconfig
++ #cd $(SHLIBDIR) && ln -sf $(SONAME) lib$(NAME).so
++ #ldconfig
+ endif
+
+ # VARIOUS SHORT CUT TARGETS
+--- procps-2.0.6.orig/proc/devname.c
++++ procps-2.0.6/proc/devname.c
+@@ -100,7 +100,7 @@
+ sprintf(buf, "/dev/tty%d", min);
+ break;
+ }
+- if(min<128){
++ if(min<128){ /* to 255 on newer systems */
+ sprintf(buf, "/dev/ttyS%d", min-64);
+ break;
+ }
+@@ -112,7 +112,8 @@
+ break;
+ case 17: sprintf(buf, "/dev/ttyH%d", min); break;
+ case 19: sprintf(buf, "/dev/ttyC%d", min); break;
+- case 23: sprintf(buf, "/dev/ttyD%d", min); break;
++ case 22: sprintf(buf, "/dev/ttyD%d", min); break; /* devices.txt */
++ case 23: sprintf(buf, "/dev/ttyD%d", min); break; /* driver code */
+ case 24: sprintf(buf, "/dev/ttyE%d", min); break;
+ case 32: sprintf(buf, "/dev/ttyX%d", min); break;
+ case 43: sprintf(buf, "/dev/ttyI%d", min); break;
+@@ -121,10 +122,19 @@
+ case 57: sprintf(buf, "/dev/ttyP%d", min); break;
+ case 71: sprintf(buf, "/dev/ttyF%d", min); break;
+ case 75: sprintf(buf, "/dev/ttyW%d", min); break;
+- case 78: sprintf(buf, "/dev/ttyM%d", min); break;
++ case 78: sprintf(buf, "/dev/ttyM%d", min); break; /* conflict */
+ case 105: sprintf(buf, "/dev/ttyV%d", min); break;
++ case 112: sprintf(buf, "/dev/ttyM%d", min); break; /* conflict */
+ /* 136 ... 143 are /dev/pts/0, /dev/pts/1, /dev/pts/2 ... */
+ case 136 ... 143: sprintf(buf, "/dev/pts/%d", min+(maj-136)*256); break;
++ case 148: sprintf(buf, "/dev/ttyT%d", min); break;
++ case 154: sprintf(buf, "/dev/ttySR%d", min); break;
++ case 156: sprintf(buf, "/dev/ttySR%d", min+256); break;
++ case 164: sprintf(buf, "/dev/ttyCH%d", min); break;
++ case 166: sprintf(buf, "/dev/ttyACM%d", min); break; /* bummer, 9-char */
++ case 172: sprintf(buf, "/dev/ttyMX%d", min); break;
++ case 174: sprintf(buf, "/dev/ttySI%d", min); break;
++ case 188: sprintf(buf, "/dev/ttyUSB%d", min); break; /* bummer, 9-char */
+ default: return 0;
+ }
+ if(stat(buf, &sbuf) < 0) return 0;
+@@ -137,12 +147,12 @@
+ * Useful names could be in /proc/PID/fd/2 (stderr, seldom redirected)
+ * and in /proc/PID/fd/255 (used by bash to remember the tty).
+ */
+-static int fd_name(char * const buf, int maj, int min, int pid, int fd){
++static int link_name(char * const buf, int maj, int min, int pid, char *name){
+ struct stat sbuf;
+ char path[32];
+ int count;
+- sprintf(path, "/proc/%d/fd/%d", pid, fd); /* often permission denied */
+- count = readlink(path,buf,PAGE_SIZE);
++ sprintf(path, "/proc/%d/%s", pid, name); /* often permission denied */
++ count = readlink(path,buf,PAGE_SIZE-1);
+ if(count == -1) return 0;
+ buf[count] = '\0';
+ if(stat(buf, &sbuf) < 0) return 0;
+@@ -158,10 +168,11 @@
+ int i = 0;
+ int c;
+ if((short)dev == (short)-1) goto fail;
+- if( fd_name(tmp, major(dev), minor(dev), pid, 2 )) goto abbrev;
+- if( fd_name(tmp, major(dev), minor(dev), pid, 255)) goto abbrev;
+- if( guess_name(tmp, major(dev), minor(dev) )) goto abbrev;
+- if(driver_name(tmp, major(dev), minor(dev) )) goto abbrev;
++ if( link_name(tmp, major(dev), minor(dev), pid, "tty" )) goto abbrev;
++ if( link_name(tmp, major(dev), minor(dev), pid, "fd/2" )) goto abbrev;
++ if( guess_name(tmp, major(dev), minor(dev) )) goto abbrev;
++ if( link_name(tmp, major(dev), minor(dev), pid, "fd/255")) goto abbrev;
++ if(driver_name(tmp, major(dev), minor(dev) )) goto abbrev;
+ fail:
+ strcpy(ret, "?");
+ return 1;
+--- procps-2.0.6.orig/proc/ksym.c
++++ procps-2.0.6/proc/ksym.c
+@@ -25,6 +25,14 @@
+
+ #if 0
+ #undef KSYMS_FILENAME
++#define KSYMS_FILENAME "/would/be/nice/to/have/this/file"
++#define SYSMAP_FILENAME "/home/albert/ps/45621/System.map-hacked"
++#define linux_version_code 131598 /* ? */
++#define smp_num_cpus 2
++#endif
++
++#if 0
++#undef KSYMS_FILENAME
+ #define KSYMS_FILENAME "/home/albert/ps/45621/ksyms-2.3.12"
+ #define SYSMAP_FILENAME "/home/albert/ps/45621/System.map-2.3.12"
+ #define linux_version_code 131852 /* 2.3.12 */
+@@ -47,24 +55,17 @@
+ #define smp_num_cpus 2
+ #endif
+
+-/*
+- * '?' is a symbol type
+- * '.' is part of a name (versioning?)
+- * "\t[]" are for the module name in /proc/ksyms
+- */
+-#define LEGAL_SYSMAP_CHARS "0123456789_ ?.\n\t[]" \
+- "abcdefghijklmnopqrstuvwxyz" \
+- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+-
+ /* These are the symbol types, with relative popularity:
+- * 4 W (not for i386)
++ * ? w machine type junk for Alpha -- odd syntax
++ * ? S not for i386
++ * 4 W not for i386
+ * 60 R
+ * 100 A
+ * 125 r
+- * 363 s (not for i386)
++ * 363 s not for i386
+ * 858 B
+- * 905 g (not for i386)
+- * 929 G (not for i386)
++ * 905 g generated by modutils?
++ * 929 G generated by modutils?
+ * 1301 b
+ * 2750 D
+ * 4481 d
+@@ -75,7 +76,30 @@
+ * For i386, that is: "RArBbDd?tT"
+ */
+
+-#define SYMBOL_TYPE_CHARS "Tt?dDbBrARGgsW"
++#define SYMBOL_TYPE_CHARS "Tt?dDbBrARGgsWS"
++
++/*
++ * '?' is a symbol type
++ * '.' is part of a name (versioning?)
++ * "\t[]" are for the module name in /proc/ksyms
++ */
++#define LEGAL_SYSMAP_CHARS "0123456789_ ?.\n\t[]" \
++ "abcdefghijklmnopqrstuvwxyz" \
++ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
++
++/* System.map lines look like:
++ * hex num, space, one of SYMBOL_TYPE_CHARS, space, LEGAL_SYSMAP_CHARS, \n
++ *
++ * Alpha systems can start with a few lines that have the address replaced
++ * by space padding and a 'w' for the type. For those lines, the last space
++ * is followed by something like: mikasa_primo_mv p2k_mv sable_gamma_mv
++ * (just one of those, always with a "_mv", then the newline)
++ *
++ * The /proc/ksyms lines are like System.map lines w/o the symbol type char.
++ * When odd features are used, the name part contains:
++ * "(.*)_R(smp_|smp2gig_|2gig_)?[0-9a-fA-F]{8,}"
++ * It is likely that more crap will be added...
++ */
+
+ typedef struct symb {
+ const char *name;
+@@ -100,6 +124,63 @@
+ static unsigned ksyms_count;
+ static int idx_room;
+
++/*********************************/
++
++/* Kill this: _R(smp_?|smp2gig_?|2gig_?)?[0-9a-f]{8,}$
++ * We kill: (_R[^A-Z]*[0-9a-f]{8,})+$
++ *
++ * The loop should almost never be taken, but it has to be there.
++ * It gets rid of anything that _looks_ like a version code, even
++ * if a real version code has already been found. This is because
++ * the inability to perfectly recognize a version code may lead to
++ * symbol mangling, which in turn leads to mismatches between the
++ * /proc/ksyms and System.map data files.
++ */
++#if 0
++static void chop_version(char *arg){
++ char *cp;
++ cp = strchr(arg,'\t');
++ if(cp) *cp = '\0'; /* kill trailing module name first */
++ for(;;){
++ char *p;
++ int len = 0;
++ cp = strrchr(arg, 'R');
++ if(!cp || cp<=arg+1 || cp[-1]!='_') break;
++ for(p=cp; *++p; ){
++ switch(*p){
++ default:
++ return;
++ case '0' ... '9':
++ case 'a' ... 'f':
++ len++;
++ continue;
++ case 'g' ... 'z':
++ case '_':
++ len=0;
++ continue;
++ }
++ }
++ if(len<8) break;
++ cp[-1] = '\0';
++ }
++}
++#endif
++static void chop_version(char *arg){
++ char *cp;
++ cp = strchr(arg,'\t');
++ if(cp) *cp = '\0'; /* kill trailing module name first */
++ for(;;){
++ int len;
++ cp = strrchr(arg, 'R');
++ if(!cp || cp<=arg+1 || cp[-1]!='_') break;
++ len=strlen(cp);
++ if(len<9) break;
++ if(strpbrk(cp+1,"ABCDEFGHIJKLMNOPQRSTUVWXYZ")) break;
++ if(strspn(cp+len-8,"0123456789abcdef")!=8) break;
++ cp[-1] = '\0';
++ }
++}
++
+ /***********************************/
+
+ static const symb *search(unsigned long address, symb *idx, unsigned count){
+@@ -174,12 +255,14 @@
+ }
+ *bufp = buf;
+ *roomp = room;
++ close(fd);
+ return;
+ hell:
+ if(buf) free(buf);
+ *bufp = NULL;
+ *roomp = 0; /* this function will never work again */
+ total = 0;
++ close(fd);
+ return;
+ }
+
+@@ -189,6 +272,7 @@
+ char *endp;
+ if(!ksyms_room || !ksyms_data) goto quiet_goodbye;
+ endp = ksyms_data;
++ ksyms_count = 0;
+ if(idx_room) goto bypass; /* some space already allocated */
+ idx_room = 512;
+ for(;;){
+@@ -201,36 +285,16 @@
+ for(;;){
+ char *saved;
+ if(!*endp) return 1;
++ saved = endp;
+ ksyms_index[ksyms_count].addr = strtoul(endp, &endp, 16);
+- if(*endp != ' ') goto bad_parse;
++ if(endp==saved || *endp != ' ') goto bad_parse;
+ endp++;
+ ksyms_index[ksyms_count].name = endp;
+ saved = endp;
+ endp = strchr(endp,'\n');
+ if(!endp) goto bad_parse; /* no newline */
+ *endp = '\0';
+- if(1){ /* The Killing Scope */
+- char *cp;
+- cp = strchr(endp,'\t');
+- if(cp) *cp = '\0'; /* kill trailing module name */
+- if(smp_num_cpus==1){
+- saved = strrchr(saved, '_');
+- if(saved && saved[1]=='R' && saved[2] && !(strlen(saved+2)&7)){
+- /* could be crummy version info */
+- char *endp2;
+- strtoul(saved+2, &endp2, 16);
+- if(!*endp2) *saved = '\0'; /* Die version, DIE!!! */
+- }
+- }else{
+- saved = strstr(saved, "_Rsmp_");
+- if(saved && !(strlen(saved+6)&7)){
+- /* could be crummy version info */
+- char *endp2;
+- strtoul(saved+6, &endp2, 16);
+- if(!*endp2) *saved = '\0'; /* Die version, DIE!!! */
+- }
+- }
+- } /* end killing scope */
++ chop_version(saved);
+ ++endp;
+ if(++ksyms_count >= idx_room) break; /* need more space */
+ }
+@@ -270,6 +334,14 @@
+ /* Would be shared read-only, but we want '\0' after each name. */
+ endp = mmap(0, sbuf.st_size + 1, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
+ sysmap_data = endp;
++ while(*endp==' '){ /* damn Alpha machine types */
++ if(strncmp(endp," w ", 19)) goto bad_parse;
++ endp += 19;
++ endp = strchr(endp,'\n');
++ if(!endp) goto bad_parse; /* no newline */
++ if(strncmp(endp-3, "_mv\n", 4)) goto bad_parse;
++ endp++;
++ }
+ if(sysmap_data == (caddr_t) -1) goto bad_open;
+ close(fd);
+ fd = -1;
+@@ -330,6 +402,7 @@
+ if(!endp) goto bad_parse; /* no newline */
+ *endp = '\0';
+ ++endp;
++ chop_version(vstart);
+ if(*vstart=='V' && *Version && !strcmp(Version,vstart)) *Version='\0';
+ if(++sysmap_count >= sysmap_room) break; /* need more space */
+ }
+@@ -456,11 +529,3 @@
+
+ return ret;
+ }
+-
+-
+-
+-
+-
+-
+-
+-
+--- procps-2.0.6.orig/proc/readproc.c
++++ procps-2.0.6/proc/readproc.c
+@@ -14,6 +14,7 @@
+ #include <stdarg.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <signal.h>
+ #include <fcntl.h>
+ #include <sys/dir.h>
+ #include <sys/types.h>
+@@ -154,6 +155,9 @@
+ int num;
+ char* tmp = strrchr(S, ')'); /* split into "PID (cmd" and "<rest>" */
+ *tmp = '\0'; /* replace trailing ')' with NUL */
++ /* fill in default values for older kernels */
++ P->exit_signal = SIGCHLD;
++ P->processor = 0;
+ /* parse these two strings separately, skipping the leading "(". */
+ memset(P->cmd, 0, sizeof P->cmd); /* clear even though *P xcalloc'd ?! */
+ sscanf(S, "%d (%15c", &P->pid, P->cmd); /* comm[16] in kernel */
+@@ -166,7 +170,8 @@
+ "%ld "
+ "%lu %lu %lu %lu %lu %lu "
+ "%*s %*s %*s %*s " /* discard, no RT signals & Linux 2.1 used hex */
+- "%lu %lu %lu",
++ "%lu %lu %lu "
++ "%d %d",
+ &P->state,
+ &P->ppid, &P->pgrp, &P->session, &P->tty, &P->tpgid,
+ &P->flags, &P->min_flt, &P->cmin_flt, &P->maj_flt, &P->cmaj_flt, &P->utime, &P->stime,
+@@ -175,18 +180,15 @@
+ &P->rss,
+ &P->rss_rlim, &P->start_code, &P->end_code, &P->start_stack, &P->kstk_esp, &P->kstk_eip,
+ /* P->signal, P->blocked, P->sigignore, P->sigcatch, */ /* can't use */
+- &P->wchan, &P->nswap, &P->cnswap /* , &P->exit_signal */);
+-/* TODO: add &P->exit_signal support here, perhaps to identify Linux threads */
++ &P->wchan, &P->nswap, &P->cnswap,
++/* -- Linux 2.0.35 ends here -- */
++ &P->exit_signal, &P->processor /* 2.2.1 ends with "exit_signal" */
++/* -- Linux 2.2.8 and 2.3.47 end here -- */
++ );
+
+-/* fprintf(stderr, "stat2proc converted %d fields.\n",num); */
++ /* fprintf(stderr, "stat2proc converted %d fields.\n",num); */
+ if (P->tty == 0)
+ P->tty = -1; /* the old notty val, update elsewhere bef. moving to 0 */
+- if (linux_version_code < LINUX_VERSION(1,3,39)) {
+- P->priority = 2*15 - P->priority; /* map old meanings to new */
+- P->nice = 15 - P->nice;
+- }
+- if (linux_version_code < LINUX_VERSION(1,1,30) && P->tty != -1)
+- P->tty = 4*0x100 + P->tty; /* when tty wasn't full devno */
+ }
+
+ static void statm2proc(char* s, proc_t* P) {
+@@ -504,55 +506,6 @@
+ return NULL;
+ }
+
+-#if 0
+-static proc_t* readproctree(int flags, ...) {
+- static proc_t tree;
+- PROCTAB* PT = NULL;
+- proc_t *node, *tmp=NULL, *tmp2=NULL;
+- va_list ap;
+-
+- /* pass through apropriate arguments to openproc */
+- va_start(ap, flags);
+- if (Do(UID)) {
+- /* temporary variables to ensure that va_arg() instances
+- * are called in the right order
+- */
+- uid_t* u;
+- int i;
+-
+- u = va_arg(ap, uid_t*);
+- i = va_arg(ap, int);
+- PT = openproc(flags, u, i);
+- }
+- else if (Do(PID) || Do(TTY) || Do(STAT))
+- PT = openproc(flags, va_arg(ap, void*));
+- else
+- PT = openproc(flags);
+- va_end(ap);
+-
+- /* first pass: build tree, putting orphans on the first level */
+- tree.l = tree.r = NULL;
+- while ((node = readproc(PT,0)))
+- if ((tmp = LookupPID(&tree, node->ppid))) {
+- node->r = tmp->l->r; /* node --> left list of parent */
+- tmp->l->r = node;
+- } else {
+- node->r = tree.r; /* node --> right list of 'tree' */
+- tree.r = node;
+- }
+- /* second pass: scan tree for PPIDs of level-1 nodes moving links as necessary */
+- for (node = &tree; node; node = node->r)
+- if ((tmp = LookupPID(&tree, node->r->ppid))) {
+- tmp2 = node->r; /* unlink from right list of 'tree' */
+- node->r = node->r->r;
+- tmp2->r = tmp->l->r; /* insert as child of found node */
+- tmp->l->r = node;
+- }
+- closeproc(PT);
+- return &tree;
+-}
+-#endif
+-
+ /* Convenient wrapper around openproc and readproc to slurp in the whole process
+ * table subset satisfying the constraints of flags and the optional PID list.
+ * Free allocated memory with freeproctab(). Access via tab[N]->member. The
+@@ -588,14 +541,3 @@
+ closeproc(PT);
+ return tab;
+ }
+-
+-#if 0
+-/* deallocate a table of pointers to proc structures
+- */
+-static void freeproctab(proc_t** tab) {
+- proc_t** p;
+- for(p = tab; *p; p++)
+- freeproc(*p);
+- free(tab);
+-}
+-#endif
+--- procps-2.0.6.orig/proc/readproc.h
++++ procps-2.0.6/proc/readproc.h
+@@ -50,7 +50,7 @@
+ priority, /* kernel scheduling priority */
+ timeout, /* ? */
+ nice, /* standard unix nice level of process */
+- rss, /* resident set size from /proc/#/stat */
++ rss, /* resident set size from /proc/#/stat (pages) */
+ it_real_value, /* ? */
+ /* the next 7 members come from /proc/#/statm */
+ size, /* total # of pages of memory */
+@@ -70,7 +70,7 @@
+ vm_exe, /* executable size */
+ vm_lib, /* library size (all pages, not just used ones) */
+ vsize, /* number of pages of virtual memory ... */
+- rss_rlim, /* resident set size ... ? */
++ rss_rlim, /* resident set size limit? */
+ flags, /* kernel flags for the process */
+ min_flt, /* number of minor page faults since process start */
+ maj_flt, /* number of major page faults since process start */
+@@ -113,7 +113,9 @@
+ pgrp, /* process group id */
+ session, /* session id */
+ tty, /* full device number of controlling terminal */
+- tpgid; /* terminal process group id */
++ tpgid, /* terminal process group id */
++ exit_signal, /* might not be SIGCHLD */
++ processor; /* current (or most recent?) CPU */
+ unsigned
+ pcpu; /* %CPU usage (is not filled in by readproc!!!) */
+ char
+--- procps-2.0.6.orig/proc/sysinfo.c
++++ procps-2.0.6/proc/sysinfo.c
+@@ -49,20 +49,20 @@
+ static int local_n; \
+ if (fd == -1 && (fd = open(filename, O_RDONLY)) == -1) { \
+ fprintf(stderr, BAD_OPEN_MESSAGE); \
+- close(fd); \
+- exit(102); \
++ fflush(NULL); \
++ _exit(102); \
+ } \
+ lseek(fd, 0L, SEEK_SET); \
+ if ((local_n = read(fd, buf, sizeof buf - 1)) < 0) { \
+ perror(filename); \
+- close(fd); \
+- fd = -1; \
+- exit(103); \
++ fflush(NULL); \
++ _exit(103); \
+ } \
+ buf[local_n] = '\0'; \
+ }while(0)
+
+-#define SET_IF_DESIRED(x,y) if(x) *(x) = (y) /* evals 'x' twice */
++/* evals 'x' twice */
++#define SET_IF_DESIRED(x,y) do{ if(x) *(x) = (y); }while(0)
+
+
+ /***********************************************************************/
+@@ -110,7 +110,7 @@
+ double up_1, up_2, seconds;
+ unsigned long jiffies, h;
+ smp_num_cpus = sysconf(_SC_NPROCESSORS_CONF);
+- if(smp_num_cpus==-1) smp_num_cpus=1;
++ if(smp_num_cpus<1) smp_num_cpus=1;
+ do{
+ FILE_TO_BUF(UPTIME_FILE,uptime_fd); sscanf(buf, "%lf", &up_1);
+ /* uptime(&up_1, NULL); */
+@@ -145,22 +145,46 @@
+ }
+ }
+
+-/***********************************************************************/
++/***********************************************************************
++ * The /proc filesystem calculates idle=jiffies-(user+nice+sys) and we
++ * recover jiffies by adding up the 4 numbers we are given. SMP kernels
++ * (as of pre-2.4 era) can report idle time going backwards, perhaps due
++ * to non-atomic reads and updates. There is no locking for these values.
++ */
++#ifndef NAN
++#define NAN (-0.0)
++#endif
+ #define JT unsigned long
+-void four_cpu_numbers(JT *uret, JT *nret, JT *sret, JT *iret) {
+- static JT u, n, s, i;
+- JT user_j, nice_j, sys_j, idle_j;
+-
++void four_cpu_numbers(double *uret, double *nret, double *sret, double *iret){
++ double tmp_u, tmp_n, tmp_s, tmp_i;
++ double scale; /* scale values to % */
++ static JT old_u, old_n, old_s, old_i;
++ JT new_u, new_n, new_s, new_i;
++ JT ticks_past; /* avoid div-by-0 by not calling too often :-( */
++
+ FILE_TO_BUF(STAT_FILE,stat_fd);
+- sscanf(buf, "cpu %lu %lu %lu %lu", &user_j, &nice_j, &sys_j, &idle_j);
+- SET_IF_DESIRED(uret, user_j-u);
+- SET_IF_DESIRED(nret, nice_j-n);
+- SET_IF_DESIRED(sret, sys_j-s);
+- SET_IF_DESIRED(iret, idle_j-i);
+- u=user_j;
+- n=nice_j;
+- s=sys_j;
+- i=idle_j;
++ sscanf(buf, "cpu %lu %lu %lu %lu", &new_u, &new_n, &new_s, &new_i);
++ ticks_past = (new_u+new_n+new_s+new_i)-(old_u+old_n+old_s+old_i);
++ if(ticks_past){
++ scale = 100.0 / (double)ticks_past;
++ tmp_u = ( (double)new_u - (double)old_u ) * scale;
++ tmp_n = ( (double)new_n - (double)old_n ) * scale;
++ tmp_s = ( (double)new_s - (double)old_s ) * scale;
++ tmp_i = ( (double)new_i - (double)old_i ) * scale;
++ }else{
++ tmp_u = NAN;
++ tmp_n = NAN;
++ tmp_s = NAN;
++ tmp_i = NAN;
++ }
++ SET_IF_DESIRED(uret, tmp_u);
++ SET_IF_DESIRED(nret, tmp_n);
++ SET_IF_DESIRED(sret, tmp_s);
++ SET_IF_DESIRED(iret, tmp_i);
++ old_u=new_u;
++ old_n=new_n;
++ old_s=new_s;
++ old_i=new_i;
+ }
+ #undef JT
+
+@@ -199,15 +223,19 @@
+ return strcmp(((mem_table_struct*)a)->name,((mem_table_struct*)b)->name);
+ }
+
+-/* example data, following junk:
++/* example data, following junk, with comments:
+ *
+ * Buffers: 2636 kB
+ * Cached: 27276 kB
+ * MemFree: 1852 kB
+- * MemShared: 20664 kB
++ * MemShared: 20664 kB Recent kernels do not calculate this.
+ * MemTotal: 63088 kB
+ * SwapFree: 99180 kB
+ * SwapTotal: 122588 kB
++ * HighTotal: 0 kB New!
++ * HighFree: 0 kB New!
++ * LowTotal: 255596 kB New!
++ * LowFree: 62260 kB New!
+ */
+
+ unsigned kb_main_buffers;
+--- procps-2.0.6.orig/proc/sig.c
++++ procps-2.0.6/proc/sig.c
+@@ -27,20 +27,15 @@
+ * Nearly garbage: SIGSTKFLT SIGUNUSED (nothing else to fill slots)
+ */
+
+-#ifdef SIGSYS
+-# ifndef SIGEMT
+-# error You have SIGSYS without SIGEMT? What did it replace?
+-# endif
+-# undef SIGUNUSED
+-# undef SIGSTKFLT
+-#else
+-# ifndef SIGUNUSED
+-# error You seem to be missing some signals.
+-# endif
+-# ifndef SIGSTKFLT
+-# error You seem to be missing some signals.
+-# endif
++/* Linux 2.3.29 replaces SIGUNUSED with the standard SIGSYS signal */
++#ifndef SIGSYS
+ # warning Standards require that <signal.h> define SIGSYS
++# define SIGSYS SIGUNUSED
++#endif
++
++/* If we see both, it is likely SIGSTKFLT (junk) was replaced. */
++#ifdef SIGEMT
++# undef SIGSTKFLT
+ #endif
+
+ #ifndef SIGRTMIN
+@@ -84,17 +79,12 @@
+ {"STKFLT", SIGSTKFLT},
+ #endif
+ {"STOP", SIGSTOP},
+-#ifdef SIGSYS
+- {"SYS", SIGSYS},
+-#endif
++ {"SYS", SIGSYS}, /* UNUSED */
+ {"TERM", SIGTERM},
+ {"TRAP", SIGTRAP},
+ {"TSTP", SIGTSTP},
+ {"TTIN", SIGTTIN},
+ {"TTOU", SIGTTOU},
+-#ifdef SIGUNUSED
+- {"UNUSED", SIGUNUSED},
+-#endif
+ {"URG", SIGURG},
+ {"USR1", SIGUSR1},
+ {"USR2", SIGUSR2},
+--- procps-2.0.6.orig/proc/sysinfo.h
++++ procps-2.0.6/proc/sysinfo.h
+@@ -4,7 +4,7 @@
+ extern unsigned long Hertz; /* clock tick frequency */
+ extern long smp_num_cpus; /* number of CPUs */
+
+-#define JT unsigned long
++#define JT double
+ extern void four_cpu_numbers(JT *uret, JT *nret, JT *sret, JT *iret);
+ #undef JT
+
+--- procps-2.0.6.orig/BUGS
++++ procps-2.0.6/BUGS
+@@ -9,7 +9,7 @@
+
+ Where to send
+ =============
+-Send comments, bug reports, patches, etc., to procps-bugs@redhat.com
++Send comments, bug reports, patches, etc., to acahalan@cs.uml.edu
+
+
+ What to send
+--- procps-2.0.6.orig/NEWS
++++ procps-2.0.6/NEWS
+@@ -1,5 +1,7 @@
+ NEWS: what has changed recently with procps, in reverse cronological order.
+-Please send bug reports to procps-bugs@redhat.com
++Please send bug reports to acahalan@cs.uml.edu
++
++*** THIS FILE DOES NOT INCLUDE RECENT CHANGES ***
+
+
+ NEWS for version 2.0.6 of procps
+--- procps-2.0.6.orig/Makefile
++++ procps-2.0.6/Makefile
+@@ -4,8 +4,8 @@
+ PREFIX = #proc# prefix for program names
+
+ DESTDIR = /
+-MAN1DIR = ${DESTDIR}/usr/man/man1
+-MAN8DIR = ${DESTDIR}/usr/man/man8
++MAN1DIR = ${DESTDIR}/usr/share/man/man1
++MAN8DIR = ${DESTDIR}/usr/share/man/man8
+ BINDIR = ${DESTDIR}/bin
+ SBINDIR = ${DESTDIR}/sbin
+ XBINDIR = ${DESTDIR}/usr/X11R6/bin
+--- procps-2.0.6.orig/TODO
++++ procps-2.0.6/TODO
+@@ -9,12 +9,27 @@
+ killall pstree fuser lsof who
+ (they are maintained elsewhere, which causes version problems)
+
+-See if the syslogd & klogd maintainer will take XConsole.
+-
+ Cache results of dev_to_tty.
+
+ ---------------------- kernel -------------------------
+
++Add an "adopted child" flag to mark processes that are not
++natural children of init. This can make --forest work better.
++
++Add a thread group ID, to be shared by all tasks that are related by
++the clone() system call. This ID might be made unique from boot to
++shutdown, perhaps being a 16-bit CPU number and 48-bit per-CPU
++serial number.
++
++Make the kernel group /proc listing output by thread group.
++Without this, a thread-aware ps must always sort processes.
++
++Supply the task ID (the "PID"/"TID") of the thread group leader.
++I define "leader" as the first process of a thread group.
++
++Don't reuse the task ID of a thread group leader until all threads
++are dead. Better yet, don't let the leader exit.
++
+ Supply better data for top's CPU state display. Currently top has
+ to subtract old numbers from new numbers and divide that result by
+ the number of processors. The kernel won't even supply the number
+@@ -41,6 +56,8 @@
+ of 64-bit values on all machines. New entries go on the end and obsolete
+ ones get filled in with something logical -- entries must never be deleted!
+
++Add all the stuff Solaris has. This would also replace ptrace.
++
+ The kernel should provide a "current CPU number" indication for SMP. Maybe
+ use "last CPU number" if not currently running, since processor affinity
+ will tend to put the process back on the same CPU it had before.
+@@ -58,20 +75,12 @@
+ 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!)
+
+----------------------- watch --------------------------
+-
+-Should catch SIGWINCH and adjust as needed.
+-Tell 29970@bugs.debian.org when done.
+-
+ ---------------------- vmstat --------------------------
+
+ Extract /proc/stat parsing from vmstat into libproc somewhere.
+
+ --------------------- libproc ----------------------
+
+-Remove pre-2.0 /proc/meminfo support from proc/sysinfo.c to simplify the code.
+-Parse the 2.0 format in a better manner, perhaps like ps does long options.
+-
+ Stop storing fields with duplicate info (often different
+ units: kB and pages, seconds and jiffies) in the proc_t struct.
+
+@@ -79,9 +88,6 @@
+
+ Share more stuff with ps.
+
+--------------------- skill ------------------------
+-
+-
+ ---------------- ps for now, maybe move to libproc ------------------
+
+ With forest output and a tty named /dev/this_is_my_tty, the position
+@@ -126,8 +132,6 @@
+ are reported as being 5 days old, while boot processes look normal)
+ (reported for procps-2.0.2 in May 1999)
+
+-Make "ps --sort:pcpu" work. (p->pcpu is not filled in)
+-
+ Show real-time priorities. (type & number)
+
+ Add an option to select all processes that a user can kill.
+@@ -150,7 +154,7 @@
+ code as much as the kernel can support. Make sure that memory amounts are in
+ pages when they should be and in kB when they should be, not backwards.
+
+-output encoding: UTF8 --nul --null --html
++output encoding: UTF8 --nul --null
+
+ Make BSD formats use non-standard BSD time format, at least when it
+ doesn't violate the "no whitespace" rule.
+--- procps-2.0.6.orig/free.1
++++ procps-2.0.6/free.1
+@@ -41,5 +41,5 @@
+ .SH AUTHORS
+ Written by Brian Edmonds.
+
+-Send bug reports to <procps-bugs@redhat.com>
++Send bug reports to <acahalan@cs.uml.edu>
+
+--- procps-2.0.6.orig/free.c
++++ procps-2.0.6/free.c
+@@ -17,13 +17,9 @@
+ static int total = 0;
+
+ int main(int argc, char *argv[]){
+- char buf1[80], buf2[80];
+- char *titles[6], name[32];
+- int i, n = 0, col[6] = {0}, rtime = 0, old_fmt = 0, first_line;
+- int old_meminfo = 0;
+- unsigned **mem;
+-
+- static int sum[6]; /* statics get initialized to zero */
++ int i;
++ int old_fmt = 0;
++ int rtime = 0;
+
+ /* check startup flags */
+ while( (i = getopt(argc, argv, "bkmos:tV") ) != -1 )
+--- procps-2.0.6.orig/procps.lsm
++++ procps-2.0.6/procps.lsm
+@@ -1,16 +1,16 @@
+ Begin3
+ Title: procps
+-Version: 2.0.6
+-Entered-date: 02NOV99
++Version: 000110
++Entered-date: 10JAN00
+ Description: Procps is a library which parses the textual /proc filesystem
+ and a suite of utilites which use the library.
+ Keywords: procps /proc libproc
+ ps uptime tload free w top vmstat watch skill snice kill
+ Author: Michael K. Johnson, Charles Blake, Albert Cahalan, many others.
+-Maintained-by: Michael K. Johnson <procps-bugs@redhat.com>
+-Primary-site: tsx-11.mit.edu /pub/linux/sources/usr.bin/
+- 185kB procps-2.0.6.tar.gz
+-Alternate-site: sunsite.unc.edu /pub/Linux/system/Status/ps
+- 185kB procps-2.0.6.tar.gz
++Maintained-by: various <acahalan@cs.uml.edu>
++Primary-site: http://www.cs.uml.edu/~acahalan/linux/
++ 185kB procps-000110.tar.gz
++Alternate-site: http://www.debian.org/Packages/unstable/base/procps.html
++ 185kB procps-000110.tar.gz
+ Copying-policy: mixed
+ End
+--- procps-2.0.6.orig/ps/display.c
++++ procps-2.0.6/ps/display.c
+@@ -41,7 +41,7 @@
+ fprintf(stderr,
+ "\n\n"
+ "Signal %d caught by ps (%s).\n"
+- "Please send bug reports to <procps-bugs@redhat.com>\n",
++ "Please send bug reports to <acahalan@cs.uml.edu>\n",
+ signo,
+ procps_version
+ );
+@@ -201,6 +201,10 @@
+ proc_t buf;
+ PROCTAB* ptp;
+ ptp = openproc(PROC_FILLBUG);
++ if(!ptp) {
++ fprintf(stderr, "Error: can not access /proc.\n");
++ exit(1);
++ }
+ memset(&buf, '#', sizeof(proc_t));
+ /* use "ps_" prefix to catch library mismatch */
+ while(ps_readproc(ptp,&buf)){
+@@ -269,6 +273,7 @@
+
+ /***** show tree */
+ /* this needs some optimization work */
++#define ADOPTED(x) 1
+ static void show_tree(const int self, const int n, const int level, const int have_sibling){
+ int i = 0;
+ if(level){
+@@ -293,11 +298,18 @@
+ forest_prefix[level] = '\0';
+ }
+ for(;;){
++ int self_pid;
+ int more_children = 1;
+ if(i >= n) break; /* over the edge */
+- if(i+1 >= n) more_children = 0;
+- else if(processes[i+1]->ppid != processes[self]->pid) more_children = 0;
+- show_tree(i++, n, level+1, more_children);
++ self_pid=processes[self]->pid;
++ if(i+1 >= n)
++ more_children = 0;
++ else
++ if(processes[i+1]->ppid != self_pid) more_children = 0;
++ if(self_pid==1 && ADOPTED(processes[i]) && forest_type!='u')
++ show_tree(i++, n, level, more_children);
++ else
++ show_tree(i++, n, level+1, more_children);
+ if(!more_children) break;
+ }
+ /* chop prefix that children added -- do we need this? */
+@@ -325,6 +337,10 @@
+ PROCTAB* ptp;
+ int n = 0; /* number of processes & index into array */
+ ptp = openproc(PROC_FILLBUG);
++ if(!ptp) {
++ fprintf(stderr, "Error: can not access /proc.\n");
++ exit(1);
++ }
+ while((retbuf = ps_readproc(ptp,NULL))){
+ fill_pcpu(retbuf);
+ if(want_this_proc(retbuf)) processes[n++] = retbuf;
+@@ -341,15 +357,6 @@
+
+ /***** no comment */
+ int main(int argc, char *argv[]){
+- if(getuid()!=geteuid()){
+- fprintf(stderr, "This /bin/ps is not secure for setuid operation.");
+- exit(1);
+- }
+- if(getgid()!=getegid()){
+- fprintf(stderr, "This /bin/ps is not secure for setgid operation.");
+- exit(1);
+- }
+-
+ #ifdef DEBUG
+ init_stack_trace(argv[0]);
+ #else
+--- procps-2.0.6.orig/ps/parser.c
++++ procps-2.0.6/ps/parser.c
+@@ -87,19 +87,16 @@
+ static const char *parse_uid(char *str, sel_union *ret){
+ struct passwd *passwd_data;
+ char *endp;
+- int num;
++ unsigned long num;
+ static const char *uidrange = "User ID out of range.";
+ static const char *uidexist = "User name does not exist.";
+- num = strtol(str, &endp, 0);
++ num = strtoul(str, &endp, 0);
+ if(*endp != '\0'){ /* hmmm, try as login name */
+ passwd_data = getpwnam(str);
+ if(!passwd_data) return uidexist;
+ num = passwd_data->pw_uid;
+ }
+- if(num>65534) return uidrange; /* 65535 is very bad */
+- if(num<-32768) return uidrange;
+- if(num==-1) return uidrange; /* -1 is very bad */
+- num &= 0xffff;
++ if(num > 0xfffffffeUL) return uidrange;
+ ret->uid = num;
+ return 0;
+ }
+@@ -107,19 +104,16 @@
+ static const char *parse_gid(char *str, sel_union *ret){
+ struct group *group_data;
+ char *endp;
+- int num;
++ unsigned long num;
+ static const char *gidrange = "Group ID out of range.";
+ static const char *gidexist = "Group name does not exist.";
+- num = strtol(str, &endp, 0);
++ num = strtoul(str, &endp, 0);
+ if(*endp != '\0'){ /* hmmm, try as login name */
+ group_data = getgrnam(str);
+ if(!group_data) return gidexist;
+ num = group_data->gr_gid;
+ }
+- if(num>65534) return gidrange; /* 65535 is very bad */
+- if(num<-32768) return gidrange;
+- if(num==-1) return gidrange; /* -1 is very bad */
+- num &= 0xffff;
++ if(num > 0xfffffffeUL) return gidrange;
+ ret->gid = num;
+ return 0;
+ }
+@@ -255,14 +249,14 @@
+ forest_type = 'u';
+ break;
+ case 'L': /* */
+- /* "fucking Sun blows me"... Sun uses this for threads,
+- * adding the feature after both IBM & Digital used -m.
+- * Maybe this will be supported eventually, after I calm
+- * down about Sun's lack of conformity. Hmmm, SCO added it.
++ /* In spite of the insane 2-level thread system, Sun appears to
++ * have made this option Linux-compatible. If a process has N
++ * threads, ps will produce N lines of output. (not N+1 lines)
++ * Zombies are the only exception, with NLWP==0 and 1 output line.
++ * SCO UnixWare uses -L too.
+ */
+ trace("-L Print LWP (thread) info.\n");
+ format_modifiers |= FM_L;
+- return "Use -m to print threads, not Sun's nonstandard -L.";
+ break;
+ case 'M': /* someday, maybe, we will have MAC like SGI's Irix */
+ trace("-M Print security label for Mandatory Access Control.\n");
+@@ -279,23 +273,25 @@
+ if(!arg) return "Format or sort specification must follow -O.";
+ defer_sf_option(arg, SF_U_O);
+ return NULL; /* can't have any more options */
+-#ifdef WE_UNDERSTAND_THIS
+- case 'P': /* unknown HP/UX or SunOS 5 feature */
++ case 'P': /* SunOS 5 "psr" or unknown HP/UX feature */
+ trace("-P adds columns of PRM info (HP) or PSR column (Sun)\n");
+ format_modifiers |= FM_P;
+- return "No HP PRM support. No Sun PSR info either.";
+ break;
++#ifdef WE_UNDERSTAND_THIS
+ case 'R': /* unknown HP/UX feature */
+ trace("-R selects PRM groups\n");
+ return "Don't understand PRM on Linux.";
+ break;
+- case 'T': /* unknown IRIX feature */
+- /* IRIX 6.5 docs suggest POSIX threads get shown individually. */
+- /* This would make -T be like -L, -m, and m. (but an extra column) */
++#endif
++ case 'T':
++ /* IRIX 6.5 docs suggest POSIX threads get shown individually.
++ * This would make -T be like -L, -m, and m. (but an extra column)
++ * Testing (w/ normal processes) shows 1 line/process, not 2.
++ * Also, testing shows PID==SPID for all normal processes.
++ */
+ trace("-T adds strange SPID column (old sproc() threads?)\n");
+- return "Please tell the author what -T is for.";
++ format_modifiers |= FM_T;
+ break;
+-#endif
+ case 'U': /* end */
+ trace("-U select by RUID (supports names).\n");
+ arg=get_opt_arg();
+@@ -362,12 +358,13 @@
+ break;
+ case 'm':
+ trace("-m shows threads.\n");
+- return "Thread display not implemented.";
++ /* note that AIX shows 2 lines for a normal process */
++ /* not implemented -- silently ignore the option */
+ break;
+ case 'n': /* end */
+ trace("-n sets namelist file.\n");
+ arg=get_opt_arg();
+- if(!arg) return "System.map or psdatabase must follow -n.";
++ if(!arg) return "Alternate System.map file must follow -n.";
+ namelist_file = arg;
+ return NULL; /* can't have any more options */
+ case 'o': /* end */
+@@ -415,7 +412,7 @@
+ case 'u': /* end */
+ trace("-u select by user ID (the EUID?) (supports names).\n");
+ arg=get_opt_arg();
+- if(!arg) return "List of users must follow -p.";
++ if(!arg) return "List of users must follow -u.";
+ err=parse_list(arg, parse_uid);
+ if(err) return err;
+ selection_list->typecode = SEL_EUID;
+@@ -470,6 +467,13 @@
+
+ while(*++flagptr){
+ switch(*flagptr){
++ case '0' ... '9': /* end */
++ trace("0..9 Old BSD-style select by process ID\n");
++ arg=flagptr;
++ err=parse_list(arg, parse_pid);
++ if(err) return err;
++ selection_list->typecode = SEL_PID;
++ return NULL; /* can't have any more options */
+ #if 0
+ case 'A':
+ /* maybe this just does a larger malloc() ? */
+@@ -496,7 +500,7 @@
+ case 'N': /* end */
+ trace("N Specify namelist file\n");
+ arg=get_opt_arg();
+- if(!arg) return "System.map or psdatabase must follow N.";
++ if(!arg) return "Alternate System.map file must follow N.";
+ namelist_file = arg;
+ return NULL; /* can't have any more options */
+ case 'O': /* end */
+@@ -595,7 +599,7 @@
+ defer_sf_option("pmem", SF_B_m);
+ break;
+ }
+- return "Thread support not implemented.";
++ /* not implemented -- silently ignore the option */
+ break;
+ case 'n':
+ trace("n Numeric output for WCHAN, and USER replaced by UID\n");
+@@ -606,7 +610,7 @@
+ case 'o': /* end */
+ trace("o Specify user-defined format\n");
+ arg=get_opt_arg();
+- if(!arg) return "Format specification must follow -o.";
++ if(!arg) return "Format specification must follow o.";
+ defer_sf_option(arg, SF_B_o);
+ return NULL; /* can't have any more options */
+ case 'p': /* end */
+--- procps-2.0.6.orig/ps/output.c
++++ procps-2.0.6/ps/output.c
+@@ -274,7 +274,6 @@
+ if(!*p) return 0;
+ /* Arrrgh! somebody defined unix as 1 */
+ if(forest_type == 'u') goto unixy;
+- p++; /* don't show everything as init's child */
+ while(*p){
+ switch(*p){
+ case ' ': strcpy(q, " "); break;
+@@ -726,19 +725,36 @@
+ return sprintf(outbuf, "%5ld", pp->rss_rlim >> 10);
+ }
+
++/* should print leading tilde ('~') if process is bound to the CPU */
++static int pr_psr(void){
++ return sprintf(outbuf, "%d", pp->processor);
++}
++
++static int pr_wname(void){
++/* SGI's IRIX always uses a number for "wchan", so "wname" is provided too.
++ *
++ * We use '-' for running processes, the location when there is
++ * only one thread waiting in the kernel, and '*' when there is
++ * more than one thread waiting in the kernel.
++ */
++ if(!(pp->wchan & 0xffffff)) return sprintf(outbuf, "%s", "-");
++ return sprintf(outbuf, "%s", wchan(pp->wchan));
++}
++
+ static int pr_nwchan(void){
+ if(!(pp->wchan & 0xffffff)) return sprintf(outbuf, "-");
+ return sprintf(outbuf, "%lx", pp->wchan & 0xffffff);
+ }
+
+ static int pr_rss(void){
+- return sprintf(outbuf, "%lu", pp->rss << (page_shift - 10));
++ return sprintf(outbuf, "%lu", pp->vm_rss);
+ }
+
+-/* On 32-bit hardware, this handles at least 8 GB. Use 1000ULL for more. */
++/* pp->vm_rss * 1000 would overflow on 32-bit systems with 64 GB memory */
+ static int pr_pmem(void){
+ unsigned long pmem = 0;
+- pmem = pp->rss * 1000 / (kb_main_total >> (page_shift-10));
++ pmem = pp->vm_rss * 1000ULL / kb_main_total;
++ if (pmem > 999) pmem = 999;
+ return sprintf(outbuf, "%2u.%u", (unsigned)(pmem/10), (unsigned)(pmem%10));
+ }
+
+@@ -875,6 +891,13 @@
+ }
+
+
++static int pr_thread(void){ /* TID tid LWP lwp SPID spid */
++ return sprintf(outbuf, "%u", pp->pid); /* for now... FIXME */
++}
++static int pr_nlwp(void){ /* THCNT thcount NLWP nlwp */
++ return sprintf(outbuf, "-"); /* for now... FIXME */
++}
++
+ static int pr_sess(void){
+ return sprintf(outbuf, "%u", pp->session);
+ }
+@@ -885,7 +908,7 @@
+
+ /* SGI uses "cpu" to print the processor ID with header "P" */
+ static int pr_sgi_p(void){ /* FIXME */
+- if(pp->state == 'R') return sprintf(outbuf, "%d", 0);
++ if(pp->state == 'R') return sprintf(outbuf, "%d", pp->processor);
+ return sprintf(outbuf, "*");
+ }
+
+@@ -1007,6 +1030,7 @@
+ {"lstart", "STARTED", pr_lstart, sr_nop, 24, 0, XXX, RIGHT},
+ {"luid", "LUID", pr_nop, sr_nop, 5, 0, LNX, RIGHT}, /* login ID */
+ {"luser", "LUSER", pr_nop, sr_nop, 8, 0, LNX, USER}, /* login USER */
++{"lwp", "LWP", pr_thread, sr_nop, 5, 0, SUN, RIGHT},
+ {"m_drs", "DRS", pr_drs, sr_drs, 5, 0, LNx, RIGHT},
+ {"m_dt", "DT", pr_nop, sr_dt, 4, 0, LNx, RIGHT},
+ {"m_lrs", "LRS", pr_nop, sr_lrs, 5, 0, LNx, RIGHT},
+@@ -1024,6 +1048,7 @@
+ {"ni", "NI", pr_nice, sr_nice, 3, 0, BSD, RIGHT}, /*nice*/
+ {"nice", "NI", pr_nice, sr_nice, 3, 0, U98, RIGHT}, /*ni*/
+ {"nivcsw", "IVCSW", pr_nop, sr_nop, 5, 0, XXX, RIGHT},
++{"nlwp", "NLWP", pr_nlwp, sr_nop, 4, 0, SUN, RIGHT},
+ {"nsignals", "NSIGS", pr_nop, sr_nop, 5, 0, DEC, RIGHT}, /*nsigs*/
+ {"nsigs", "NSIGS", pr_nop, sr_nop, 5, 0, BSD, RIGHT}, /*nsignals*/
+ {"nswap", "NSWAP", pr_nop, sr_nswap, 5, 0, XXX, RIGHT},
+@@ -1050,10 +1075,10 @@
+ {"prmgrp", "-", pr_nop, sr_nop, 1, 0, HPU, RIGHT},
+ {"prmid", "-", pr_nop, sr_nop, 1, 0, HPU, RIGHT},
+ {"pset", "PSET", pr_nop, sr_nop, 4, 0, DEC, RIGHT},
+-{"psr", "PSR", pr_nop, sr_nop, 3, 0, DEC, RIGHT},
++{"psr", "PSR", pr_psr, sr_nop, 3, 0, DEC, RIGHT},
+ {"psxpri", "PPR", pr_nop, sr_nop, 3, 0, DEC, RIGHT},
+ {"re", "RE", pr_nop, sr_nop, 3, 0, BSD, RIGHT},
+-{"resident", "-", pr_nop, sr_resident, 5, 0, LNX, RIGHT},
++{"resident", "RES", pr_nop, sr_resident, 5, 0, LNX, RIGHT},
+ {"rgid", "RGID", pr_rgid, sr_rgid, 5, 0, XXX, RIGHT},
+ {"rgroup", "RGROUP", pr_rgroup, sr_rgroup, 6, 0, U98, USER}, /* was 8 wide */
+ {"rlink", "RLINK", pr_nop, sr_nop, 8, 0, BSD, RIGHT},
+@@ -1085,6 +1110,7 @@
+ {"sigmask", "BLOCKED", pr_sigmask, sr_nop, 9, 0, XXX, SIGNAL}, /*blocked*/
+ {"size", "-", pr_nop, sr_size, 1, 0, SCO, RIGHT},
+ {"sl", "SL", pr_nop, sr_nop, 3, 0, XXX, RIGHT},
++{"spid", "SPID", pr_thread, sr_nop, 5, 0, SGI, RIGHT},
+ {"stackp", "STACKP", pr_stackp, sr_nop, 8, 0, LNX, RIGHT}, /*start_stack*/
+ {"start", "STARTED", pr_start, sr_nop, 8, 0, XXX, RIGHT},
+ {"start_code", "S_CODE", pr_nop, sr_start_code, 8, 0, LNx, RIGHT},
+@@ -1103,8 +1129,8 @@
+ {"systime", "SYSTEM", pr_nop, sr_nop, 6, 0, DEC, RIGHT},
+ {"sz", "SZ", pr_sz, sr_nop, 5, 0, HPU, RIGHT},
+ {"tdev", "TDEV", pr_nop, sr_nop, 4, 0, XXX, RIGHT},
+-{"thcount", "THCNT", pr_nop, sr_nop, 1, 0, AIX, RIGHT},
+-{"tid", "TID", pr_nop, sr_nop, 1, 0, AIX, RIGHT},
++{"thcount", "THCNT", pr_nlwp, sr_nop, 5, 0, AIX, RIGHT},
++{"tid", "TID", pr_thread, sr_nop, 5, 0, AIX, RIGHT},
+ {"time", "TIME", pr_time, sr_nop, 8, 0, U98, CUMUL|RIGHT}, /*cputime*/ /* was 6 wide */
+ {"timeout", "TMOUT", pr_timeout, sr_timeout, 5, 0, LNX, RIGHT},
+ {"tmout", "TMOUT", pr_timeout, sr_timeout, 5, 0, LNX, RIGHT},
+@@ -1140,6 +1166,7 @@
+ {"vsize", "VSZ", pr_vsz, sr_vsize, 5, 0, DEC, RIGHT}, /*vsz*/
+ {"vsz", "VSZ", pr_vsz, sr_vm_size, 5, 0, U98, RIGHT}, /*vsize*/
+ {"wchan", "WCHAN", pr_wchan, sr_wchan, 6, 0, XXX, WCHAN}, /* BSD n forces this to nwchan */ /* was 10 wide */
++{"wname", "WCHAN", pr_wname, sr_nop, 6, 0, SGI, WCHAN}, /* opposite of nwchan */
+ {"xstat", "XSTAT", pr_nop, sr_nop, 5, 0, BSD, RIGHT},
+ {"~", "-", pr_nop, sr_nop, 1, 0, LNX, RIGHT} /* NULL would ruin alphabetical order */
+ };
+--- procps-2.0.6.orig/ps/sortformat.c
++++ procps-2.0.6/ps/sortformat.c
+@@ -684,6 +684,7 @@
+ PUSH("pgid");
+ }
+ if(format_flags & (FF_Uf|FF_Ul)) PUSH("ppid");
++ if(format_modifiers & FM_T) PUSH("spid");
+ PUSH("pid");
+ if(format_flags & FF_Uf){
+ if(personality & PER_SANE_USER) PUSH("user");
+--- procps-2.0.6.orig/ps/common.h
++++ procps-2.0.6/ps/common.h
+@@ -112,6 +112,7 @@
+ #define FM_L 0x0008 /* -L */
+ #define FM_P 0x0010 /* -P */
+ #define FM_M 0x0020 /* -M */
++#define FM_T 0x0040 /* -T */
+
+ /* sorting & formatting */
+ /* U,B,G is Unix,BSD,Gnu and then there is the option itself */
+--- procps-2.0.6.orig/ps/Makefile
++++ procps-2.0.6/ps/Makefile
+@@ -19,7 +19,7 @@
+ AOUT_CAPABLE = #-DAOUT_CAPABLE
+ ELF_CAPABLE = #-DELF_CAPABLE
+ LIBBFD = -lbfd -liberty
+-MAN1DIR = /usr/man/man1
++MAN1DIR = /usr/share/man/man1
+
+ all: ps
+
+@@ -52,7 +52,7 @@
+ install: ps
+ -install --owner 0 --group 0 --mode a=rx --strip ps ${DESTDIR}/bin/ps
+ -install --owner 0 --group 0 --mode a=r ps.1 ${DESTDIR}$(MAN1DIR)/ps.1
+- rm -f ${DESTDIR}/var/catman/cat1/ps.1.gz ${DESTDIR}/var/man/cat1/ps.1.gz
++ #rm -f ${DESTDIR}/var/catman/cat1/ps.1.gz ${DESTDIR}/var/man/cat1/ps.1.gz
+
+ clean:
+ rm -f *.o DEADJOE *~ core ps gmon.out
+--- procps-2.0.6.orig/ps/ps.1
++++ procps-2.0.6/ps/ps.1
+@@ -1,217 +1,221 @@
++'\" t
+ .\" Man page for ps.
+-.\" Quick hack conversion by Albert Cahalan, 1998.
+-.\" Licensed under version 2 of the Gnu General Public License.
++.\" Licensed under version 2 of the GNU General Public License.
+ .\"
+-.\" This man page is a horrid hack because *roff sucks.
+-.\" The whole system is way obsolete. The internal header
+-.\" stuff must die, and will when I figure out how to kill it.
+-.\" I've already killed the wasteful left margin and screwy
+-.\" old perfect justification. Gross! You'd think someone
+-.\" invented this crap in 1973. Oh yeah, they did. Sorry.
+ .\"
+ .TH PS 1 "July 5, 1998" "Linux" "Linux User's Manual"
+-.SH \fRNAME\fR
+-ps \- report process status
+-.ad r
+-.na
+-.ss 12 0
+-.in 0
+-.nh
+-.nf
++.SH NAME
++\fBps\fR \- report process status
+
+-SYNOPSIS
+-ps [options]
++.SH SYNOPSIS
++\fBps\fR [\fIoptions\fR]
+
+
+-DESCRIPTION
+-ps gives a snapshot of the current processes. If you want
+-a repetitive update of this status, use top. This man
+-page documents the /proc-based version of ps, or tries to.
++.SH DESCRIPTION
++\fBps\fR gives a snapshot of the current processes. If you want
++a repetitive update of this status, use \fBtop\fR. This man
++page documents the /proc-based version of \fBps\fR, or tries to.
+
+
+-COMMAND-LINE OPTIONS
++.SH OPTIONS
+
+-This version of ps accepts several kinds of options.
++This version of \fBps\fR accepts several kinds of options.
+
+ Unix options may be grouped and must be preceeded by a dash.
+ BSD options may be grouped and must not be used with a dash.
+-Gnu long options are preceeded by two dashes.
++GNU long options are preceeded by two dashes.
+
+ Options of different types may be freely mixed.
+
+-Set the I_WANT_A_BROKEN_PS environment variable to force BSD syntax even
+-when options are preceeded by a dash. The PS_PERSONALITY environment
++Set the \fBI_WANT_A_BROKEN_PS\fR environment variable to force BSD syntax even
++when options are preceeded by a dash. The \fBPS_PERSONALITY\fR environment
+ variable (described below) provides more detailed control of ps behavior.
+
+ SIMPLE PROCESS SELECTION
+--A selects all processes
+--N negate selection
+--a select all with a tty except session leaders
+--d select all, but omit session leaders
+--e selects all processes
+-T Select all processes on this terminal
+-a Select all processes on a terminal, including those of other users
+-g really all, even group leaders (does nothing w/o SunOS settings)
+-r restrict output to running processes
+-x Select processes without controlling ttys
+---deselect negate selection
++.TS
++lfB l.
++-A selects all processes
++-N negate selection
++-a select all with a tty except session leaders
++-d select all, but omit session leaders
++-e selects all processes
++T Select all processes on this terminal
++a Select all processes on a terminal, including those of other users
++g really all, even group leaders (does nothing w/o SunOS settings)
++r restrict output to running processes
++x Select processes without controlling ttys
++--deselect negate selection
++.TE
+
+ PROCESS SELECTION BY LIST
+--C Select by command name
+--G select by RGID (supports names)
+--U select by RUID (supports names)
+--g select by session leader OR by group name
+--p select by PID
+--s Select processes belonging to the sessions given
+--t select by tty
+--u select by effective user ID (supports names)
+-U Select processes for specified users
+-p Select by process ID
+-t Select by tty
+---Group select by real group name or ID
+---User select by real user name or ID
+---group select by effective group name or ID
+---pid select by process ID
+---sid select by session ID
+---tty select by terminal
+---user select by effective user name or ID
+--123 implied --sid
+-123 implied --pid
++.TS
++lfB l.
++-C Select by command name
++-G select by RGID (supports names)
++-U select by RUID (supports names)
++-g select by session leader OR by group name
++-p select by PID
++-s Select processes belonging to the sessions given
++-t select by tty
++-u select by effective user ID (supports names)
++U Select processes for specified users
++p Select by process ID
++t Select by tty
++--Group select by real group name or ID
++--User select by real user name or ID
++--group select by effective group name or ID
++--pid select by process ID
++--sid select by session ID
++--tty select by terminal
++--user select by effective user name or ID
++-123 implied --sid
++123 implied --pid
++.TE
+
+ OUTPUT FORMAT CONTROL
+--O is preloaded "-o"
+--c different scheduler info for -l option
+--f does full listing
+--j jobs format
+--l long format
+--o user-defined format
+--y do not show flags; show rss in place of addr
+-O is preloaded "o" (overloaded)
+-X Old Linux i386 register format
+-j job control format
+-l Display long format
+-o Specify user-defined format
+-s Display signal format
+-u Display user-oriented format
+-v Display virtual memory format
+---format user-defined format
++.TS
++lfB l.
++-O is preloaded "-o"
++-c different scheduler info for -l option
++-f does full listing
++-j jobs format
++-l long format
++-o user-defined format
++-y do not show flags; show rss in place of addr
++O is preloaded "o" (overloaded)
++X Old Linux i386 register format
++j job control format
++l Display long format
++o Specify user-defined format
++s Display signal format
++u Display user-oriented format
++v Display virtual memory format
++--format user-defined format
++.TE
+
+ OUTPUT MODIFIERS
+--H show process heirarchy (forest)
+--m shows threads
+--n sets namelist file
+--w wide output
+-C Use raw CPU time for %CPU instead of decaying average
+-N Specify namelist file
+-O Sorting order (overloaded)
+-S include some dead child process data (as a sum with the parent)
+-c true command name
+-e show environment after the command
+-f ASCII-art process heirarchy (forest)
+-h no header (or, one header per screen in the BSD personality)
+-m all threads
+-n Numeric output for WCHAN and USER
+-w wide output
+---cols set screen width
+---columns set screen width
+---cumulative include some dead child process data (as a sum with the parent)
+---forest ASCII art process tree
+---html HTML escaped output
+---headers repeat header lines, one per page of output
+---no-headers print no header line at all
+---lines set screen height
+---nul unjustified output with NULs
+---null unjustified output with NULs
+---rows set screen height
+---sort specify sorting order
+---width set screen width
+---zero unjustified output with NULs
++.TS
++lfB l.
++-H show process hierarchy (forest)
++-m shows threads
++-n, N sets namelist file
++-w, w wide output
++C Use raw CPU time for %CPU instead of decaying average
++O Sorting order (overloaded)
++S,
++--cumulative include some dead child process data (as a sum with the parent)
++c true command name
++e show environment after the command
++f, --forest ASCII-art process hierarchy (forest)
++h no header (or, one header per screen in the BSD personality)
++m all threads
++n Numeric output for WCHAN and USER
++--cols,
++--columns,
++--width set screen width
++--html HTML escaped output
++--headers repeat header lines, one per page of output
++--no-headers print no header line at all
++--lines,
++--rows set screen height
++--nul, --null,
++--zero unjustified output with NULs
++--sort specify sorting order
++.TE
+
+ INFORMATION
+--V prints version
+-L List all format specifiers
+-V show version info
+---help print help message
+---info print debugging info
+---version prints version
++.TS
++lfB l.
++-V, V,
++--version prints version
++L List all format specifiers
++--help print help message
++--info print debugging info
++.TE
+
+ OBSOLETE
+-A Increases the argument space (DecUnix)
+-M use alternate core (try -n or N instead)
+-W get swap info from ... not /dev/drum (try -n or N instead)
+-k use /vmcore as c-dumpfile (try -n or N instead)
++.TS
++lfB l.
++A Increases the argument space (DecUnix)
++M use alternate core (try -n or N instead)
++W get swap info from ... not /dev/drum (try -n or N instead)
++k use /vmcore as c-dumpfile (try -n or N instead)
++.TE
+
+
++.SH NOTES
+
+-NOTES
+-
+-The "-g" option can select by session leader OR by group name.
++The \fB-g\fR option can select by session leader OR by group name.
+ Selection by session leader is specified by many standards,
+ but selection by group is the logical behavior that several other
+ operating systems use. This ps will select by session leader when
+ the list is completely numeric (as sessions are). Group ID numbers
+ will work only when some group names are also specified.
+
+-The "m" option should not be used. Use "-m" or "-o" with a list.
+-("m" displays memory info, shows threads, or sorts by memory use)
++The \fBm\fR option should not be used. Use \fB-m\fR or \fB-o\fR with a list.
++(\fBm\fR displays memory info, shows threads, or sorts by memory use)
+
+-The "h" option is problematic. Standard BSD ps uses the option to
+-print a header on each page of output, but older Linux ps uses the option
++The \fBh\fR option is problematic. Standard BSD \fBps\fR uses the option to
++print a header on each page of output, but older Linux \fBps\fR uses the option
+ to totally disable the header. This version of ps follows the Linux
+ usage of not printing the header unless the BSD personality has been
+ selected, in which case it prints a header on each page of output.
+ Regardless of the current personality, you can use the long options
+---headers and --no-headers to enable printing headers each page and
++\fB--headers\fR and \fB--no-headers\fR to enable printing headers each page and
+ disable headers entirely, respectively.
+
+ Terminals (ttys, or screens for text output) can be specified in several
+-forms: /dev/ttyS1, ttyS1, S1. Obsolete "ps t" (your own terminal) and
+-"ps t?" (processes without a terminal) syntax is supported, but modern
+-options ("T", "-t" with list, "x", "t" with list) should be used instead.
++forms: \fI/dev/ttyS1\fR, \fIttyS1\fR, \fIS1\fR. Obsolete \fBps t\fR (your own terminal) and
++\fBps t?\fR (processes without a terminal) syntax is supported, but modern
++options (\fBT\fR, \fB-t\fR with list, \fBx\fR, \fBt\fR with list) should be used instead.
+
+-The BSD "O" option can act like "-O" (user-defined output format with
++The BSD \fBO\fR option can act like \fB-O\fR (user-defined output format with
+ some common fields predefined) or can be used to specify sort order.
+ Heuristics are used to determine the behavior of this option. To ensure
+ that the desired behavior is obtained, specify the other option (sorting
+ or formatting) in some other way.
+
+-For sorting, BSD "O" option syntax is O[+|-]k1[,[+|-]k2[,...]]
++For sorting, BSD \fBO\fR option syntax is \fBO\fR[+|-]\fIk1\fR[,[+|-]\fIk2\fR[,...]]
+ Order the process listing according to the multilevel sort specified by
+-the sequence of short keys from SORT KEYS, k1, k2, ... The `+' is quite
++the sequence of short keys from SORT KEYS, \fIk1\fR, \fIk2\fR, ... The `+' is quite
+ optional, merely re-iterating the default direction on a key. `-' reverses
+-direction only on the key it precedes. The O option must be the last option
++direction only on the key it precedes. The \fBO\fR option must be the last option
+ in a single command argument, but specifications in successive arguments are
+ catenated.
+
+-Gnu sorting syntax is --sortX[+|-]key[,[+|-]key[,...]]
++GNU sorting syntax is \fB--sort\fIX\fR[+|-]\fIkey\fR[,[+|-]\fIkey\fR[,...]]
+ Choose a multi-letter key from the SORT KEYS section. X may be any
+ convenient separator character. To be GNU-ish use `='. The `+' is really
+ optional since default direction is increasing numerical or lexicographic
+-order. For example, ps jax --sort=uid,-ppid,+pid
++order. For example, \fBps\fR \fIjax\fR \fB--sort\fR=\fIuid\fR,-\fIppid\fR,+\fIpid\fR
+
+-This ps works by reading the virtual files in /proc. This ps does not
+-need to be suid kmem or have any privileges to run. Do not give this ps
++This \fBps\fR works by reading the virtual files in /proc. This \fBps\fR does not
++need to be suid kmem or have any privileges to run. Do not give this \fBps\fR
+ any special permissions.
+
+-This ps needs access to a namelist file for proper WCHAN display.
++This \fBps\fR needs access to a namelist file for proper WCHAN display.
+ The namelist file must match the current Linux kernel exactly for
+ correct output.
+
+ To produce the WCHAN field, ps needs to read the System.map file created
+ when the kernel is compiled. The search path is:
+
+-$PS_SYSTEM_MAP
+-/boot/System.map-`uname -r`
+-/boot/System.map
+-/lib/modules/`uname -r`/System.map
+-/usr/src/linux/System.map
++.B $PS_SYSTEM_MAP
++.br
++.I /boot/System.map-`uname -r`
++.br
++.I /boot/System.map
++.br
++.I /lib/modules/`uname -r`/System.map
++.br
++.I /usr/src/linux/System.map
+
+ The member used_math of task_struct is not shown, since crt0.s checks
+ to see if math is present. This causes the math flag to be set for all
+ processes, and so it is worthless. (Somebody fix libc or the kernel please)
+
+ Programs swapped out to disk will be shown without command line arguments,
+-and unless the c option is given, in brackets.
++and unless the \fBc\fR option is given, in brackets.
+
+ %CPU shows the cputime/realtime percentage. It will not add up to 100%
+ unless you are lucky. It is time used divided by the time the process has
+@@ -227,289 +231,309 @@
+
+
+ PROCESS FLAGS
+-
+-ALIGNWARN 001 print alignment warning msgs
+-STARTING 002 being created
+-EXITING 004 getting shut down
+-PTRACED 010 set if ptrace (0) has been called
+-TRACESYS 020 tracing system calls
+-FORKNOEXEC 040 forked but didn't exec
+-SUPERPRIV 100 used super-user privileges
+-DUMPCORE 200 dumped core
+-SIGNALED 400 killed by a signal
++.TS
++l l l.
++ALIGNWARN 001 print alignment warning msgs
++STARTING 002 being created
++EXITING 004 getting shut down
++PTRACED 010 set if ptrace (0) has been called
++TRACESYS 020 tracing system calls
++FORKNOEXEC 040 forked but didn't exec
++SUPERPRIV 100 used super-user privileges
++DUMPCORE 200 dumped core
++SIGNALED 400 killed by a signal
++.TE
+
+
+ PROCESS STATE CODES
+-
+-D uninterruptible sleep (usually IO)
+-R runnable (on run queue)
+-S sleeping
+-T traced or stopped
+-Z a defunct ("zombie") process
++.TS
++l l.
++D uninterruptible sleep (usually IO)
++R runnable (on run queue)
++S sleeping
++T traced or stopped
++Z a defunct ("zombie") process
++.TE
+
+ For BSD formats and when the "stat" keyword is used, additional
+ letters may be displayed:
++.TS
++l l.
++W has no resident pages
++< high-priority process
++N low-priority task
++L has pages locked into memory (for real-time and custom IO)
++.TE
+
+-W has no resident pages
+-< high-priority process
+-N low-priority task
+-L has pages locked into memory (for real-time and custom IO)
+-
+-
+-SORT KEYS
++.SH SORT KEYS
+
+ Note that the values used in sorting are the internal values ps uses and not
+ the `cooked' values used in some of the output format fields. Pipe ps
+ output into the sort(1) command if you want to sort the cooked values.
+
+-KEY LONG DESCRIPTION
+-c cmd simple name of executable
+-C cmdline full command line
+-f flags flags as in long format F field
+-g pgrp process group ID
+-G tpgid controlling tty process group ID
+-j cutime cumulative user time
+-J cstime cumulative system time
+-k utime user time
+-K stime system time
+-m min_flt number of minor page faults
+-M maj_flt number of major page faults
+-n cmin_flt cumulative minor page faults
+-N cmaj_flt cumulative major page faults
+-o session session ID
+-p pid process ID
+-P ppid parent process ID
+-r rss resident set size
+-R resident resident pages
+-s size memory size in kilobytes
+-S share amount of shared pages
+-t tty the minor device number of tty
+-T start_time time process was started
+-U uid user ID number
+-u user user name
+-v vsize total VM size in bytes
+-y priority kernel scheduling priority
++.TS
++l l l.
++KEY LONG DESCRIPTION
++c cmd simple name of executable
++C cmdline full command line
++f flags flags as in long format F field
++g pgrp process group ID
++G tpgid controlling tty process group ID
++j cutime cumulative user time
++J cstime cumulative system time
++k utime user time
++K stime system time
++m min_flt number of minor page faults
++M maj_flt number of major page faults
++n cmin_flt cumulative minor page faults
++N cmaj_flt cumulative major page faults
++o session session ID
++p pid process ID
++P ppid parent process ID
++r rss resident set size
++R resident resident pages
++s size memory size in kilobytes
++S share amount of shared pages
++t tty the minor device number of tty
++T start_time time process was started
++U uid user ID number
++u user user name
++v vsize total VM size in bytes
++y priority kernel scheduling priority
++.TE
+
+-
+-AIX FORMAT DESCRIPTORS
++.SH AIX FORMAT DESCRIPTORS
+
+ This ps supports AIX format descriptors, which work somewhat like the
+-formatting codes of printf(1) and printf(3). For example, the normal
+-default output can be produced with this: ps -eo "%p %y %x %c"
+-
+-CODE NORMAL HEADER
+-%C pcpu %CPU
+-%G group GROUP
+-%P ppid PPID
+-%U user USER
+-%a args COMMAND
+-%c comm COMMAND
+-%g rgroup RGROUP
+-%n nice NI
+-%p pid PID
+-%r pgid PGID
+-%t etime ELAPSED
+-%u ruser RUSER
+-%x time TIME
+-%y tty TTY
+-%z vsz VSZ
++formatting codes of \fBprintf\fR(1) and \fBprintf\fR(3). For example, the normal
++default output can be produced with this: \fBps\fR \fB-eo\fR "%p %y %x %c"
+
++.TS
++l l l.
++CODE NORMAL HEADER
++%C pcpu %CPU
++%G group GROUP
++%P ppid PPID
++%U user USER
++%a args COMMAND
++%c comm COMMAND
++%g rgroup RGROUP
++%n nice NI
++%p pid PID
++%r pgid PGID
++%t etime ELAPSED
++%u ruser RUSER
++%x time TIME
++%y tty TTY
++%z vsz VSZ
++.TE
+
+-STANDARD FORMAT SPECIFIERS
++.SH STANDARD FORMAT SPECIFIERS
+
+ These may be used to control both output format and sorting.
+ For example: ps -eo pid,user,args --sort user
+
+-CODE HEADER
+-%cpu %CPU
+-%mem %MEM
+-alarm ALARM
+-args COMMAND
+-blocked BLOCKED
+-bsdstart START
+-bsdtime TIME
+-c C
+-caught CAUGHT
+-cmd CMD
+-comm COMMAND
+-command COMMAND
+-cputime TIME
+-drs DRS
+-dsiz DSIZ
+-egid EGID
+-egroup EGROUP
+-eip EIP
+-esp ESP
+-etime ELAPSED
+-euid EUID
+-euser EUSER
+-f F
+-fgid FGID
+-fgroup FGROUP
+-flag F
+-flags F
+-fname COMMAND
+-fsgid FSGID
+-fsgroup FSGROUP
+-fsuid FSUID
+-fsuser FSUSER
+-fuid FUID
+-fuser FUSER
+-gid GID
+-group GROUP
+-ignored IGNORED
+-intpri PRI
+-lim LIM
+-longtname TTY
+-lstart STARTED
+-m_drs DRS
+-m_trs TRS
+-maj_flt MAJFL
+-majflt MAJFLT
+-min_flt MINFL
+-minflt MINFLT
+-ni NI
+-nice NI
+-nwchan WCHAN
+-opri PRI
+-pagein PAGEIN
+-pcpu %CPU
+-pending PENDING
+-pgid PGID
+-pgrp PGRP
+-pid PID
+-pmem %MEM
+-ppid PPID
+-pri PRI
+-priority PRI
+-rgid RGID
+-rgroup RGROUP
+-rss RSS
+-rssize RSS
+-rsz RSZ
+-ruid RUID
+-ruser RUSER
+-s S
+-sess SESS
+-session SESS
+-sgi_p P
+-sgi_rss RSS
+-sgid SGID
+-sgroup SGROUP
+-sid SID
+-sig PENDING
+-sig_block BLOCKED
+-sig_catch CATCHED
+-sig_ignore IGNORED
+-sig_pend SIGNAL
+-sigcatch CAUGHT
+-sigignore IGNORED
+-sigmask BLOCKED
+-stackp STACKP
+-start STARTED
+-start_stack STACKP
+-start_time START
+-stat STAT
+-state S
+-stime STIME
+-suid SUID
+-suser SUSER
+-svgid SVGID
+-svgroup SVGROUP
+-svuid SVUID
+-svuser SVUSER
+-sz SZ
+-time TIME
+-timeout TMOUT
+-tmout TMOUT
+-tname TTY
+-tpgid TPGID
+-trs TRS
+-trss TRSS
+-tsiz TSIZ
+-tt TT
+-tty TT
+-tty4 TTY
+-tty8 TTY
+-ucmd CMD
+-ucomm COMMAND
+-uid UID
+-uid_hack UID
+-uname USER
+-user USER
+-vsize VSZ
+-vsz VSZ
+-wchan WCHAN
++.TS
++l l.
++CODE HEADER
++%cpu %CPU
++%mem %MEM
++alarm ALARM
++args COMMAND
++blocked BLOCKED
++bsdstart START
++bsdtime TIME
++c C
++caught CAUGHT
++cmd CMD
++comm COMMAND
++command COMMAND
++cputime TIME
++drs DRS
++dsiz DSIZ
++egid EGID
++egroup EGROUP
++eip EIP
++esp ESP
++etime ELAPSED
++euid EUID
++euser EUSER
++f F
++fgid FGID
++fgroup FGROUP
++flag F
++flags F
++fname COMMAND
++fsgid FSGID
++fsgroup FSGROUP
++fsuid FSUID
++fsuser FSUSER
++fuid FUID
++fuser FUSER
++gid GID
++group GROUP
++ignored IGNORED
++intpri PRI
++lim LIM
++longtname TTY
++lstart STARTED
++m_drs DRS
++m_trs TRS
++maj_flt MAJFL
++majflt MAJFLT
++min_flt MINFL
++minflt MINFLT
++ni NI
++nice NI
++nwchan WCHAN
++opri PRI
++pagein PAGEIN
++pcpu %CPU
++pending PENDING
++pgid PGID
++pgrp PGRP
++pid PID
++pmem %MEM
++ppid PPID
++pri PRI
++priority PRI
++rgid RGID
++rgroup RGROUP
++rss RSS
++rssize RSS
++rsz RSZ
++ruid RUID
++ruser RUSER
++s S
++sess SESS
++session SESS
++sgi_p P
++sgi_rss RSS
++sgid SGID
++sgroup SGROUP
++sid SID
++sig PENDING
++sig_block BLOCKED
++sig_catch CATCHED
++sig_ignore IGNORED
++sig_pend SIGNAL
++sigcatch CAUGHT
++sigignore IGNORED
++sigmask BLOCKED
++stackp STACKP
++start STARTED
++start_stack STACKP
++start_time START
++stat STAT
++state S
++stime STIME
++suid SUID
++suser SUSER
++svgid SVGID
++svgroup SVGROUP
++svuid SVUID
++svuser SVUSER
++sz SZ
++time TIME
++timeout TMOUT
++tmout TMOUT
++tname TTY
++tpgid TPGID
++trs TRS
++trss TRSS
++tsiz TSIZ
++tt TT
++tty TT
++tty4 TTY
++tty8 TTY
++ucmd CMD
++ucomm COMMAND
++uid UID
++uid_hack UID
++uname USER
++user USER
++vsize VSZ
++vsz VSZ
++wchan WCHAN
++.TE
+
+
+
++.SH ENVIRONMENT VARIABLES
+
+-ENVIRONMENT VARIABLES
+ The following environment variables could affect ps:
+- COLUMNS Override default display width.
+- LINES Override default display height.
+- PS_PERSONALITY Set to one of posix,old,linux,bsd,sun,digital...
+- CMD_ENV Set to one of posix,old,linux,bsd,sun,digital...
+- I_WANT_A_BROKEN_PS Force obsolete command line interpretation.
+- LC_TIME Date format.
+- PS_COLORS Not currently supported.
+- PS_FORMAT Default output format override.
+- PS_SYSMAP Default namelist (System.map) location.
+- PS_SYSTEM_MAP Default namelist (System.map) location.
+- POSIXLY_CORRECT Don't find excuses to ignore bad "features".
+- UNIX95 Don't find excuses to ignore bad "features".
+- _XPG Cancel CMD_ENV=irix non-standard behavior.
++.TS
++lfB l.
++COLUMNS Override default display width.
++LINES Override default display height.
++PS_PERSONALITY Set to one of posix,old,linux,bsd,sun,digital...
++CMD_ENV Set to one of posix,old,linux,bsd,sun,digital...
++I_WANT_A_BROKEN_PS Force obsolete command line interpretation.
++LC_TIME Date format.
++PS_COLORS Not currently supported.
++PS_FORMAT Default output format override.
++PS_SYSMAP Default namelist (System.map) location.
++PS_SYSTEM_MAP Default namelist (System.map) location.
++POSIXLY_CORRECT Don't find excuses to ignore bad "features".
++UNIX95 Don't find excuses to ignore bad "features".
++_XPG Cancel CMD_ENV=irix non-standard behavior.
++.TE
+
+ In general, it is a bad idea to set these variables. The one exception
+-is CMD_ENV or PS_PERSONALITY, which could be set to Linux for normal
+-systems. Without that setting, ps follows the useless and bad parts
++is \fBCMD_ENV\fR or \fBPS_PERSONALITY\fR, which could be set to Linux for normal
++systems. Without that setting, \fBps\fR follows the useless and bad parts
+ of the Unix98 standard.
+
+
+ PERSONALITY
+- aix like AIX ps
+- bsd like FreeBSD ps (totally non-standard)
+- compaq like Digital Unix ps
+- debian like the old Debian ps
+- digital like Digital Unix ps
+- gnu like the old Debian ps
+- hp like HP-UX ps
+- hpux like HP-UX ps
+- irix like Irix ps
+- linux ***** RECOMMENDED *****
+- old like the original Linux ps (totally non-standard)
+- posix standard
+- sco like SCO ps
+- sgi like Irix ps
+- sun like SunOS 4 ps (totally non-standard)
+- sunos like SunOS 4 ps (totally non-standard)
+- sysv standard
+- unix standard
+- unix95 standard
+- unix98 standard
++.TS
++l l.
++aix like AIX ps
++bsd like FreeBSD ps (totally non-standard)
++compaq like Digital Unix ps
++debian like the old Debian ps
++digital like Digital Unix ps
++gnu like the old Debian ps
++hp like HP-UX ps
++hpux like HP-UX ps
++irix like Irix ps
++linux ***** RECOMMENDED *****
++old like the original Linux ps (totally non-standard)
++posix standard
++sco like SCO ps
++sgi like Irix ps
++sun like SunOS 4 ps (totally non-standard)
++sunos like SunOS 4 ps (totally non-standard)
++sysv standard
++unix standard
++unix95 standard
++unix98 standard
++.TE
+
+
+-EXAMPLES
++.SH EXAMPLES
+ To see every process on the system using standard syntax:
+- ps -e
++ \fBps\fR \fB-e\fR
++.br
+ To see every process on the system using BSD syntax:
+- ps ax
++ \fBps\fR \fBax\fR
++.br
+ To see every process except those running as root (real & effective ID)
+- ps -U root -u root -N
++ \fBps\fR \fB-U\fR \fIroot\fR \fB-u\fR \fIroot\fR \fB-N\fR
++.br
+ To see every process with a user-defined format:
+- ps -eo pid,tt,user,fname,tmout,f,wchan
++ \fBps\fR \fB-eo\fR pid,tt,user,fname,tmout,f,wchan
++.br
+ Odd display with AIX field descriptors:
+- ps -o "%u : %U : %p : %a"
++ \fBps\fR \fB-o\fR "%u : %U : %p : %a"
++.br
+ Print only the process IDs of syslogd:
+- ps -C syslogd -o pid=
+-
+-SEE ALSO
+-top(1) pstree(1) proc(5)
++ \fBps\fR \fB-C\fR \fIsyslogd\fR \fB-o\fR pid=
+
+-STANDARDS
+-This ps conforms to version 2 of the Single Unix Specification.
++.SH CONFORMING TO
++This \fBps\fR conforms to version 2 of the Single Unix Specification.
+
+-AUTHOR
++.SH AUTHOR
+ ps was originally written by Branko Lankester <lankeste@fwi.uva.nl>. Michael
+ K. Johnson <johnsonm@redhat.com> re-wrote it significantly to use the proc
+ filesystem, changing a few things in the process. Michael Shields
+@@ -518,8 +542,11 @@
+ device name-to-number mmaped database, the approximate binary search
+ directly on System.map, and many code and documentation cleanups. David
+ Mossberger-Tang wrote the generic BFD support for psupdate. Albert Cahalan
+-<acahalan@cs.uml.edu> rewrote ps for full Unix98 and BSD support, along with
+-some ugly hacks for obsolete and foreign syntax. Michael K. Johnson
+-<johnsonm@redhat.com> is the current maintainer.
++<acahalan@cs.uml.edu> rewrote \fBps\fR for full Unix98 and BSD support, along with
++some ugly hacks for obsolete and foreign syntax.
++
++Please send bug reports to <acahalan@cs.uml.edu> or use the Debian Bug Tracking System.
++
++.SH SEE ALSO
++\fBtop\fR(1), \fBpstree\fR(1), \fBproc\fR(5)
+
+-Please send bug reports to <procps-bugs@redhat.com>
+--- procps-2.0.6.orig/w.c
++++ procps-2.0.6/w.c
+@@ -119,12 +119,12 @@
+ if (hour == 0) hour = 12;
+ if (curt - logt > 12*60*60 && logtm->tm_yday != today) {
+ if (curt - logt > 6*24*60*60)
+- fprintf(fout, " %2d%3s%2d", logtm->tm_mday, month[logtm->tm_mon],
++ fprintf(fout, " %02d%3s%02d", logtm->tm_mday, month[logtm->tm_mon],
+ logtm->tm_year % 100);
+ else
+- fprintf(fout, " %3s%2d%s", weekday[logtm->tm_wday], hour, merid);
++ fprintf(fout, " %3s%02d%s", weekday[logtm->tm_wday], hour, merid);
+ } else {
+- fprintf(fout, " %2d:%02d%s", hour, logtm->tm_min, merid);
++ fprintf(fout, " %02d:%02d%s", hour, logtm->tm_min, merid);
+ }
+ }
+
+--- procps-2.0.6.orig/tload.1
++++ procps-2.0.6/tload.1
+@@ -47,4 +47,4 @@
+ Branko Lankester, David Engel <david@ods.com>, and
+ Michael K. Johnson <johnsonm@redhat.com>.
+
+-Please send bug reports to <procps-bugs@redhat.com>
++Please send bug reports to <acahalan@cs.uml.edu>
+--- procps-2.0.6.orig/sysctl.c
++++ procps-2.0.6/sysctl.c
+@@ -207,8 +207,7 @@
+ return;
+ } /* endif */
+
+- while (!feof(fp)) {
+- fgets(oneline, 256, fp);
++ while (fgets(oneline, 256, fp)) {
+ oneline[256] = 0;
+ n++;
+ t = StripLeadingAndTrailingSpaces(oneline);
+--- procps-2.0.6.orig/top.1
++++ procps-2.0.6/top.1
+@@ -441,6 +441,4 @@
+ The "b" and "n" options contributed by George Bonser <george@captech.com>
+ for CapTech IT Services.
+
+-Michael K. Johnson <johnsonm@redhat.com> is now the maintainer.
+-
+-Please send bug reports to <procps-bugs@redhat.com>
++Please send bug reports to <acahalan@cs.uml.edu>
+--- procps-2.0.6.orig/top.c
++++ procps-2.0.6/top.c
+@@ -471,6 +471,8 @@
+ if (open_psdb(NULL)) CL_wchan_nout = 1;
+ }
+
++ meminfo(); /* need kb_main_total value filled in */
++
+ setup_terminal();
+ window_size(0);
+ /*
+@@ -737,8 +739,8 @@
+
+ static int mem_sort (proc_t **P, proc_t **Q)
+ {
+- if( (*P)->resident < (*Q)->resident ) return -1;
+- if( (*P)->resident > (*Q)->resident ) return 1;
++ if( (*P)->vm_rss < (*Q)->vm_rss ) return -1;
++ if( (*P)->vm_rss > (*Q)->vm_rss ) return 1;
+ return 0;
+ }
+
+@@ -852,9 +854,9 @@
+ printf("Toggle fields with a-x, any other key to return: ");
+ fflush(stdout);
+ tcsetattr(0, TCSAFLUSH, &Rawtty);
++ read(0, &c, 1);
++ tcsetattr(0, TCSAFLUSH, &Savetty);
+ }
+- read(0, &c, 1);
+- tcsetattr(0, TCSAFLUSH, &Savetty);
+ i = toupper(c) - 'A';
+ if (i >= 0 && i < sizeof headers / sizeof headers[0]) {
+ row = i % (Lines - 3) + 3;
+@@ -959,7 +961,7 @@
+ /*
+ * Displays infos for a single task
+ */
+-static void show_task_info(proc_t *task, int pmem)
++static void show_task_info(proc_t *task)
+ {
+ int i,j;
+ unsigned int t;
+@@ -984,8 +986,12 @@
+ case P_PCPU:
+ sprintf(tmp, "%4.1f ", (float)task->pcpu / 10);
+ break;
+- case P_PMEM:
+- sprintf(tmp, "%4.1f ", (float)pmem / 10);
++ case P_PMEM: {
++ unsigned pmem;
++ pmem = task->vm_rss * 1000ULL / kb_main_total;
++ if (pmem > 999) pmem = 999;
++ sprintf(tmp, "%2u.%u ", pmem/10U, pmem%10U);
++ }
+ break;
+ case P_TTY: {
+ char outbuf[9];
+@@ -1032,9 +1038,9 @@
+ case P_DT:
+ sprintf(tmp, "%3.3s ", scale_k(task->dt, 3, 0));
+ break;
+- case P_RSS: /* resident not rss, it seems to be more correct. */
++ case P_RSS: /* rss, not resident (which includes IO memory) */
+ sprintf(tmp, "%4.4s ",
+- scale_k((task->resident << CL_pg_shift), 4, 1));
++ scale_k((task->rss << CL_pg_shift), 4, 1));
+ break;
+ case P_WCHAN:
+ if (!CL_wchan_nout)
+@@ -1113,7 +1119,7 @@
+ static int first=0;
+
+ if (first==0) {
+- proc_flags=PROC_FILLMEM|PROC_FILLCMD|PROC_FILLUSR;
++ proc_flags=PROC_FILLMEM|PROC_FILLCMD|PROC_FILLUSR|PROC_FILLSTATUS|PROC_FILLSTAT;
+ if (monpids_index)
+ proc_flags |= PROC_PID;
+ p_table=readproctab2(proc_flags, p_table, monpids);
+@@ -1154,7 +1160,6 @@
+ count = 0;
+ ActualLines = 0;
+ while ((ActualLines < Maxlines) && (p_table[count]->pid!=-1)) {
+- int pmem;
+ char Stat;
+
+ Stat = p_table[count]->state;
+@@ -1166,10 +1171,7 @@
+ /*
+ * Show task info.
+ */
+- /* FIXME: this appears to assume a 4 kB page size */
+- /* FIXME: maybe this can overflow on huge memory systems */
+- pmem = p_table[count]->resident * 250 / (kb_main_total);
+- show_task_info(p_table[count], pmem);
++ show_task_info(p_table[count]);
+ if (!Batch)
+ ActualLines++;
+ }
+@@ -1245,18 +1247,19 @@
+ proc_t *this;
+ int arrindex, total_time, i, n = 0;
+ int sleeping = 0, stopped = 0, zombie = 0, running = 0;
+- unsigned long system_ticks = 0, user_ticks = 0, nice_ticks = 0, idle_ticks = 1000;
++ double system_ticks, user_ticks, nice_ticks, idle_ticks;
+ static int prev_count = 0;
+ int systime, usrtime;
+
+- /* start with one 4K page as a reasonable allocate size */
+- static int save_history_size = sizeof(struct save_hist) * 204;
++ /* start with one page as a reasonable allocate size */
++ static int save_history_size =
++ sizeof(long)*1024 / sizeof(struct save_hist);
+ static struct save_hist *save_history;
+ struct save_hist *New_save_hist;
+
+ if (!save_history)
+- save_history = xcalloc(NULL, save_history_size);
+- New_save_hist = xcalloc(NULL, save_history_size);
++ save_history = xcalloc(NULL, sizeof(struct save_hist)*save_history_size);
++ New_save_hist = xcalloc(NULL, sizeof(struct save_hist)*save_history_size);
+
+ /*
+ * Make a pass through the data to get stats.
+@@ -1288,10 +1291,10 @@
+ * (usrtime) plus system time (systime).
+ */
+ total_time = this->utime + this->stime;
+- if (arrindex > save_history_size) {
++ if (arrindex >= save_history_size) {
+ save_history_size *= 2;
+- save_history = xrealloc(save_history, save_history_size);
+- New_save_hist = xrealloc(New_save_hist, save_history_size);
++ save_history = xrealloc(save_history, sizeof(struct save_hist)*save_history_size);
++ New_save_hist = xrealloc(New_save_hist, sizeof(struct save_hist)*save_history_size);
+ }
+ New_save_hist[arrindex].ticks = total_time;
+ New_save_hist[arrindex].pid = this->pid;
+@@ -1318,28 +1321,10 @@
+ if (this->pcpu > 999)
+ this->pcpu = 999;
+
+-#if 0
+- /*
+- * Calculate time in idle, system, user and niced tasks.
+- */
+- idle_ticks -= this->pcpu;
+- system_ticks += systime;
+- user_ticks += usrtime;
+- if (this->nice > 0)
+- nice_ticks += this->pcpu;
+-#endif
+-
+ arrindex++;
+ n++;
+ }
+
+-#if 0
+- if (idle_ticks < 0)
+- idle_ticks = 0;
+- system_ticks = (system_ticks * 10 * 100/Hertz) / elapsed_time;
+- user_ticks = (user_ticks * 10 * 100/Hertz) / elapsed_time;
+-#endif
+-
+ /*
+ * Display stats.
+ */
+@@ -1349,25 +1334,14 @@
+ n, sleeping, running, zombie, stopped);
+ PUTP(top_clrtoeol);
+ putchar('\n');
+- /* BEGIN EXPERIMENTAL CODE */
+- /* Throw out the calculation above... TODO: remove calculation. */
+ four_cpu_numbers(&user_ticks,&nice_ticks,&system_ticks,&idle_ticks);
+- do{
+- unsigned long sum;
+- sum = user_ticks+nice_ticks+system_ticks+idle_ticks;
+- user_ticks = (user_ticks * 1000) / sum;
+- system_ticks = (system_ticks * 1000) / sum;
+- nice_ticks = (nice_ticks * 1000) / sum;
+- idle_ticks = (idle_ticks * 1000) / sum;
+- }while(0);
+- /* END EXPERIMENTAL CODE */
+ printf("CPU states:"
+- " %2ld.%ld%% user, %2ld.%ld%% system,"
+- " %2ld.%ld%% nice, %2ld.%ld%% idle",
+- user_ticks / 10UL, user_ticks % 10UL,
+- system_ticks / 10UL, system_ticks % 10UL,
+- nice_ticks / 10UL, nice_ticks % 10UL,
+- idle_ticks / 10UL, idle_ticks % 10UL
++ " %# 5.1f%% user, %# 5.1f%% system,"
++ " %# 5.1f%% nice, %# 5.1f%% idle",
++ user_ticks,
++ system_ticks,
++ nice_ticks,
++ idle_ticks
+ );
+ PUTP(top_clrtoeol);
+ putchar('\n');
+--- procps-2.0.6.orig/top.h
++++ procps-2.0.6/top.h
+@@ -22,7 +22,7 @@
+ static void show_fields(void);
+ static void change_order(void);
+ static void change_fields(void);
+-static void show_task_info(proc_t *task, int pmem);
++static void show_task_info(proc_t *task);
+ static void show_procs(void);
+ static float get_elapsed_time(void);
+ static void show_meminfo(void);
+--- procps-2.0.6.orig/vmstat.c
++++ procps-2.0.6/vmstat.c
+@@ -19,7 +19,7 @@
+ */
+ /* PROCPS
+ This is part of the procps package maintained by Michael K. Johnson
+- <johnsonm@redhat.com>; report bugs to <procps-bugs@redhat.com>.
++ <johnsonm@redhat.com>; report bugs to <acahalan@cs.uml.edu>.
+ */
+
+ #include "proc/sysinfo.h"
+--- procps-2.0.6.orig/uptime.1
++++ procps-2.0.6/uptime.1
+@@ -26,7 +26,7 @@
+ was written by Larry Greenfield <greenfie@gauss.rutgers.edu> and
+ Michael K. Johnson <johnsonm@sunsite.unc.edu>.
+
+-Please send bug reports to <procps-bugs@redhat.com>
++Please send bug reports to <acahalan@cs.uml.edu>
+ .SH "SEE ALSO"
+ .BR ps (1),
+ .BR top (1),
+--- procps-2.0.6.orig/w.1
++++ procps-2.0.6/w.1
+@@ -59,10 +59,13 @@
+ Show information about the specified user only.
+
+ .SH FILES
+-.ta
+-.IR /etc/utmp " information about who is currently logged on"
+-.IR /proc " process information"
+-.fi
++.TP
++.I /etc/utmp
++information about who is currently logged on
++.TP
++.I /proc
++process information
++.PP
+
+ .SH "SEE ALSO"
+ .BR free (1),
+@@ -78,4 +81,4 @@
+ Greenfield <greenfie@gauss.rutgers.edu> and Michael K. Johnson
+ <johnsonm@redhat.com>.
+
+-Please send bug reports to <procps-bugs@redhat.com>
++Please send bug reports to <acahalan@cs.uml.edu>
+--- procps-2.0.6.orig/watch.c
++++ procps-2.0.6/watch.c
+@@ -13,8 +13,8 @@
+
+ #include <ctype.h>
+ #include <getopt.h>
+-#include <ncurses.h>
+ #include <signal.h>
++#include <ncurses.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+--- procps-2.0.6.orig/oldps.1
++++ procps-2.0.6/oldps.1
+@@ -353,4 +353,4 @@
+ wrote the generic BFD support for psupdate. Michael K. Johnson
+ <johnsonm@redhat.com> is the current maintainer.
+
+-Please send bug reports to <procps-bugs@redhat.com>
++Please send bug reports to <acahalan@cs.uml.edu>
+--- procps-2.0.6.orig/kill.1
++++ procps-2.0.6/kill.1
+@@ -2,7 +2,7 @@
+ .\" Licensed under version 2 of the GNU General Public License.
+ .\" Written by Albert Cahalan; converted to a man page by
+ .\" Michael K. Johnson
+-.TH KILL 1 "March 12, 1999" "Linux" "Linux User's Manual"
++.TH KILL 1 "November 21, 1999" "Linux" "Linux User's Manual"
+ .SH NAME
+ kill \- report process status
+
+@@ -42,8 +42,7 @@
+ USR1 exit
+ USR2 exit
+ VTALRM exit
+-STKFLT exit i386, m68k, arm and ppc hardware only
+-UNUSED exit i386, m68k, arm and ppc hardware only
++STKFLT exit may not be implemented
+ PWR ignore may exit on some systems
+ WINCH ignore
+ CHLD ignore
+@@ -71,9 +70,6 @@
+ You may need to run the command described here as /bin/kill to solve
+ the conflict.
+
+-The STKFLT and UNUSED signals may not be supported in the future,
+-and are currently unavailable on some systems.
+-
+ .SH EXAMPLES
+ kill -9 -1
+ .br
+@@ -94,4 +90,4 @@
+ version that was not standards compliant. Michael K. Johnson
+ <johnsonm@redhat.com> is the current maintainer of the procps collection.
+
+-Please send bug reports to <procps-bugs@redhat.com>
++Please send bug reports to <acahalan@cs.uml.edu>
+--- procps-2.0.6.orig/oldps.c
++++ procps-2.0.6/oldps.c
+@@ -304,6 +304,10 @@
+
+ /* initiate process table scan */
+ tab = openproc(pflags, args, N);
++ if (!tab) {
++ fprintf(stderr, "Error: can not access /proc.\n");
++ exit(1);
++ }
+
+ if (do_header) puts(mode[CL_fmt].header); /* print header */
+
+--- procps-2.0.6.orig/skill.1
++++ procps-2.0.6/skill.1
+@@ -66,8 +66,7 @@
+ USR1 exit
+ USR2 exit
+ VTALRM exit
+-STKFLT exit i386, m68k, arm and ppc hardware only
+-UNUSED exit i386, m68k, arm and ppc hardware only
++STKFLT exit may not be implemented
+ PWR ignore may exit on some systems
+ WINCH ignore
+ CHLD ignore
+@@ -90,10 +89,6 @@
+ XFSZ core core dump may fail
+ .TE
+
+-.SH NOTES
+-The STKFLT and UNUSED signals may not be supported in the future,
+-and they are currently unavailable on some systems.
+-
+ .SH EXAMPLES
+ .TS
+ lB lB
+@@ -101,7 +96,7 @@
+ Command Description
+ .TC
+ snice netscape crack +7 Slow down netscape and crack
+-skill -KILL -v pts/* Kill users on new-style PTY devices
++skill -KILL -v /dev/pts/* Kill users on new-style PTY devices
+ skill -STOP torvalds davem tytso Stop 3 users
+ snice -17 root bash Give priority to root's shell
+ .TE
+@@ -117,4 +112,4 @@
+ replacement for a non-free version. Michael K. Johnson <johnsonm@redhat.com>
+ is the current maintainer of the procps collection.
+
+-Please send bug reports to <procps-bugs@redhat.com>
++Please send bug reports to <acahalan@cs.uml.edu>
+--- procps-2.0.6.orig/debian/procps.sh
++++ procps-2.0.6/debian/procps.sh
+@@ -0,0 +1,39 @@
++#! /bin/sh
++# /etc/init.d/procps: Set kernel variables from /etc/sysctl.conf
++#
++# written by Elrond <Elrond@Wunder-Nett.org>
++
++# Check for existance of the default file and exit if not there,
++# Closes #52839 for the boot-floppy people
++[ -r /etc/default/rcS ] || exit 0
++. /etc/default/rcS
++
++[ -x /sbin/sysctl ] || exit 0
++
++
++case "$1" in
++ start|reload|restart|force-reload)
++ if [ ! -r /etc/sysctl.conf ]
++ then
++ exit 0
++ fi
++ if [ "$VERBOSE" = "no" ]
++ then
++ n="-n"
++ redir=">/dev/null"
++ else
++ echo "Setting kernel variables."
++ n=""
++ redir=""
++ fi
++ eval "/sbin/sysctl $n -p $redir"
++ ;;
++ stop|show)
++ ;;
++ *)
++ echo "Usage: /etc/init.d/sysctl.sh {start|stop|reload|restart}" >&2
++ exit 1
++ ;;
++esac
++
++
+--- procps-2.0.6.orig/debian/rules
++++ procps-2.0.6/debian/rules
+@@ -0,0 +1,90 @@
++#!/usr/bin/make -f
++# Sample debian/rules that uses debhelper.
++# GNU copyright 1997 to 1999 by Joey Hess.
++
++# Uncomment this to turn on verbose mode.
++#export DH_VERBOSE=1
++
++# This is the debhelper compatability version to use.
++export DH_COMPAT=1
++
++build: build-stamp
++build-stamp:
++ dh_testdir
++
++ # Add here commands to compile the package.
++ -$(MAKE)
++
++ touch build-stamp
++
++clean:
++ dh_testdir
++ dh_testroot
++ rm -f build-stamp install-stamp
++
++ # Add here commands to clean up after the build process.
++ #-$(MAKE) clean
++ -$(MAKE) distclean
++
++ dh_clean
++
++install: install-stamp
++install-stamp: build-stamp
++ dh_testdir
++ dh_testroot
++ dh_clean -k
++ dh_installdirs
++
++ # Add here commands to install the package into debian/tmp.
++ #$(MAKE) DESTDIR=`pwd`/debian/tmp install_free install_skill install_oldps install_snice install_tload install_sysctl install_uptime install_vmstat install_w install_watch install_ps install_top install_sysctl
++ $(MAKE) DESTDIR=`pwd`/debian/tmp install
++ $(MAKE) DESTDIR=`pwd`/debian/tmp TOPDIR=`pwd`/debian/tmp/usr libinstall
++ (cd `pwd`/debian/tmp/usr/bin && mv w w.procps )
++ (cd `pwd`/debian/tmp/usr/lib && ln -sf /lib/libproc.so.2.0.6 libproc.so)
++ # Special for kill, we need it in /bin
++ install --mode a=rx --strip skill `pwd`/debian/tmp/bin/kill
++ rm `pwd`/debian/tmp/usr/bin/kill
++ install --mode 644 -o root -g root debian/sysctl.conf `pwd`/debian/tmp/etc
++
++
++ touch install-stamp
++
++# Build architecture-independent files here.
++binary-indep: build install
++# We have nothing to do by default.
++
++# Build architecture-dependent files here.
++binary-arch: build install
++# dh_testversion
++ dh_testdir
++ dh_testroot
++ dh_installdocs
++ dh_installexamples
++ dh_installmenu
++# dh_installemacsen
++# dh_installpam
++ dh_installinit --update-rcd-params='start 30 S .' --init-script='procps.sh'
++ dh_installcron
++ dh_installmanpages -pprocps
++ (cd `pwd`/debian/tmp/usr/share/man/man1 && mv w.1 w.procps.1 )
++ dh_installinfo
++# dh_undocumented
++ dh_installchangelogs NEWS
++ dh_link
++ dh_strip
++ dh_compress
++ dh_fixperms
++ dh_movefiles
++ # You may want to make some executables suid here.
++ dh_suidregister
++ dh_makeshlibs
++ dh_installdeb
++# dh_perl
++ dh_shlibdeps -pprocps -u"-Ldebian/procps.shlibs.local"
++ dh_shlibdeps -plibproc-dev -u"-Ldebian/shlibs.local"
++ dh_gencontrol
++ dh_md5sums
++ dh_builddeb
++
++binary: binary-indep binary-arch
++.PHONY: build clean binary-indep binary-arch binary install
+--- procps-2.0.6.orig/debian/README.Debian
++++ procps-2.0.6/debian/README.Debian
+@@ -0,0 +1,6 @@
++procps for DEBIAN
++----------------------
++ XConsole and other X-based programs have been finally removed. Look in
++ the x packages for their equivalents.
++
++ Craig Small <csmall@debian.org>
+--- procps-2.0.6.orig/debian/changelog
++++ procps-2.0.6/debian/changelog
+@@ -0,0 +1,455 @@
++procps (1:2.0.6-9) unstable; urgency=medium
++
++ * added libncurses5-dev to build-depends, Closes: #67533
++ * Put kill back into /bin Closes #67580, #67582
++ * Put 2.0.6-7 ps.1 back in Closes: #67451
++
++ -- Craig Small <csmall@debian.org> Tue, 25 Jul 2000 08:13:21 +1000
++
++procps (1:2.0.6-8) unstable; urgency=low
++
++ * New upstream source:
++ * - sysctl EOF bug fixed Closes: #62877
++ * - stop crashes with unmounted /proc Closes: #63512, #55177
++ * - Versions checking tolerates RH /proc/ksyms Closes: #59798
++ * - Top works better with SMP Closes: #34734, #56547, #59703
++
++ -- Craig Small <csmall@debian.org> Fri, 14 Jul 2000 22:33:44 +1000
++
++procps (1:2.0.6-7) unstable; urgency=low
++
++ * Fixed missing version Closes: #62207, #62484, #59112
++ * Stop crashes with umounted /proc Closes: #63512, #55177
++ * Nicer man pages Closes: #63495, #59406
++ * Fixed sysctl eof bug Closes: #62877
++ * watch wraps properly Closes: #60913
++ * watch handles tabs Closes: #46213
++ * watch honors locale settings Closes: #63762
++ * now versioned replaces line for bsdutils
++
++ -- Craig Small <csmall@debian.org> Mon, 29 May 2000 13:31:54 +1000
++
++procps (1:2.0.6-6) unstable; urgency=low
++
++ * New patchlevel (000221)
++ * ps 'f' ASCII art forest fixed. Closes: #57134, #58644
++ * let insane people run ps setuid. Closes: #56701
++ * note that kernel 2.3 is now faster. Closes: #49130
++ * top with WCHAN was leaking memory. Closes: #58172, #52257, #56889
++ * can show current CPU. Closes: #37023
++ * w looks better now. Closes: #55952
++ * init.d/procps removed if exists. Closes: #55137, #55852
++ * Fixed skill/snice man page (thanks man-db maint!) Closes: #53736, #46743
++ * Fixed ps man page Closes: #58365
++
++ -- Craig Small <csmall@debian.org> Wed, 23 Feb 2000 10:31:37 +1100
++
++procps (1:2.0.6-5) unstable; urgency=low
++
++ * New upstream source
++ * kill "_R(smp_|smp2gig_|2gig_)?[0-9a-fA-F]{8,}" Closes: #54394, #53208
++ * added type 'S' and scan past machine types Closes: #54396
++ * Fixed w(1) manpage Closes: #54709
++ * top now agrees with ps for RSS Closes: #52679
++
++ -- Craig Small <csmall@debian.org> Tue, 11 Jan 2000 08:23:56 +1100
++
++procps (1:2.0.6-4) unstable; urgency=low
++
++ * procps init.d script quietly dies if not /etc/default/rcS Closes:
++ #52839
++ * Put the NEWS changelog back in Closes: #52678
++ * Fixed that damn Rsmp annoying message bug Closes: #48686
++ * Remove /etc/init.d/procps Closes: #53818
++
++ -- Craig Small <csmall@debian.org> Mon, 20 Dec 1999 11:14:53 +1100
++
++procps (1:2.0.6-3) unstable; urgency=low
++
++ * Patched ps so it complains if you chmod 711 /proc Closes: #52481
++ * Did the same for top.
++ * Ditto for oldps.
++ * Changed and int to a char* Closes: #52482
++ * sysctl.conf file references sysctl.conf (5) not 8 Closes: #52385
++ * props init.d script changed to procps.sh Closes: #52228
++
++ -- Craig Small <csmall@debian.org> Mon, 13 Dec 1999 11:57:01 +1100
++
++procps (1:2.0.6-2) unstable; urgency=low
++
++ * Changed psmisc from reccomends to suggests
++ * %MEM now works, Closes: #50010 #50055 #50148 #50356
++ * top doesn't crash with > 204 processes Closes: #50055
++ * Another libproc fd leak fixed Closes: #45398
++ * ps silently ignores m and -m for future compatibility Closes: #48308
++ * Added a sysctl.conf and other files as suggested Closes: #51098
++ * Fix start field instability
++ * ps.1 fixed Closes: #35137
++
++ -- Craig Small <csmall@debian.org> Tue, 7 Dec 1999 14:42:51 +1100
++
++procps (1:2.0.6-1) unstable; urgency=low
++
++ * New upstream
++ * sysctl crash fixed, Closes: #49015
++ * libproc file descriptor leak fixed, Closes: #45398
++ * False positive System.map mismatches killed, Closes: #49047
++ * Supports 64 Hz for StrongARM/Shark Closes: #47461
++ * pr_time fixed, Closes: #46223
++ * libc num cpu workaround back in, Closes: #49039
++ * Fixed kill manpage, Closes: #47018
++ * This version definitely, absolutely has kill, Closes: #46762
++
++
++ -- Craig Small <csmall@debian.org> Fri, 5 Nov 1999 12:46:05 +1100
++
++procps (1:2.0.3-5) unstable; urgency=low
++
++ * Changed conflicts with replaces
++
++ -- Craig Small <csmall@debian.org> Wed, 6 Oct 1999 14:36:48 +1000
++
++procps (1:2.0.3-4) unstable; urgency=low
++
++ * support SMP systems with versioned kernel modules Closes: #45621, #46465
++ * Added kill to this (it is removed from bsdutils).
++ * We now need kill manpage, Closes: #46004
++
++ -- Craig Small <csmall@debian.org> Tue, 5 Oct 1999 10:28:01 +1000
++
++procps (1:2.0.3-3) unstable; urgency=low
++
++ * System.map support for non-i386 Closes: #45592, #45250
++ * Do not require /proc/ksyms Closes: #45128, #45132, #45619
++ * Alternative w.1 points to the right spot, Closes: #45331
++ * Copyright for skill and snice and ps fixed, Closes: #45119
++
++ -- Craig Small <csmall@debian.org> Tue, 21 Sep 1999 16:31:59 +1000
++
++procps (1:2.0.3-2) unstable; urgency=medium
++
++ * Now with top! Closes: #45106
++
++ -- Craig Small <csmall@debian.org> Wed, 15 Sep 1999 11:12:34 +1000
++
++procps (1:2.0.3-1) unstable; urgency=low
++
++ * New upstream source
++ * Debian personality does m flag Closes: #44832
++ * Corrected typo in top.1 Closes: #44836
++ * New improved watch Closes: #29970
++
++ -- Craig Small <csmall@debian.org> Mon, 13 Sep 1999 16:59:16 +1000
++
++procps (1:2.0.2-4) unstable; urgency=high
++
++ * Fixed the nasty ps formatting problem (Bug #40859 #40856 #40839 )
++
++ -- Craig Small <csmall@debian.org> Wed, 7 Jul 1999 08:41:54 +1000
++
++procps (1:2.0.2-3) unstable; urgency=low
++
++ * New upstream patches/source
++ * SMB Hz wierdness fixed (Bug #33023 #33284)
++ * non-tty output does not get chopped at 80 columns (bug #36688)
++ * BSD personalities set the default selection and output format (bug #36698)
++ * Fixed collumn spacing problem (Bug #35309)
++ * Work around for borken libs that return 0 processors (Bug #36902)
++ * skill now uses process name not command line (Bug #19208)
++
++ -- Craig Small <csmall@debian.org> Mon, 5 Jul 1999 07:29:47 +1000
++
++procps (1:2.0.2-2) unstable; urgency=low
++
++ * Removed kill and manual page (Bug #36421 #36551 #36375)
++ * Put in patch for bogus sysconf return (Bug #36494 #36532 #36581)
++
++ -- Craig Small <csmall@debian.org> Wed, 28 Apr 1999 09:04:59 +1000
++
++procps (1:2.0.2-1) unstable; urgency=low
++
++ * New upstream version (Bug #34394 #27291 #34250 #34956 #35240 #35247
++ #35520 #35756 #34580 )
++
++ -- Craig Small <csmall@debian.org> Mon, 19 Apr 1999 13:26:48 +1000
++
++procps (1:2.0.0-1) unstable; urgency=low
++
++ * New upstream version (Bug #33083 23347 33462 10556 33266 33371 )
++
++
++ -- Craig Small <csmall@debian.org> Mon, 15 Mar 1999 14:21:57 +1100
++
++procps (1:1.9.0-2) unstable; urgency=low
++
++ * top now resumes (Bug #32106 )
++ * debhelper text problem fixed in postinst (Bug #32963 #33122 #33003 33117 )
++ * oldps and ps now use alternatives (Bug #33083 )
++ * ps s format now not ugly (Bug #28266 )
++ * watch command line help and man page correct (Bug #31702 )
++ * sessreg removed from package (Bug #32294 )
++ * ps doesn't display extra spaces (Bug #27799 )
++ * top has spaces in command lines again (Bug #33060 )
++ * ps now has personality (Bug #22923 #18429 )
++ * moved non-free skill and snice to non-free package.
++
++ -- Craig Small <csmall@debian.org> Tue, 9 Feb 1999 15:10:58 +1100
++
++procps (1:1.9.0-1) unstable; urgency=low
++
++ * New Upstream source
++
++ -- Craig Small <csmall@debian.org> Thu, 4 Feb 1999 14:48:37 +1100
++
++procps (1:1.2.9-3) unstable; urgency=low
++
++ * Linked to ncurses4
++
++ -- Craig Small <csmall@debian.org> Fri, 30 Oct 1998 14:13:02 +1100
++
++procps (1:1.2.9-2) unstable; urgency=low
++
++ * top now has spaces in between command lines (Bug #28178 )
++ * --version or -V now shows proper version.
++
++ -- Craig Small <csmall@debian.org> Mon, 26 Oct 1998 08:55:59 +1100
++
++procps (1:1.2.9-1) unstable; urgency=low
++
++ * New upstream version (Bug #27573 )
++ * Menu entry changed from System to Menu/System (Bug #27438 )
++ * Char variables changed to int for powerpc (Bug #26624 )
++ * libproc now nulls allocated structure (Bug #26225 )
++ * No longer uses psdevtab (yay!) (Bug #25388 )
++ * ps doesn't double space command line parameters (Bug #25306 #24293 )
++ * ps now silently ignores g flag for those BSD heads (Bug #24075 )
++
++ -- Craig Small <csmall@debian.org> Fri, 9 Oct 1998 09:15:11 +1000
++
++procps (1:1.2.7-2) unstable; urgency=low
++
++ * Top can suspend twice (or three times even) (Bug #22997 )
++ * Libraries properly built (Bug #20010 )
++
++ -- Craig Small <csmall@debian.org> Mon, 1 Jun 1998 09:16:09 +1000
++
++procps (1:1.2.7-1) frozen unstable; urgency=high
++
++ * New upstream source, fixes security bug (Bug #21475)
++
++ -- Craig Small <csmall@debian.org> Thu, 23 Apr 1998 08:04:54 +1000
++
++procps (1:1.2.6-2) unstable; urgency=low
++
++ * Fixed Shared library dependencies (bugs #18388 #18394 18392 )
++ * Conflicts with earlier versions of w-bassman (bug #18389 )
++
++ -- Craig Small <csmall@debian.org> Mon, 23 Feb 1998 09:05:54 +1100
++
++procps (1:1.2.6-1) unstable; urgency=low
++
++ * New upstream source.
++ * xload is undiverted (Bug #17102 )
++ * ps_fields.7.gz removed (Bug #18090 )
++ * Colour patches removed, color-related bugs gone (Bug #18008 #17217 #18090 )
++ * POSIX patches removed, cmd line bugs gone (Bug #15537 )
++ * w is now an alternative w.procps (Bug #17960 )
++ * skill now works with process names (Bug #17087 )
++ * ps and top man pages have their field descriptions (Bug #17360 )
++ * ps u fixed (Bug #17313 )
++ * Source code is no longer FUBAR (Bug #17892 )
++ * top now redraws screen after config screen (Bug #11896 )
++ * Circular dependency removed (Bug #16966 )
++ * top does mess up screens with wrong cmd line (Bug #17230 )
++ * top suspends with ctrl-Z (Bug #16703 )
++
++ -- Craig Small <csmall@debian.org> Tue, 17 Feb 1998 08:31:21 +1100
++
++procps (1:1.2.5-2) unstable; urgency=low
++
++ * Moved /bin into /bin/ps (Bug #17001 )
++
++ -- Craig Small <csmall@debian.org> Tue, 13 Jan 1998 07:50:43 +1100
++
++procps (1:1.2.5-1) unstable; urgency=low
++
++ * TTY selection works ( #16724 )
++ * top and ps now accept --colour and *_COLOURS
++ * xproc copyright file not compressed ( #14491 )
++ * All #include <proc/*.h> now #include "proc/*.h" ( #13482 )
++ * Copyright doesn't mention psmisc now ( #16704 )
++ * Moved ps back into /bin ( #16737 #16705 )
++ * New upstream source ( #16795 )
++
++ -- Craig Small <csmall@debian.org> Mon, 12 Jan 1998 08:35:10 +1100
++
++procps (1:1.2.2-1) unstable; urgency=low
++
++ * New maintainer
++ * Updated upstream source to 1.2.2 (instead of 1.2)
++ * Merged Helmut's color/command line patches into upstream.
++ * Copyright file is not compressed ( #14493 #14415 )
++ * psdatabase refreshed when installing ( #10693 )
++ * Fixed +/- line in free ( #10785 #10870 #11566 #12027 #12245 #12374 )
++ * w collumns corrected ( #10898 #13117 )
++ * top saves sort type ( #11553 )
++ * Linked to libc6 ( #11725 )
++ * top doesn't coredump with S option ( #11855 )
++ * skill works with given patch ( #12023 )
++ * libproc-dev has proper sym link ( #12697 )
++ * top -h doesn't change terminal settings ( #13513 )
++ * ps -s has "CAUGHT" not "CATCHED" ( #14342 )
++ * ps_colors.7 and ps_fields.7 reformatted ( #14109 #14544 #14545 )
++ * ps checks for tty before using colors ( #14596 )
++ * top sets stop signal handler later, stopping race ( #14769 )
++ * When using POSIX personality, processes show up ( #14780 )
++ * top checks for valid term type ( #15807 )
++ * xproc now Depends on procps-1.2.*-* ( #10762 #13347 )
++ * xproc dependencies fixed ( #12698 )
++
++ -- Craig Small <csmall@debian.org> Tue, 30 Dec 1997 11:33:54 +1100
++
++procps (1.12.2.1) unstable; urgency=low
++
++ * Non-maintainer release, built for libc6.
++ * Added in free.c from new procps version 1.2.3 (from sunsite), seems to
++ fix all the problems with free reporting bogus valus.
++
++ -- Joey Hess <joeyh@master.debian.org> Fri, 24 Oct 1997 13:34:35 -0400
++
++procps (1.12.2) stable unstable; urgency=low
++
++ * fixed meminfo handling again, as the fix wouldn't work on pre-2.1.x
++ kernels.
++ * fixed free to use the meminfo routines from libproc.
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Fri, 13 Jun 1997 22:42:14 +0200
++
++procps (1.12.1) stable unstable; urgency=low
++
++ * fixed several bugs
++ * replaced utmp handling to support wrappers.
++ * added /proc/meminfo support for 2.1.x kernels.
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Tue, 10 Jun 1997 23:59:41 +0200
++
++procps (1.11.6) frozen unstable; urgency=medium
++
++ * psmisc 1.14 : new upstream version (mainly bugfixes)
++ * added a lot of new serial device major numbers to the device lookup
++ code. Somehow it seems there are new serial devices every other week.
++ * fixed a bug in top: broken .toprc may cause a segmentation fault.
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Sun, 4 May 1997 09:50:30 +0200
++
++procps (1.11.5) frozen unstable; urgency=medium
++
++ * minor changes to make it compile with libc6
++ * fix top behaviour on machines having nonstandard NR_TASKS up to 4k
++ tasks
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Fri, 18 Apr 1997 02:07:46 +0200
++
++procps (1.11.4) unstable; urgency=medium
++
++ * strip libproc.so from unneeded symbols (Bug# 8311)
++ * fixed watch.1 example (Bug# 8169)
++ * partly fixed fuser sigsegv core dump (Bug# 8004)
++ * menu entries for xproc and procps (Bug# 8325)
++ * divertions for xmem and xload. (Bug# 7565)
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Sun, 13 Apr 1997 20:55:05 +0200
++
++procps (1.11.3) unstable; urgency=low
++
++ * fixed uptime again, minor Makefile changes
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Fri, 21 Feb 1997 16:22:04 +0100
++
++procps (1.11.2) unstable; urgency=medium
++
++ * fixed typo in ps_fields.7 (Bug#5457)
++ * fixed typo in debian/rules (Bug #5585)
++ * fixed bug in w introduced in 1.11.1 (Bugs #5489, #5694, #5695, #5705).
++ * added support for non-standard serial devices (long overdue - Bug
++ #5771).
++ * fixed uptime option handling (Bug #6099).
++ * fixed top problems with missing/corrupted utmp (Bug #5819).
++ * fixed manpage problems (Bug #5936).
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Wed, 19 Feb 1997 18:49:26 +0100
++
++procps (1.11.1) unstable; urgency=low
++
++ * fixed bug in w <username>
++ * automatic resize if field length is exceeded. This changed the shared
++ library, so popping the major number.
++ * fixed numeric WCHAN output on Alphas and stupid bug in ps (again,
++ thanks to H. Koenig).
++ * fixed top memory statistics for systems with more than 100M memory or
++ swap.
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Tue, 12 Nov 1996 02:57:18 +0100
++
++procps (1.10.1) unstable; urgency=low
++
++ * merged in ALPHA & Sparc patches
++ (from ftp.azstarnet.com:/pub/linux/axp/glibc)
++ * fixed ps --deselect/-N for pid lists
++ * use shared libs from now on, install shlibs again
++ * manpages for libproc
++ * static lib compiled without -fPIC
++ * added libproc package for development installing libproc headers,
++ manpages and static library.
++ * fixed PROC_REAL bug when PROC_FILLSTATUS isn't set.
++ * fixed color bug in ps --forest
++ * added xproc package for xload, xmem, xidle, xcpustate
++ (XConsole left out as we use xconsole & klogd on debian)
++ * adapted xload manpage for xidle and xmem
++ * fixed xmem to cope with newer kernels (where shared pages are counted
++ once for each additional reference)
++ * fixed top change_fields bug (a field needs 24, not 21 spaces)
++ * fixed several Alpha bugs (thanks to Harald Koenig)
++ * due to popular demand, the old format for time intervals is back.
++ for all program using this, a toggle command line option has been
++ provided. The default behaviour depends on the compile time option
++ NEW_TIME_DEFAULT (see main Makefile)
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Wed, 23 Oct 1996 21:30:54 +0200
++
++procps (1.09.2) unstable; urgency=low
++
++ * fixed cpu nice % in summary
++ * fixed topsetup initialisation in top.h I messed up in last revision
++ * fixed pipe output bug
++ * fixed --deselect bug in SVR4/POSIX mode
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Sun, 20 Oct 1996 13:57:11 +0200
++
++procps (1.09.1) unstable; urgency=low
++
++ * fixed ps -w bug displaying too many empty lines
++ * fixed SIGSEGV bug in ps -www
++ * fixed bug in top not calculating length of the command/args/env fields
++ at the field selection screen in some circumstances.
++ * fixed SIGSEGV bug when using environ field
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Sat, 12 Oct 1996 07:59:29 +0200
++
++procps (1.09) experimental; urgency=low
++
++ * This is an experimental release of the procps suite. A lot of features have
++ been added since the 1.01(a) release:
++ - support for both BSD and POSIX (SVR4) style command line options.
++ - completely configurable display of information.
++ - colour markup of processes exceeding limits or belonging to a user.
++ Please take a look at /usr/doc/procps/NEWS and the manpages for a concise
++ list. This is how the next upstream release of procps may look
++ (i.e. it will look like this if there is not too much resistance).
++
++ -- Helmut Geyer <Helmut.Geyer@iwr.uni-heidelberg.de> Sat, 5 Oct 1996 14:26:57 +0200
++
++Local variables:
++mode: debian-changelog
++add-log-mailing-address: "Craig Small <csmall@debian.org>"
++End:
+--- procps-2.0.6.orig/debian/control
++++ procps-2.0.6/debian/control
+@@ -0,0 +1,31 @@
++Source: procps
++Section: base
++Priority: required
++Maintainer: Craig Small <csmall@debian.org>
++Build-Depends: debhelper, libncurses5-dev
++Standards-Version: 3.1.1
++
++Package: procps
++Architecture: any
++Replaces: watch
++Provides: watch
++Depends: ${shlibs:Depends}
++Conflicts: watch, libproc-dev (<< 1:1.2.6-2), w-bassman (<< 1.0-3), procps-nonfree
++Replaces: bsdutils (<< 2.9x-1)
++Recommends: psmisc
++Description: The /proc file system utilities.
++ These are utilities to browse the /proc filesystem, which is not a real file
++ system but a way for the kernel to provide information about the status of
++ entries in its process table. (e.g. running, stopped or "zombie")
++ Both command line and full screen utilities are provided. Ncurses is needed
++ for the full screen utilities.
++
++Package: libproc-dev
++Architecture: any
++Section: devel
++Priority: optional
++Depends: libc6-dev, procps (= ${Source-Version})
++Description: library for accessing process information from /proc
++ These are the header files for libproc. Some packages using libproc
++ to access process information from /proc need these to compile.
++
+--- procps-2.0.6.orig/debian/copyright
++++ procps-2.0.6/debian/copyright
+@@ -0,0 +1,29 @@
++This is the Debian Linux prepackaged version of the /proc file
++system utilities.
++
++This package was downloaded from:
++ http://www.cs.uml.edu/~acahalan/linux/procps-XXXXXX.tar.gz
++
++
++Upstream Author(s):
++Werner Almesberger <almesber@di.epfl.ch>, Roger Binns, Charles
++Blake <cblake@ucsd.edu>, Brian Edmonds, David Engel <david@ods.com>,
++Larry Greenfield <greenfie@gauss.rutgers.edu>, Michael K. Johnson
++<johnsonm@sunsite.unc.edu>, Branko Lankester <lankeste@fwi.uva.nl>,
++Robert Nation <nation@rocket.sanders.lockheed.com>, Michael Shields
++<mjshield@nyx.cs.du.edu>, Henry Ware <al172@yfn.ysu.edu>, Matt
++Welsh <mdw@sunsite.unc.edu> and Albert D. Cahalan
++
++The upstream maintainer of procps is Michael J. Johnson
++<johnsonm@sunsite.unc.edu>.
++
++All programs except ps, skill and snice are copyright by their
++authors and redistributable under the terms of the GNU General
++Public License. On Debian Linux systems, the complete text of
++the GNU General Public License can be found in
++`/usr/share/common-licenses/GPL'.
++
++ps, skill and snice are copyright by their authors and redistributable under
++the terms of the GNU Library General Public License. On Debian Linux
++systems, the complete text of the GNU Library General Public License can
++be found in `/usr/share/common/licenses/LGPL'.
+--- procps-2.0.6.orig/debian/dirs
++++ procps-2.0.6/debian/dirs
+@@ -0,0 +1,11 @@
++etc
++lib
++sbin
++bin
++usr/bin
++usr/sbin
++usr/include/proc
++usr/lib
++usr/share/man/man1
++usr/share/man/man8
++
+--- procps-2.0.6.orig/debian/docs
++++ procps-2.0.6/debian/docs
+@@ -0,0 +1,3 @@
++BUGS
++TODO
++
+--- procps-2.0.6.orig/debian/libproc-dev.dirs
++++ procps-2.0.6/debian/libproc-dev.dirs
+@@ -0,0 +1,2 @@
++usr/lib
++usr/include/proc
+--- procps-2.0.6.orig/debian/libproc-dev.files
++++ procps-2.0.6/debian/libproc-dev.files
+@@ -0,0 +1,12 @@
++usr/lib/libproc.a
++usr/lib/libproc.so
++usr/include/proc/compare.h
++usr/include/proc/devname.h
++usr/include/proc/procps.h
++usr/include/proc/readproc.h
++usr/include/proc/sig.h
++usr/include/proc/status.h
++usr/include/proc/sysinfo.h
++usr/include/proc/tree.h
++usr/include/proc/version.h
++usr/include/proc/whattime.h
+--- procps-2.0.6.orig/debian/menu
++++ procps-2.0.6/debian/menu
+@@ -0,0 +1 @@
++?package(procps):needs=text section="Apps/System" title="Top" command="/usr/bin/top"
+--- procps-2.0.6.orig/debian/postinst
++++ procps-2.0.6/debian/postinst
+@@ -0,0 +1,29 @@
++#!/bin/sh
++set -e
++
++if [ -e /etc/psdevtab ] ; then
++ rm -f /etc/psdevtab
++fi
++if [ -e /etc/psdatabase ]
++then
++ rm -f /etc/psdatabase
++fi
++# Remove old /etc/init.d/procps file, Bug #53818
++if [ -e /etc/init.d/procps ]
++then
++ rm -f /etc/init.d/procps
++fi
++# Remove old procps init.d script, if it exists Closes: #55137
++if [ -e /etc/rcS.d/S30procps ]
++then
++ update-rc.d procps remove >/dev/null
++fi
++
++#
++# Now to do the alternatives for w and ps
++update-alternatives --install /usr/bin/w w /usr/bin/w.procps 50 \
++ --slave /usr/share/man/man1/w.1.gz w.1.gz /usr/share/man/man1/w.procps.1.gz
++
++ldconfig
++
++#DEBHELPER#
+--- procps-2.0.6.orig/debian/prerm
++++ procps-2.0.6/debian/prerm
+@@ -0,0 +1,11 @@
++#!/bin/sh
++
++if [ "$1" != "upgrade" ]
++then
++ update-alternatives --remove w /usr/bin/w.procps
++fi
++
++#DEBHELPER#
++
++exit 0
++
+--- procps-2.0.6.orig/debian/procps.shlibs.local
++++ procps-2.0.6/debian/procps.shlibs.local
+@@ -0,0 +1 @@
++libproc 2.0.6
+--- procps-2.0.6.orig/debian/shlibs.local
++++ procps-2.0.6/debian/shlibs.local
+@@ -0,0 +1 @@
++libproc 2.0.6 procps (>> 1:2.0.6-0), procps (<< 1:2.0.7-0)
+--- procps-2.0.6.orig/debian/watch
++++ procps-2.0.6/debian/watch
+@@ -0,0 +1,6 @@
++# Example watch control file for uscan
++# Rename this file to "watch" and then you can run the "uscan" command
++# to check for upstream updates and more.
++# Site Directory Pattern Version Script
++sunsite.unc.edu /pub/Linux/Incoming procps-*.tar.gz debian uupdate
++
+--- procps-2.0.6.orig/debian/sysctl.conf
++++ procps-2.0.6/debian/sysctl.conf
+@@ -0,0 +1,6 @@
++#
++# /etc/sysctl.conf - Configuration file for setting system variables
++# See sysctl.conf (5) for information.
++#
++#kernel.domainname = example.com
++#net/ipv4/icmp_echo_ignore_broadcasts=1
+--- procps-2.0.6.orig/debian/examples
++++ procps-2.0.6/debian/examples
+@@ -0,0 +1,2 @@
++debian/sysctl.conf
++
+--- procps-2.0.6.orig/debian/conffiles
++++ procps-2.0.6/debian/conffiles
+@@ -0,0 +1,2 @@
++/etc/sysctl.conf
++/etc/init.d/procps.sh
diff --git a/sys-apps/procps/files/procps-2.0.7.diff b/sys-apps/procps/files/procps-2.0.7.diff
new file mode 100644
index 000000000000..47ffca287d1e
--- /dev/null
+++ b/sys-apps/procps/files/procps-2.0.7.diff
@@ -0,0 +1,321 @@
+diff -r -U3 procps-2.0.7.orig/Makefile procps-2.0.7/Makefile
+--- procps-2.0.7.orig/Makefile Thu Jul 13 22:22:58 2000
++++ procps-2.0.7/Makefile Mon Feb 19 16:27:20 2001
+@@ -4,7 +4,7 @@
+ export PREFIX = #proc# prefix for program names
+
+ export DESTDIR = /
+-export MANDIR = /usr/man
++export MANDIR = /usr/share/man
+ export MAN1DIR = $(DESTDIR)$(MANDIR)/man1
+ export MAN5DIR = $(DESTDIR)$(MANDIR)/man5
+ export MAN8DIR = $(DESTDIR)$(MANDIR)/man8
+@@ -48,7 +48,7 @@
+
+ #BFD_CAPABLE = -DBFD_CAPABLE
+ #AOUT_CAPABLE = #-DAOUT_CAPABLE
+-#ELF_CAPABLE = #-DELF_CAPABLE
++ELF_CAPABLE = -DELF_CAPABLE
+
+ #LIBBFD = -lbfd -liberty
+ LIBCURSES = -lncurses# watch is the only thing that needs this
+diff -r -U3 procps-2.0.7.orig/proc/readproc.c procps-2.0.7/proc/readproc.c
+--- procps-2.0.7.orig/proc/readproc.c Mon Jul 10 21:55:39 2000
++++ procps-2.0.7/proc/readproc.c Mon Feb 19 16:27:20 2001
+@@ -25,7 +25,7 @@
+ */
+ PROCTAB* openproc(int flags, ...) {
+ va_list ap;
+- PROCTAB* PT = xmalloc(sizeof(PROCTAB));
++ PROCTAB* PT = xcalloc(NULL, sizeof(PROCTAB));
+
+ if (Do(PID))
+ PT->procfs = NULL;
+diff -r -U3 procps-2.0.7.orig/proc/sysinfo.c procps-2.0.7/proc/sysinfo.c
+--- procps-2.0.7.orig/proc/sysinfo.c Mon Jul 10 21:36:13 2000
++++ procps-2.0.7/proc/sysinfo.c Mon Feb 19 16:27:20 2001
+@@ -18,6 +18,10 @@
+ #include <fcntl.h>
+ #include "proc/version.h"
+
++#ifndef HZ
++#include <netinet/in.h> /* htons */
++#endif
++
+ #define BAD_OPEN_MESSAGE \
+ "Error: /proc must be mounted\n" \
+ " To mount /proc at boot you need an /etc/fstab line like:\n" \
+@@ -139,7 +143,7 @@
+ #ifdef HZ
+ Hertz = (unsigned long)HZ; /* <asm/param.h> */
+ #else
+- Hertz = (sizeof(long)==sizeof(int)) ? 100UL : 1024UL;
++ Hertz = (sizeof(long)==sizeof(int) || htons(999)==999) ? 100UL : 1024UL;
+ #endif
+ #if 0 /* This ends up causing more harm than good. :-( */
+ fprintf(stderr, "Unknown HZ value! (%ld) Assume %ld.\n", h, Hertz);
+@@ -217,7 +221,7 @@
+ for (i=0; i < MAX_ROW && *p; i++) { /* loop over rows */
+ while(*p && !isdigit(*p)) p++; /* skip chars until a digit */
+ for (j=0; j < MAX_COL && *p; j++) { /* scanf column-by-column */
+- l = sscanf(p, "%u%n", row[i] + j, &k);
++ l = sscanf(p, "%llu%n", row[i] + j, &k);
+ p += k; /* step over used buffer */
+ if (*p == '\n' || l < 1) /* end of line/buffer */
+ break;
+@@ -280,7 +284,7 @@
+
+ /**************************************************************************
+ * shorthand for read_table("/proc/meminfo")[meminfo_main][meminfo_total] */
+-unsigned read_total_main(void) {
++unsigned long long read_total_main(void) {
+ unsigned long long** mem;
+ return (mem = meminfo()) ? mem[meminfo_main][meminfo_total] : -1;
+ }
+diff -r -U3 procps-2.0.7.orig/proc/sysinfo.h procps-2.0.7/proc/sysinfo.h
+--- procps-2.0.7.orig/proc/sysinfo.h Tue Nov 2 16:44:58 1999
++++ procps-2.0.7/proc/sysinfo.h Mon Feb 19 16:27:20 2001
+@@ -2,6 +2,7 @@
+ #define SYSINFO_H
+
+ extern unsigned long Hertz; /* clock tick frequency */
++extern long smp_num_cpus;
+
+ #define JT unsigned long
+ extern int four_cpu_numbers(JT *uret, JT *nret, JT *sret, JT *iret);
+@@ -18,6 +19,6 @@
+ meminfo_shared, meminfo_buffers, meminfo_cached
+ };
+
+-extern unsigned read_total_main(void);
++extern unsigned long long read_total_main(void);
+
+ #endif /* SYSINFO_H */
+diff -r -U3 procps-2.0.7.orig/ps/global.c procps-2.0.7/ps/global.c
+--- procps-2.0.7.orig/ps/global.c Fri Nov 5 00:56:29 1999
++++ procps-2.0.7/ps/global.c Mon Feb 19 16:27:20 2001
+@@ -109,6 +109,7 @@
+ screen_cols = 80;
+ screen_rows = 24;
+ }
++ if(!isatty(STDOUT_FILENO)) screen_cols = OUTBUF_SIZE;
+ columns = getenv("COLUMNS");
+ if(columns && *columns){
+ long t;
+diff -r -U3 procps-2.0.7.orig/ps/output.c procps-2.0.7/ps/output.c
+--- procps-2.0.7.orig/ps/output.c Tue Jul 11 20:37:46 2000
++++ procps-2.0.7/ps/output.c Mon Feb 19 16:27:20 2001
+@@ -876,7 +876,7 @@
+ /* temporary hack -- mark new stuff grabbed from Debian ps */
+ #define LNx LNX
+
+-/* there are about 194 listed */
++/* there are about 195 listed */
+
+ /* Many of these are placeholders for unsupported options. */
+ static const format_struct format_array[] = {
+@@ -886,6 +886,7 @@
+ {"acflag", "ACFLG", pr_nop, sr_nop, 5, 0, XXX, RIGHT}, /*acflg*/
+ {"acflg", "ACFLG", pr_nop, sr_nop, 5, 0, BSD, RIGHT}, /*acflag*/
+ {"addr", "ADDR", pr_nop, sr_nop, 4, 0, XXX, RIGHT},
++{"addr1", "ADDR", pr_nop, sr_nop, 1, 0, LNX, LEFT},
+ {"alarm", "ALARM", pr_alarm, sr_it_real_value, 5, 0, LNX, RIGHT},
+ {"argc", "ARGC", pr_nop, sr_nop, 4, 0, LNX, RIGHT},
+ {"args", "COMMAND", pr_args, sr_nop, 16, 0, U98, UNLIMITED}, /*command*/
+diff -r -U3 procps-2.0.7.orig/ps/parser.c procps-2.0.7/ps/parser.c
+--- procps-2.0.7.orig/ps/parser.c Fri Nov 5 01:16:13 1999
++++ procps-2.0.7/ps/parser.c Mon Feb 19 16:27:20 2001
+@@ -80,6 +80,7 @@
+ if(*endp != '\0') return pidsyntax;
+ if(num>0x7fff) return pidrange; /* Linux PID limit */
+ if(num<0) return pidrange;
++ if(num<1) return pidrange;
+ ret->pid = num;
+ return 0;
+ }
+@@ -549,7 +550,7 @@
+ trace("a Select all w/tty, including other users\n");
+ /* Now the PER_SUN_MUTATE_a flag is handled elsewhere. */
+ /* if(personality & PER_SUN_MUTATE_a) simple_select |= SS_U_a;
+- else */ simple_select |= SS_B_a;
++ simple_select |= SS_B_a;
+ break;
+ case 'c':
+ trace("c true command name\n");
+diff -r -U3 procps-2.0.7.orig/ps/select.c procps-2.0.7/ps/select.c
+--- procps-2.0.7.orig/ps/select.c Fri Mar 12 11:34:44 1999
++++ procps-2.0.7/ps/select.c Mon Feb 19 16:27:20 2001
+@@ -29,23 +29,26 @@
+
+ /***** prepare select_bits for use */
+ const char *select_bits_setup(void){
+- if(!simple_select){ /* don't want a 'g' added to this (or do we?) */
+- select_bits = 0xaa00;
++ int switch_val = 0;
++ if(!simple_select && !prefer_bsd){ /* don't want a 'g' added to this (or do we?) */
++ select_bits = 0xa0a0;
+ return NULL;
+ }
+- /* For everybody but Sun, the 'g' option is a NOP */
++ /* For everybody but Sun, the 'g' option is a NOP (enabled by default)*/
+ if( !(personality & PER_SUN_MUTATE_a) && !(simple_select&(SS_U_a|SS_U_d)) )
+- simple_select |= SS_B_g;
+- switch(simple_select){
+- case SS_U_a | SS_U_d:
+- case SS_B_x | SS_B_a:
+- case SS_U_d: select_bits = 0x3333; break;
++ switch_val = simple_select|SS_B_g;
++ else
++ switch_val = simple_select;
++ switch(switch_val){
++ case SS_U_a | SS_U_d: select_bits = 0x3f3f; break;
+ case SS_U_a: select_bits = 0x0303; break;
+- case SS_B_a: select_bits = 0x3300; break;
+- case SS_B_x : select_bits = 0x2222; break;
+- case SS_B_g : select_bits = 0xaa00; break;
+- case SS_B_g | SS_B_a: select_bits = 0x0f00; break;
+- case SS_B_g | SS_B_x : select_bits = 0xaaaa; break;
++ case SS_U_d: select_bits = 0x3333; break;
++ case 0: select_bits = 0x0202; break;
++ case SS_B_x: select_bits = 0x2222; break;
++ case SS_B_x | SS_B_a: select_bits = 0x3333; break;
++ case SS_B_g: select_bits = 0x0a0a; break;
++ case SS_B_g | SS_B_a: select_bits = 0x0f0f; break;
++ case SS_B_g | SS_B_x: select_bits = 0xaaaa; break;
+ case SS_B_g | SS_B_x | SS_B_a:
+ all_processes = 1;
+ simple_select = 0;
+@@ -67,39 +70,6 @@
+ return (select_bits & (1<<proc_index));
+ }
+
+-#if 0
+-/***** selected by simple option? */
+-static int table_accept(proc_t *buf){
+- unsigned proc_index;
+-#ifdef ACT_LIKE_SUNOS4
+- static unsigned table[] = {
+- 0xfffffff0, 0xfffffff0, 0xccccccc0, 0xccccccc0, /* process has some other tty */
+- 0xfafafaf0, 0xfafafafa, 0xc8c8c8c0, 0xc8c8c8c8, /* no tty, ps itself has one */
+- 0xfffffff0, 0xffffffff, 0xccccccc0, 0xcccccccc, /* process has same tty as ps */
+- 0xfafafaf0, 0xfafafafa, 0xc8c8c8c0, 0xc8c8c8c8 /* nobody has a tty */
+- };
+-#else
+- static unsigned table[] = {
+- 0xfffffff0, 0xfffffff0, 0xffffccc0, 0xffffccc0, /* process has some other tty */
+- 0xfafafaf0, 0xfafafafa, 0xfafac8c0, 0xfafac8c8, /* no tty, ps itself has one */
+- 0xfffffff0, 0xffffffff, 0xffffccc0, 0xffffcccc, /* process has same tty as ps */
+- 0xfafafaf0, 0xfafafafa, 0xfafac8c0, 0xfafac8c8 /* nobody has a tty */
+- };
+-#endif
+- proc_index = (has_our_euid(buf) <<0)
+- | (session_leader(buf) <<1)
+- | (without_a_tty(buf) <<2)
+- | (on_our_tty(buf) <<3);
+-/*
+- printf("0x%08x 0x%08x 0x%08x %-8.8s\n",
+- table[proc_index],
+- (1<<simple_select),
+- table[proc_index] & (1<<simple_select),
+- buf->cmd);
+-*/
+- return (table[proc_index] & (1<<simple_select));
+-}
+-#endif
+
+ /***** selected by some kind of list? */
+ static int proc_was_listed(proc_t *buf){
+diff -r -U3 procps-2.0.7.orig/ps/sortformat.c procps-2.0.7/ps/sortformat.c
+--- procps-2.0.7.orig/ps/sortformat.c Mon Jul 10 23:25:30 2000
++++ procps-2.0.7/ps/sortformat.c Mon Feb 19 16:27:20 2001
+@@ -667,11 +667,9 @@
+ format_list=fn;
+ }
+ PUSH("sz");
+- }
+- if(format_flags & FF_Ul){
+ if(format_modifiers & FM_y) PUSH("rss");
+ else if(personality & (PER_ZAP_ADDR|PER_IRIX_l)) PUSH("sgi_p");
+- else PUSH("addr");
++ else PUSH("addr_1");
+ }
+ if(format_modifiers & FM_c){
+ PUSH("pri"); PUSH("class");
+diff -r -U3 procps-2.0.7.orig/top.c procps-2.0.7/top.c
+--- procps-2.0.7.orig/top.c Thu Jul 13 22:19:21 2000
++++ procps-2.0.7/top.c Mon Feb 19 16:27:48 2001
+@@ -153,7 +153,7 @@
+ break;
+ case 'S':
+ Cumulative = 1;
+- headers[22][1] = 'C';
++ headers[22] = TOPHDR_CTIME;
+ break;
+ case 's':
+ Secure = 1;
+@@ -795,7 +795,7 @@
+ void show_fields(void)
+ {
+ int i, row, col;
+- char *p;
++ const char *p;
+
+ clear_screen();
+ PUTP(tgoto(cm, 3, 0));
+@@ -1690,9 +1690,9 @@
+ Cumulative = !Cumulative;
+ SHOWMESSAGE(("Cumulative mode %s", Cumulative ? "on" : "off"));
+ if (Cumulative)
+- headers[22][1] = 'C';
++ headers[22] = TOPHDR_CTIME;
+ else
+- headers[22][1] = ' ';
++ headers[22] = TOPHDR_TIME;
+ Numfields = make_header();
+ break;
+ case 's':
+diff -r -U3 procps-2.0.7.orig/top.h procps-2.0.7/top.h
+--- procps-2.0.7.orig/top.h Thu Jul 13 22:19:22 2000
++++ procps-2.0.7/top.h Mon Feb 19 16:27:46 2001
+@@ -130,8 +130,12 @@
+ P_WCHAN, P_STAT, P_TIME, P_COMMAND,
+ P_LCPU, P_FLAGS, P_END
+ };
++
++#define TOPHDR_TIME " TIME "
++#define TOPHDR_CTIME " CTIME "
++
+ /* corresponding headers */
+-char *headers[] =
++const char *headers[] =
+ {
+ " PID ", " PPID ", " UID ",
+ "USER ", "%CPU ", "%MEM ",
+@@ -140,12 +144,12 @@
+ " SIZE ", " TRS ", "SWAP ",
+ "SHARE ", " A ", " WP ",
+ " D ", " RSS ", "WCHAN ",
+- "STAT ", " TIME ", "COMMAND",
++ "STAT ", TOPHDR_TIME , "COMMAND",
+ "LC ",
+ " FLAGS "
+ };
+ /* corresponding field desciptions */
+-char *headers2[] =
++const char *headers2[] =
+ {
+ "Process Id", "Parent Process Id", "User Id",
+ "User Name", "CPU Usage", "Memory Usage",
+diff -r -U3 procps-2.0.7.orig/watch.c procps-2.0.7/watch.c
+--- procps-2.0.7.orig/watch.c Mon Jul 10 22:50:02 2000
++++ procps-2.0.7/watch.c Mon Feb 19 16:27:20 2001
+@@ -15,8 +15,8 @@
+
+ #include <ctype.h>
+ #include <getopt.h>
+-#include <signal.h>
+ #include <ncurses.h>
++#include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>