delete "rusage" alias; delete -s option; change "trs" to "trss"
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 13 Feb 1991 08:05:59 +0000 (00:05 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 13 Feb 1991 08:05:59 +0000 (00:05 -0800)
two bugs: sortby needed to be initalized, typo in an error message

SCCS-vsn: bin/ps/keyword.c 5.2
SCCS-vsn: bin/ps/ps.1 6.13
SCCS-vsn: bin/ps/ps.c 5.34

usr/src/bin/ps/keyword.c
usr/src/bin/ps/ps.1
usr/src/bin/ps/ps.c

index 4632f8d..3294143 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)keyword.c  5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)keyword.c  5.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -98,9 +98,6 @@ VAR var[] = {
        {"rssize", "", "rsz"},
        {"rsz", "RSZ", NULL, 0, rssize, 4},
        {"ruid", "RUID", NULL, 0, pvar, UIDLEN, POFF(p_ruid), USHORT, UIDFMT},
        {"rssize", "", "rsz"},
        {"rsz", "RSZ", NULL, 0, rssize, 4},
        {"ruid", "RUID", NULL, 0, pvar, UIDLEN, POFF(p_ruid), USHORT, UIDFMT},
-       {"rusage", "",
-               "minflt majflt nswap inblock oublock msgsnd msgrcv nsigs \
-                nvcsw nivcsw"},
        {"ruser", "RUSER", NULL, LJUST, runame, USERLEN},
        {"sess", "SESS", NULL, 0, evar, 6, EOFF(e_sess), KPTR, "x"},
        {"sig", "PENDING", NULL, 0, pvar, 8, POFF(p_sig), LONG, "x"},
        {"ruser", "RUSER", NULL, LJUST, runame, USERLEN},
        {"sess", "SESS", NULL, 0, evar, 6, EOFF(e_sess), KPTR, "x"},
        {"sig", "PENDING", NULL, 0, pvar, 8, POFF(p_sig), LONG, "x"},
index 04b91d8..eae8abb 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"     @(#)ps.1       6.12 (Berkeley) %G%
+.\"     @(#)ps.1       6.13 (Berkeley) %G%
 .\"
 .TH PS 1 "March 10, 1988"
 .UC 4
 .\"
 .TH PS 1 "March 10, 1988"
 .UC 4
@@ -12,7 +12,7 @@ ps \- process status
 .SH SYNOPSIS
 .nf
 .ft B
 .SH SYNOPSIS
 .nf
 .ft B
-ps [ \-aChjlmrSsTuvwx ] [ \-O|o fmt ] [ \-p pid ] [ \-t tty \] [ system ] [ core ] [ swap ]
+ps [ \-aChjlmrSTuvwx ] [ \-O|o fmt ] [ \-p pid ] [ \-t tty \] [ system ] [ core ] [ swap ]
 ps [ \-L ]
 .ft R
 .fi
 ps [ \-L ]
 .ft R
 .fi
@@ -85,10 +85,6 @@ Sort by current cpu usage, instead of by process ID.
 Change the way the process time is calculated by summing all exited
 children to their parent process.
 .TP
 Change the way the process time is calculated by summing all exited
 children to their parent process.
 .TP
-\-s
-Display information associated with the following keywords:
-uid, pid, sig, sigmask, sigignore, sigcatch, state, tt and command.
-.TP
 \-T
 Display information about processes attached to the device associated
 with the standard input.
 \-T
 Display information about processes attached to the device associated
 with the standard input.
@@ -104,7 +100,7 @@ The \-u option implies the \-r option.
 .TP
 \-v
 Display information associated with the following keywords:
 .TP
 \-v
 Display information associated with the following keywords:
-pid, state, time, sl, re, pagein, vsz, rss, lim, tsiz, trs,
+pid, state, time, sl, re, pagein, vsz, rss, lim, tsiz, trss,
 %cpu, %mem and command.
 The \-v option implies the \-m option.
 .TP
 %cpu, %mem and command.
 The \-v option implies the \-m option.
 .TP
@@ -196,7 +192,7 @@ If the command started less than 24 hours ago, the start time is
 displayed using the ``%l:ps.1p'' format described in 
 .IR strftime (3).
 If the command started less than 7 days ago, the start time is
 displayed using the ``%l:ps.1p'' format described in 
 .IR strftime (3).
 If the command started less than 7 days ago, the start time is
-displayed using the ``%a6.12p'' format.
+displayed using the ``%a6.13p'' format.
 Otherwise, the start time is displayed using the ``%e%b%y'' format.
 .TP
 state
 Otherwise, the start time is displayed using the ``%e%b%y'' format.
 .TP
 state
@@ -367,9 +363,6 @@ resident set size
 resident set size + (text size / text use count) (alias rssize)
 .IP ruid 10
 real user ID
 resident set size + (text size / text use count) (alias rssize)
 .IP ruid 10
 real user ID
-.IP rusage 10
-an alias for the following keywords: minflt, majflt, nswap, inblock,
-oublock, msgsnd, msgrcv, nsigs, nvcsw and nivcsw.
 .IP ruser 10
 user name (from ruid)
 .IP sess 10
 .IP ruser 10
 user name (from ruid)
 .IP sess 10
@@ -398,7 +391,7 @@ control terminal device number
 accumulated cpu time, user + system (alias cputime)
 .IP tpgid 10
 control terminal process group ID
 accumulated cpu time, user + system (alias cputime)
 .IP tpgid 10
 control terminal process group ID
-.IP trs 10
+.IP trss 10
 text resident set size (in Kbytes)
 .IP tsess 10
 control terminal session pointer
 text resident set size (in Kbytes)
 .IP tsess 10
 control terminal session pointer
index e335981..e740d47 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)ps.c       5.33 (Berkeley) %G%";
+static char sccsid[] = "@(#)ps.c       5.34 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -44,7 +44,7 @@ int   totwidth;               /* calculated width of requested variables */
 
 static int needuser, needcomm;
 
 
 static int needuser, needcomm;
 
