diff options
author | jake <jake@FreeBSD.org> | 2001-02-12 00:21:38 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-02-12 00:21:38 +0000 |
commit | 0dc4d20fbded3f51c474394a4195ac5168728329 (patch) | |
tree | f399d384bf63952565cc2754fb8683f661b500ad /bin | |
parent | 55d5108ac58bdc48fbd9eccefcb58a49682107b5 (diff) | |
download | FreeBSD-src-0dc4d20fbded3f51c474394a4195ac5168728329.zip FreeBSD-src-0dc4d20fbded3f51c474394a4195ac5168728329.tar.gz |
Catch up to new priority interface.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ps/extern.h | 2 | ||||
-rw-r--r-- | bin/ps/keyword.c | 5 | ||||
-rw-r--r-- | bin/ps/print.c | 28 |
3 files changed, 18 insertions, 17 deletions
diff --git a/bin/ps/extern.h b/bin/ps/extern.h index ac4fb2e..dedac7e 100644 --- a/bin/ps/extern.h +++ b/bin/ps/extern.h @@ -65,7 +65,7 @@ void parsefmt __P((char *)); void pcpu __P((KINFO *, VARENT *)); void pmem __P((KINFO *, VARENT *)); void pri __P((KINFO *, VARENT *)); -void rtprior __P((KINFO *, VARENT *)); +void priorityr __P((KINFO *, VARENT *)); void printheader __P((void)); void rssize __P((KINFO *, VARENT *)); void runame __P((KINFO *, VARENT *)); diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index 47c4a57..6a6b277 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -144,7 +144,7 @@ VAR var[] = { {"rgid", "RGID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_rgid), UINT, UIDFMT}, {"rss", "RSS", NULL, 0, kvar, NULL, 4, KOFF(ki_rssize), UINT, "d"}, - {"rtprio", "RTPRIO", NULL, 0, rtprior, NULL, 7, KOFF(ki_rtprio)}, + {"rtprio", "RTPRIO", NULL, 0, priorityr, NULL, 7, KOFF(ki_pri)}, {"ruid", "RUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_ruid), UINT, UIDFMT}, {"ruser", "RUSER", NULL, LJUST|DSIZ, runame, s_runame, USERLEN}, @@ -173,7 +173,8 @@ VAR var[] = { {"ucomm", "UCOMM", NULL, LJUST, ucomm, NULL, MAXCOMLEN}, {"uid", "UID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_uid), UINT, UIDFMT}, - {"upr", "UPR", NULL, 0, kvar, NULL, 3, KOFF(ki_usrpri), CHAR, "d"}, + {"upr", "UPR", NULL, 0, kvar, NULL, 3, KOFF(ki_pri.pri_user), + UCHAR, "d"}, {"user", "USER", NULL, LJUST|DSIZ, uname, s_uname, USERLEN}, {"usrpri", "", "upr"}, {"vsize", "", "vsz"}, diff --git a/bin/ps/print.c b/bin/ps/print.c index ebcce4f..72d96cf 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -244,7 +244,7 @@ pri(k, ve) VAR *v; v = ve->var; - (void)printf("%*d", v->width, k->ki_p->ki_priority - PZERO); + (void)printf("%*d", v->width, k->ki_p->ki_pri.pri_level - PZERO); } void @@ -613,31 +613,31 @@ tsize(k, ve) } void -rtprior(k, ve) +priorityr(k, ve) KINFO *k; VARENT *ve; { VAR *v; - struct rtprio *prtp; + struct priority *pri; char str[8]; - unsigned prio, type; + unsigned class, level; v = ve->var; - prtp = (struct rtprio *) ((char *)k + v->off); - prio = prtp->prio; - type = prtp->type; - switch (type) { - case RTP_PRIO_REALTIME: - snprintf(str, sizeof(str), "real:%u", prio); + pri = (struct priority *) ((char *)k + v->off); + class = pri->pri_class; + level = pri->pri_level; + switch (class) { + case PRI_REALTIME: + snprintf(str, sizeof(str), "real:%u", level); break; - case RTP_PRIO_NORMAL: + case PRI_TIMESHARE: strncpy(str, "normal", sizeof(str)); break; - case RTP_PRIO_IDLE: - snprintf(str, sizeof(str), "idle:%u", prio); + case PRI_IDLE: + snprintf(str, sizeof(str), "idle:%u", level); break; default: - snprintf(str, sizeof(str), "%u:%u", type, prio); + snprintf(str, sizeof(str), "%u:%u", class, level); break; } str[sizeof(str) - 1] = '\0'; |