Perform keyword.c:1.27 properly, implement -orss in the New World Order of
ps(1) formatting, using pgtok() to get the value in K, rather than printing it in pages. This is consistent with behaviour before keyword.c:1.26 (et al) which exists in STABLE today, and which uses the same metric as VSZ. Submitted by: bde
This commit is contained in:
parent
4086fd8e70
commit
f3073b05b7
@ -69,6 +69,7 @@ void pri(KINFO *, VARENT *);
|
||||
void printheader(void);
|
||||
void priorityr(KINFO *, VARENT *);
|
||||
void rgroupname(KINFO *, VARENT *);
|
||||
void rss(KINFO *, VARENT *);
|
||||
void runame(KINFO *, VARENT *);
|
||||
void rvar(KINFO *, VARENT *);
|
||||
int s_rgroupname(KINFO *);
|
||||
|
@ -147,8 +147,7 @@ static VAR var[] = {
|
||||
UINT, UIDFMT, 0},
|
||||
{"rgroup", "RGROUP", NULL, LJUST|DSIZ, rgroupname, s_rgroupname,
|
||||
USERLEN, 0, CHAR, NULL, 0},
|
||||
{"rss", "RSS", NULL, 0, kvar, NULL, 4, KOFF(ki_rssize), UINT, "d",
|
||||
0},
|
||||
{"rss", "RSS", NULL, 0, rss, NULL, 4, 0, CHAR, NULL, 0},
|
||||
{"rtprio", "RTPRIO", NULL, 0, priorityr, NULL, 7, KOFF(ki_pri), CHAR,
|
||||
NULL, 0},
|
||||
{"ruid", "RUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_ruid),
|
||||
|
@ -317,6 +317,16 @@ s_runame(KINFO *k)
|
||||
return (strlen(user_from_uid(k->ki_p->ki_ruid, 0)));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rss(KINFO *k, VARENT *ve)
|
||||
{
|
||||
VAR *v;
|
||||
|
||||
v = ve->var;
|
||||
(void)printf("%*ld", v->width, (long)ps_pgtok(k->ki_p->ki_rssize));
|
||||
}
|
||||
|
||||
void
|
||||
tdev(KINFO *k, VARENT *ve)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user