Support the SUSv3 `rgroup' format.
Clean up some local style bogons.
This commit is contained in:
parent
bfb17f2ab2
commit
b9515c4b9c
@ -66,8 +66,10 @@ void pmem(KINFO *, VARENT *);
|
||||
void pri(KINFO *, VARENT *);
|
||||
void printheader(void);
|
||||
void priorityr(KINFO *, VARENT *);
|
||||
void rgroupname(KINFO *, VARENT *);
|
||||
void runame(KINFO *, VARENT *);
|
||||
void rvar(KINFO *, VARENT *);
|
||||
int s_rgroupname(KINFO *);
|
||||
int s_runame(KINFO *);
|
||||
int s_uname(KINFO *);
|
||||
void showkey(void);
|
||||
|
@ -156,6 +156,8 @@ static VAR var[] = {
|
||||
0},
|
||||
{"rgid", "RGID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_rgid),
|
||||
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},
|
||||
{"rtprio", "RTPRIO", NULL, 0, priorityr, NULL, 7, KOFF(ki_pri), CHAR,
|
||||
|
@ -280,8 +280,7 @@ uname(KINFO *k, VARENT *ve)
|
||||
VAR *v;
|
||||
|
||||
v = ve->var;
|
||||
(void)printf("%-*s",
|
||||
(int)v->width, user_from_uid(k->ki_p->ki_uid, 0));
|
||||
(void)printf("%-*s", v->width, user_from_uid(k->ki_p->ki_uid, 0));
|
||||
}
|
||||
|
||||
int
|
||||
@ -290,14 +289,28 @@ s_uname(KINFO *k)
|
||||
return (strlen(user_from_uid(k->ki_p->ki_uid, 0)));
|
||||
}
|
||||
|
||||
void
|
||||
rgroupname(KINFO *k, VARENT *ve)
|
||||
{
|
||||
VAR *v;
|
||||
|
||||
v = ve->var;
|
||||
(void)printf("%-*s", v->width, group_from_gid(k->ki_p->ki_rgid, 0));
|
||||
}
|
||||
|
||||
int
|
||||
s_rgroupname(KINFO *k)
|
||||
{
|
||||
return (strlen(group_from_gid(k->ki_p->ki_rgid, 0)));
|
||||
}
|
||||
|
||||
void
|
||||
runame(KINFO *k, VARENT *ve)
|
||||
{
|
||||
VAR *v;
|
||||
|
||||
v = ve->var;
|
||||
(void)printf("%-*s",
|
||||
(int)v->width, user_from_uid(k->ki_p->ki_ruid, 0));
|
||||
(void)printf("%-*s", v->width, user_from_uid(k->ki_p->ki_ruid, 0));
|
||||
}
|
||||
|
||||
int
|
||||
@ -718,5 +731,5 @@ lattr(KINFO *k, VARENT *ve)
|
||||
VAR *v;
|
||||
|
||||
v = ve->var;
|
||||
(void)printf("%-*d", (int)v->width, get_lattr(k->ki_p->ki_pid));
|
||||
(void)printf("%-*d", v->width, get_lattr(k->ki_p->ki_pid));
|
||||
}
|
||||
|
@ -442,6 +442,8 @@ core residency time (in seconds; 127 = infinity)
|
||||
.It rgid
|
||||
real group
|
||||
.Tn ID
|
||||
.It rgroup
|
||||
group name (from rgid)
|
||||
.It rlink
|
||||
reverse link on run queue, or 0
|
||||
.It rss
|
||||
|
Loading…
x
Reference in New Issue
Block a user