From e4d52dfd1bb80a6ef3f77993d3cc8417a885b749 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Wed, 6 Sep 2017 16:18:06 +0000 Subject: [PATCH] Reflect realtime and idle priorities in ps(1) state flags, same like we do for the usual nice values. It could be argued that they should use another set of indicators, since the underlying mechanism is different, but they match the description in the manual page, and so I think it's ok to not overcomplicate things. PR: 81757 MFC after: 2 weeks Sponsored by: DARPA, AFRL --- bin/ps/print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ps/print.c b/bin/ps/print.c index d84628771ff..3c8214a3bb3 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -262,9 +262,9 @@ state(KINFO *k, VARENT *ve __unused) cp++; if (!(flag & P_INMEM)) *cp++ = 'W'; - if (k->ki_p->ki_nice < NZERO) + if (k->ki_p->ki_nice < NZERO || k->ki_p->ki_pri.pri_class == PRI_REALTIME) *cp++ = '<'; - else if (k->ki_p->ki_nice > NZERO) + else if (k->ki_p->ki_nice > NZERO || k->ki_p->ki_pri.pri_class == PRI_IDLE) *cp++ = 'N'; if (flag & P_TRACED) *cp++ = 'X';