From 3911ee527b11c3fae2af8e36bb21a61a40bd8819 Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Mon, 12 Jul 2004 03:00:50 +0000 Subject: Make 'S' in interactive mode toggle display of system processes. --- contrib/top/commands.c | 1 + contrib/top/top.X | 3 +++ contrib/top/top.c | 10 +++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/contrib/top/commands.c b/contrib/top/commands.c index acb85775c4ac..4df6046da162 100644 --- a/contrib/top/commands.c +++ b/contrib/top/commands.c @@ -86,6 +86,7 @@ o - specify sort order (read, write, fault, total)\n", stdout); fputs("\ r - renice a process\n\ s - change number of seconds to delay between updates\n\ +S - toggle the displaying of system processes\n\ u - display processes for only one user (+ selects all users)\n\ \n\ \n", stdout); diff --git a/contrib/top/top.X b/contrib/top/top.X index fb710609663b..97ec76a8b440 100644 --- a/contrib/top/top.X +++ b/contrib/top/top.X @@ -229,6 +229,9 @@ Change the number of processes to display (prompt for new number). Change the number of seconds to delay between displays (prompt for new number). .TP +.B S +Toggle the display of system processes. +.TP .B k Send a signal (\*(lqkill\*(rq by default) to a list of processes. This acts similarly to the command diff --git a/contrib/top/top.c b/contrib/top/top.c index 9508e47af7df..7c5d09cd962c 100644 --- a/contrib/top/top.c +++ b/contrib/top/top.c @@ -194,9 +194,9 @@ char *argv[]; fd_set readfds; #ifdef ORDER - static char command_chars[] = "\f qh?en#sdkriIutHmo"; + static char command_chars[] = "\f qh?en#sdkriIutHmSo"; #else - static char command_chars[] = "\f qh?en#sdkriIutHm"; + static char command_chars[] = "\f qh?en#sdkriIutHmS"; #endif /* these defines enumerate the "strchr"s of the commands in command_chars */ #define CMD_redraw 0 @@ -218,8 +218,9 @@ char *argv[]; #define CMD_selftog 15 #define CMD_thrtog 16 #define CMD_viewtog 17 +#define CMD_viewsys 18 #ifdef ORDER -#define CMD_order 18 +#define CMD_order 19 #endif /* set the buffer for stdout */ @@ -1002,6 +1003,9 @@ restart: d_header = i_header; reset_display(); break; + case CMD_viewsys: + ps.system = !ps.system; + break; #ifdef ORDER case CMD_order: new_message(MT_standout, -- cgit v1.2.3