-enum sort { SORTMEM, SORTCPU } sortby;
+enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT;
 
 uid_t  getuid();
 char   *ttyname();
 
 uid_t  getuid();
 char   *ttyname();
@@ -53,7 +53,6 @@ char  *ttyname();
 #define        JFMT    "user pid ppid pgid sess jobc state tt time command"
 #define LFMT \
        "uid pid ppid cpu pri nice vsz rss wchan state tt time command"
 #define        JFMT    "user pid ppid pgid sess jobc state tt time command"
 #define LFMT \
        "uid pid ppid cpu pri nice vsz rss wchan state tt time command"
-#define        SFMT    "uid pid sig sigmask sigignore sigcatch state tt command"
 #define UFMT \
        "user pid %cpu %mem vsz rss tt state start time command"
 #define        VFMT \
 #define UFMT \
        "user pid %cpu %mem vsz rss tt state start time command"
 #define        VFMT \
@@ -137,10 +136,6 @@ main(argc, argv)
                case 'S':
                        sumrusage = 1;
                        break;
                case 'S':
                        sumrusage = 1;
                        break;
-               case 's':
-                       parsefmt(SFMT);
-                       fmt = 1;
-                       break;
                case 'T':
                        if ((optarg = ttyname(STDIN_FILENO)) == NULL)
                                error("stdin: not a terminal");
                case 'T':
                        if ((optarg = ttyname(STDIN_FILENO)) == NULL)
                                error("stdin: not a terminal");
@@ -159,7 +154,7 @@ main(argc, argv)
                                ttypath = optarg;
                        if (stat(ttypath, &stbuf) == -1) {
                                (void)fprintf(stderr,
                                ttypath = optarg;
                        if (stat(ttypath, &stbuf) == -1) {
                                (void)fprintf(stderr,
-                                   "ps: %s: %s\n", strerror(ttypath));
+                                   "ps: %s: %s\n", ttypath, strerror(errno));
                                exit(1);
                        }
                        if (!S_ISCHR(stbuf.st_mode))
                                exit(1);
                        }
                        if (!S_ISCHR(stbuf.st_mode))