summaryrefslogtreecommitdiffstats
path: root/contrib/top/top.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1997-03-23 18:53:01 +0000
committerjoerg <joerg@FreeBSD.org>1997-03-23 18:53:01 +0000
commite571e75266c1a75ac309339c04879886cbd298cf (patch)
treecdf253c6d6aff1974ea3a063441dd6a97ab2b038 /contrib/top/top.c
parentc1a738a3bedc8182878c8f04311d72237fc15d4b (diff)
downloadFreeBSD-src-e571e75266c1a75ac309339c04879886cbd298cf.zip
FreeBSD-src-e571e75266c1a75ac309339c04879886cbd298cf.tar.gz
Apply the FreeBSD-local patches.
Obtained from: The ports collection.
Diffstat (limited to 'contrib/top/top.c')
-rw-r--r--contrib/top/top.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/contrib/top/top.c b/contrib/top/top.c
index 55bee4e..1902abb 100644
--- a/contrib/top/top.c
+++ b/contrib/top/top.c
@@ -111,6 +111,8 @@ int i_cpustates();
int u_cpustates();
int i_memory();
int u_memory();
+int i_swap();
+int u_swap();
int i_message();
int u_message();
int i_header();
@@ -123,6 +125,7 @@ int (*d_loadave)() = i_loadave;
int (*d_procstates)() = i_procstates;
int (*d_cpustates)() = i_cpustates;
int (*d_memory)() = i_memory;
+int (*d_swap)() = i_swap;
int (*d_message)() = i_message;
int (*d_header)() = i_header;
int (*d_process)() = i_process;
@@ -568,6 +571,9 @@ Usage: %s [-ISbinqu] [-d x] [-s x] [-o field] [-U username] [number]\n",
/* display memory stats */
(*d_memory)(system_info.memory);
+ /* display swap stats */
+ (*d_swap)(system_info.swap);
+
/* handle message area */
(*d_message)();
@@ -622,6 +628,7 @@ Usage: %s [-ISbinqu] [-d x] [-s x] [-o field] [-U username] [number]\n",
d_procstates = u_procstates;
d_cpustates = u_cpustates;
d_memory = u_memory;
+ d_swap = u_swap;
d_message = u_message;
d_header = u_header;
d_process = u_process;
@@ -663,8 +670,11 @@ Usage: %s [-ISbinqu] [-d x] [-s x] [-o field] [-U username] [number]\n",
(void) read(0, &ch, 1);
if ((iptr = strchr(command_chars, ch)) == NULL)
{
- /* illegal command */
- new_message(MT_standout, " Command not understood");
+ if (ch != '\r' && ch != '\n')
+ {
+ /* illegal command */
+ new_message(MT_standout, " Command not understood");
+ }
putchar('\r');
no_command = Yes;
}
@@ -909,6 +919,7 @@ reset_display()
d_procstates = i_procstates;
d_cpustates = i_cpustates;
d_memory = i_memory;
+ d_swap = i_swap;
d_message = i_message;
d_header = i_header;
d_process = i_process;
OpenPOWER on IntegriCloud