summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gottinger <achim@gentoo.org>2001-05-16 23:22:10 +0000
committerAchim Gottinger <achim@gentoo.org>2001-05-16 23:22:10 +0000
commit22917afd99713294b3247b48162c24fdae9346aa (patch)
tree2244168f7e3f92272bf531ffd366c1d3f4ad8cad /sys-apps/procps/files
parent*** empty log message *** (diff)
downloadhistorical-22917afd99713294b3247b48162c24fdae9346aa.tar.gz
historical-22917afd99713294b3247b48162c24fdae9346aa.tar.bz2
historical-22917afd99713294b3247b48162c24fdae9346aa.zip
Missing patch
Diffstat (limited to 'sys-apps/procps/files')
-rw-r--r--sys-apps/procps/files/procps-2.0.6-r1.diff611
1 files changed, 611 insertions, 0 deletions
diff --git a/sys-apps/procps/files/procps-2.0.6-r1.diff b/sys-apps/procps/files/procps-2.0.6-r1.diff
new file mode 100644
index 000000000000..6bdc72d1cfb6
--- /dev/null
+++ b/sys-apps/procps/files/procps-2.0.6-r1.diff
@@ -0,0 +1,611 @@
+--- kill.1
++++ kill.1 2000/02/25 09:50:06
+@@ -1,8 +1,10 @@
++'\" t
+ .\" Man page for kill.
+ .\" 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"
++.UC 1
+ .SH NAME
+ kill \- report process status
+
+@@ -30,7 +32,6 @@
+ lB rB lB lB
+ lfCW r l l.
+ Name Num Action Description
+-.TH
+ ALRM 14 exit
+ HUP 1 exit
+ INT 2 exit
+--- Makefile
++++ Makefile 2000/02/25 09:50:06
+@@ -4,8 +4,9 @@
+ PREFIX = #proc# prefix for program names
+
+ DESTDIR = /
+-MAN1DIR = ${DESTDIR}/usr/man/man1
+-MAN8DIR = ${DESTDIR}/usr/man/man8
++MAN1DIR = ${DESTDIR}/usr/share/man/man1
++MAN5DIR = ${DESTDIR}/usr/share/man/man5
++MAN8DIR = ${DESTDIR}/usr/share/man/man8
+ BINDIR = ${DESTDIR}/bin
+ SBINDIR = ${DESTDIR}/sbin
+ XBINDIR = ${DESTDIR}/usr/X11R6/bin
+@@ -18,6 +19,7 @@
+ UPROG = oldps uptime tload free w top vmstat watch skill snice # -> USRBINDIR
+ SPROG = sysctl
+ MAN1 = oldps.1 uptime.1 tload.1 free.1 w.1 top.1 watch.1 skill.1 kill.1 snice.1
++MAN5 = sysctl.conf.5
+ MAN8 = vmstat.8 sysctl.8 # psupdate.8
+ XSCPT = XConsole # -> XBINDIR
+
+@@ -26,14 +28,14 @@
+ # easy to command-line override
+ INCDIRS = -I/usr/include/ncurses -I/usr/X11R6/include
+
+-CC = gcc -O3 $(INCDIRS) -D_GNU_SOURCE#-ggdb
++CC = gcc -O2 $(INCDIRS) -D_GNU_SOURCE -pipe#-ggdb
+ CFLAGS = -I. -Wall -Wno-unused
+
+-OPT = -O3
++OPT = -O2
+ CC = gcc #-ggdb
+ CFLAGS = -D_GNU_SOURCE $(OPT) -I. $(INCDIRS) -Wall -Wno-unused
+
+-SHARED = 1# build/install both a static and ELF shared library
++SHARED = #1# build/install both a static and ELF shared library
+ SHLIBDIR = ${DESTDIR}/lib# where to install the shared library
+
+ LDFLAGS = -Wl,-warn-common #-s recommended for ELF systems
+@@ -44,6 +46,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
+@@ -64,7 +67,7 @@
+ all: $(BUILD)
+
+ # INSTALL PROGRAMS + DOCS
+-install: $(patsubst %,install_%,$(BUILD) $(XSCPT) $(MAN1) $(MAN8))
++install: $(patsubst %,install_%,$(BUILD) $(XSCPT) $(MAN1) $(MAN5) $(MAN8))
+ ifeq ($(SHARED),1)
+ install --owner 0 --group 0 --mode a=rx $(LIB_TGT) $(SHLIBDIR)
+ endif
+@@ -177,12 +180,15 @@
+ $(INSTALLSCT) $< $(XBINDIR)/$(PREFIX)$<
+ $(patsubst %,install_%,$(MAN1)) : install_%: %
+ $(INSTALLMAN) $< $(MAN1DIR)/$(PREFIX)$<
++$(patsubst %,install_%,$(MAN5)) : install_%: %
++ $(INSTALLMAN) $< $(MAN5DIR)/$(PREFIX)$<
+ $(patsubst %,install_%,$(MAN8)) : install_%: %
+ $(INSTALLMAN) $< $(MAN8DIR)/$(PREFIX)$<
+
+ # special case install rules
+ install_snice: snice install_skill
+ cd $(USRBINDIR) && ln -f skill snice
++
+ install_kill: snice install_skill
+ cd $(USRBINDIR) && ln -f skill kill
+
+--- proc/ksym.c
++++ proc/ksym.c 2000/02/25 09:50:06
+@@ -80,7 +80,7 @@
+ /****************************************/
+
+ /* Try to open and mmap a single symbol table file and initialize globals */
+-int sysmap_mmap(const char *path) {
++static int sysmap_mmap(const char *path, int warn) {
+ int fd;
+ struct stat sbuf;
+ char *p;
+@@ -124,7 +124,8 @@
+ char Version[32];
+ sprintf(Version, " Version_%d\n", linux_version_code);
+ if(strstr(sysmap, Version)) break;
+- fprintf(stderr, "Warning: %s has an incorrect kernel version.\n", path);
++ if (warn)
++ fprintf(stderr, "Warning: %s has an incorrect kernel version.\n", path);
+ munmap(sysmap, sysmap_len);
+ sysmap = NULL;
+ return 0;
+@@ -199,16 +200,16 @@
+ }
+ uname(&uts);
+ if(override){ /* ought to search some path */
+- if(sysmap_mmap(override)) return 0;
++ if(sysmap_mmap(override, 1)) return 0;
+ return -1; /* ought to return "Namelist not found." */
+ /* failure is better than ignoring the user & using bad data */
+ }
+ /* Arrrgh, the old man page and code did not match. */
+- if ((env = getenv("PS_SYSMAP")) && sysmap_mmap(env)) return 0;
+- if ((env = getenv("PS_SYSTEM_MAP")) && sysmap_mmap(env)) return 0;
++ if ((env = getenv("PS_SYSMAP")) && sysmap_mmap(env, 1)) return 0;
++ if ((env = getenv("PS_SYSTEM_MAP")) && sysmap_mmap(env, 1)) return 0;
+ for (fmt = sysmap_paths; *fmt; fmt++) {
+ snprintf(path, sizeof path, *fmt, uts.release);
+- if (sysmap_mmap(path)) return 0;
++ if (sysmap_mmap(path, ((*fmt)+1 == 0 ? 1 : 0))) return 0;
+ }
+ #if 0
+ for (fmt = psdb_paths; *fmt; fmt++) {
+--- proc/readproc.c
++++ proc/readproc.c 2000/02/25 09:50:06
+@@ -25,8 +25,8 @@
+ */
+ PROCTAB* openproc(int flags, ...) {
+ va_list ap;
+- PROCTAB* PT = xmalloc(sizeof(PROCTAB));
+-
++ PROCTAB* PT = xcalloc(NULL, sizeof(PROCTAB));
++
+ if (Do(PID))
+ PT->procfs = NULL;
+ else if (!(PT->procfs = opendir("/proc")))
+--- proc/sysinfo.c
++++ proc/sysinfo.c 2000/02/25 09:50:06
+@@ -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" \
+@@ -44,7 +48,7 @@
+ if (fd == -1 && (fd = open(filename, O_RDONLY)) == -1) { \
+ fprintf(stderr, BAD_OPEN_MESSAGE); \
+ close(fd); \
+- _exit(0); \
++ _exit(1); \
+ } \
+ lseek(fd, 0L, SEEK_SET); \
+ if ((n = read(fd, buf, sizeof buf - 1)) < 0) { \
+@@ -104,6 +108,7 @@
+ double up_1, up_2, seconds;
+ unsigned long jiffies, h;
+ int i = 0;
++
+ do{
+ FILE_TO_BUF(UPTIME_FILE,uptime_fd); sscanf(buf, "%lf", &up_1);
+ /* uptime(&up_1, NULL); */
+@@ -135,7 +140,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
+ fprintf(stderr, "Unknown HZ value! (%ld) Assume %ld.\n", h, Hertz);
+ }
+@@ -211,7 +216,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;
+@@ -274,7 +279,7 @@
+
+ /**************************************************************************
+ * shorthand for read_table("/proc/meminfo")[meminfo_main][meminfo_total] */
+-unsigned read_total_main(void) {
+- unsigned** mem;
++unsigned long long read_total_main(void) {
++ unsigned long long ** mem;
+ return (mem = meminfo()) ? mem[meminfo_main][meminfo_total] : -1;
+ }
+--- proc/sysinfo.h
++++ proc/sysinfo.h 2000/02/25 09:50:06
+@@ -2,6 +2,7 @@
+ #define SYSINFO_H
+
+ extern unsigned long Hertz; /* clock tick frequency */
++extern long smp_num_cpus; /* number of 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 */
+--- ps/global.c
++++ ps/global.c 2000/02/25 09:50:06
+@@ -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;
+--- ps/Makefile
++++ ps/Makefile 2000/02/25 09:50:06
+@@ -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
+
+--- ps/output.c
++++ ps/output.c 2000/02/25 09:50:06
+@@ -888,7 +888,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[] = {
+@@ -898,6 +898,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},
++{"addr_1", "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*/
+--- ps/parser.c
++++ ps/parser.c 2000/02/25 09:50:06
+@@ -79,7 +79,7 @@
+ num = strtol(str, &endp, 0);
+ 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;
+ }
+@@ -547,9 +547,7 @@
+ break;
+ case 'a':
+ 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");
+--- ps/ps.1
++++ ps/ps.1 2000/02/25 09:50:06
+@@ -1,9 +1,11 @@
++'\" t
+ .\" Man page for ps.
+ .\" Licensed under version 2 of the GNU General Public License.
+ .\" Modified by Michael K. Johnson from a gross plain-text hack
+ .\" by Albert Cahalan of Michael's original version.
+ .\"
+ .TH PS 1 "March 11, 1999" "Linux" "Linux User's Manual"
++.UC 1
+ .SH NAME
+ ps \- report process status
+ .SH SYNOPSIS
+@@ -38,7 +40,6 @@
+ lB lB
+ lfCW l.
+ Switch Description
+-.TH
+ -A selects all processes
+ -N negate selection
+ -a select all with a tty except session leaders
+@@ -61,7 +62,6 @@
+ lB lB
+ lfCW l.
+ Switch Description
+-.TH
+ -C Select by command name
+ -G select by RGID (supports names)
+ -U select by RUID (supports names)
+@@ -89,7 +89,6 @@
+ lB lB
+ lfCW l.
+ Switch Description
+-.TH
+ -O is preloaded "-o"
+ -c different scheduler info for -l option
+ -f does full listing
+@@ -113,7 +112,6 @@
+ lB lB
+ lfCW l.
+ Switch Description
+-.TH
+ -H show process heirarchy (forest)
+ -m shows threads
+ -n sets namelist file
+@@ -156,7 +154,6 @@
+ lB lB
+ lfCW l.
+ Switch Description
+-.TH
+ -V prints version
+ L List all format specifiers
+ V show version info
+@@ -170,7 +167,6 @@
+ lB lB
+ lfCW l.
+ Switch Description
+-.TH
+ 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)
+@@ -309,7 +305,6 @@
+ lB lB lB
+ lfCW lfCW l.
+ KEY LONG DESCRIPTION
+-.TH
+ c cmd simple name of executable
+ C cmdline full command line
+ f flags flags as in long format F field
+@@ -348,7 +343,6 @@
+ lB lB lB
+ lfCW lfCW l.
+ CODE NORMAL HEADER
+-.TH
+ %C pcpu %CPU
+ %G group GROUP
+ %P ppid PPID
+@@ -376,7 +370,6 @@
+ lB lB
+ lfCW lfCW.
+ CODE HEADER
+-.TH
+ %cpu %CPU
+ %mem %MEM
+ alarm ALARM
+@@ -524,7 +517,6 @@
+ lfCW lb
+ lfCW l.
+ PS_PERSONALITY Description
+-.TH
+ \fInone\fP "Do the right thing"
+ aix like AIX ps
+ bsd like FreeBSD ps
+--- ps/select.c
++++ ps/select.c 2000/02/25 09:50:06
+@@ -29,24 +29,32 @@
+
+ /***** 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;
++ /* don't want a 'g' screwing up simple_select */
++ if(!simple_select && !prefer_bsd){
++ select_bits = 0x0a0a; /* the STANDARD selection */
+ return NULL;
+ }
+- /* For everybody but Sun, the 'g' option is a NOP */
++ /* For every BSD but SunOS, 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:
++ switch_val = simple_select|SS_B_g;
++ else
++ switch_val = simple_select;
++ switch(switch_val){
++ /* UNIX options */
++ case SS_U_a | SS_U_d: select_bits = 0x3f3f; break; /* 3333 or 3f3f */
++ case SS_U_a: select_bits = 0x0303; break; /* 0303 or 0f0f */
+ case SS_U_d: select_bits = 0x3333; break;
+- case SS_U_a: select_bits = 0x0303; break;
+- case SS_B_a: select_bits = 0x3300; break;
++ /* SunOS 4 only (others have 'g' enabled all the time) */
++ case 0: select_bits = 0x0202; break;
++ case SS_B_a: select_bits = 0x0303; 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_x | SS_B_a: select_bits = 0x3333; break;
++ /* General BSD options */
++ 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:
++ case SS_B_g | SS_B_x | SS_B_a: /* convert to -e instead of using 0xffff */
+ all_processes = 1;
+ simple_select = 0;
+ break;
+@@ -66,40 +74,6 @@
+ | (on_our_tty(buf) <<3);
+ 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){
+--- ps/sortformat.c
++++ ps/sortformat.c 2000/02/25 09:50:06
+@@ -650,8 +650,8 @@
+ }
+ PUSH("tname"); /* Unix98 says "TTY" here, yet "tty" produces "TT". */
+ if(format_flags & FF_Uf) PUSH("stime");
+- if(format_flags & FF_Ul) PUSH("wchan");
+ if(format_flags & FF_Ul){
++ PUSH("wchan");
+ if(personality & PER_IRIX_l){ /* add "rss" then ':' here */
+ PUSH("sgi_rss");
+ fn = malloc(sizeof(format_node));
+@@ -666,11 +666,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");
+--- skill.1
++++ skill.1 2000/02/25 09:50:06
+@@ -1,9 +1,11 @@
++'\" t
+ .\" Man page for skill and snice.
+ .\" Licensed under version 2 of the GNU General Public License.
+ .\" Written by Albert Cahalan, converted to a man page by
+ .\" Michael K. Johnson
+ .\"
+ .TH SKILL 1 "March 12, 1999" "Linux" "Linux User's Manual"
++.UC 1
+ .SH NAME
+ skill, snice \- report process status
+
+@@ -54,7 +56,6 @@
+ lB rB lB lB
+ lfCW r l l.
+ Name Num Action Description
+-.TH
+ ALRM 14 exit
+ HUP 1 exit
+ INT 2 exit
+--- sysctl.8
++++ sysctl.8 2000/02/25 09:50:06
+@@ -7,6 +7,7 @@
+ .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ .\" GNU General Public License for more details."
+ .TH SYSCTL 8 "21 Sep 1999" "" ""
++.UC 8
+ .SH NAME
+ sysctl \- configure kernel parameters at runtime
+ .SH SYNOPSIS
+--- sysctl.conf.5
++++ sysctl.conf.5 2000/02/25 09:50:06
+@@ -7,6 +7,7 @@
+ .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ .\" GNU General Public License for more details."
+ .TH SYSCTL.CONF 5 "21 Sep 1999" "" ""
++.UC 5
+ .SH NAME
+ sysctl.conf \- sysctl(8) preload/configuration file
+ .SH DESCRIPTION
+--- top.c
++++ top.c 2000/02/25 09:50:06
+@@ -142,7 +142,7 @@
+ break;
+ case 'S':
+ Cumulative = 1;
+- headers[22][1] = 'C';
++ headers[22] = TOPHDR_CTIME;
+ break;
+ case 's':
+ Secure = 1;
+@@ -748,7 +748,7 @@
+ void show_fields(void)
+ {
+ int i, row, col;
+- char *p;
++ const char *p;
+
+ clear_screen();
+ PUTP(tgoto(cm, 3, 0));
+@@ -1540,9 +1540,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':
+--- top.h
++++ top.h 2000/02/25 09:50:06
+@@ -126,8 +126,12 @@
+ P_WCHAN, P_STAT, P_TIME, P_COMMAND,
+ P_LTR, 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 ",
+@@ -136,11 +140,11 @@
+ " SIZE ", " TRS ", "SWAP ",
+ "SHARE ", " A ", " WP ",
+ " D ", " RSS ", "WCHAN ",
+- "STAT ", " TIME ", "COMMAND",
++ "STAT ", TOPHDR_TIME , "COMMAND",
+ " LIB ", " FLAGS "
+ };
+ /* corresponding field desciptions */
+-char *headers2[] =
++const char *headers2[] =
+ {
+ "Process Id", "Parent Process Id", "User Id",
+ "User Name", "CPU Usage", "Memory Usage",
+--- watch.c
++++ watch.c 2000/02/25 09:53:14
+@@ -15,8 +15,9 @@
+
+ #include <ctype.h>
+ #include <getopt.h>
+-#include <ncurses.h>
+ #include <signal.h>
++#undef ERR
++#include <ncurses.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>