*/
#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>
{"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"},
.\"
.\" %sccs.include.redist.man%
.\"
-.\" @(#)ps.1 6.12 (Berkeley) %G%
+.\" @(#)ps.1 6.13 (Berkeley) %G%
.\"
.TH PS 1 "March 10, 1988"
.UC 4
.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
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.
.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
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
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
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
#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>
static int needuser, needcomm;
-enum sort { SORTMEM, SORTCPU } sortby;
+enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT;
uid_t getuid();
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 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 \
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");
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))