summaryrefslogtreecommitdiff
path: root/usr.bin/top/top.c
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-11-11 01:48:59 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-11-11 01:48:59 +0000
commit120e2db176886856925c7feee82be7ffd91f4c4e (patch)
tree59c3ed2b3f38c24c07c310f826978e0347e79465 /usr.bin/top/top.c
parentcd1dae9af7fb21c6ae14a1c569ca21530509990f (diff)
Add 'S' to interactive mode to toggle the display of system
processes; From NetBSD. millert@ ok.
Diffstat (limited to 'usr.bin/top/top.c')
-rw-r--r--usr.bin/top/top.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index 11ae328becc..30f98a4872d 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: top.c,v 1.11 2001/09/05 06:25:39 deraadt Exp $ */
+/* $OpenBSD: top.c,v 1.12 2001/11/11 01:48:58 fgsch Exp $ */
const char copyright[] = "Copyright (c) 1984 through 1996, William LeFebvre";
@@ -153,9 +153,9 @@ char *argv[];
fd_set readfds;
#ifdef ORDER
- static char command_chars[] = "\f qh?en#sdkriIuo";
+ static char command_chars[] = "\f qh?en#sdkriIuSo";
#else
- static char command_chars[] = "\f qh?en#sdkriIu";
+ static char command_chars[] = "\f qh?en#sdkriIuS";
#endif
/* these defines enumerate the "strchr"s of the commands in command_chars */
#define CMD_redraw 0
@@ -174,8 +174,9 @@ char *argv[];
#define CMD_idletog 12
#define CMD_idletog2 13
#define CMD_user 14
+#define CMD_system 15
#ifdef ORDER
-#define CMD_order 15
+#define CMD_order 16
#endif
/* set the buffer for stdout */
@@ -871,7 +872,14 @@ restart:
clear_message();
}
break;
-
+
+ case CMD_system:
+ ps.system = !ps.system;
+ new_message(MT_standout | MT_delayed,
+ " %sisplaying system processes.",
+ ps.system ? "D" : "Not d");
+ break;
+
#ifdef ORDER
case CMD_order:
new_message(MT_standout,