summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhugh <hugh@openbsd.org>2006-05-02 05:25:19 +0000
committerhugh <hugh@openbsd.org>2006-05-02 05:25:19 +0000
commit2242bec22324547d787b71e298ab364c7f34b46b (patch)
tree0377f9e88bcf4a7faa1ee85eddd60638680badb3
parentSpread some .Xr for the hard to stumble across lam(1). (diff)
downloadwireguard-openbsd-2242bec22324547d787b71e298ab364c7f34b46b.tar.xz
wireguard-openbsd-2242bec22324547d787b71e298ab364c7f34b46b.zip
Format nicelevel relative NZERO as other tools do.
Surely, says millert.
-rw-r--r--bin/ps/extern.h3
-rw-r--r--bin/ps/keyword.c6
-rw-r--r--bin/ps/print.c12
3 files changed, 15 insertions, 6 deletions
diff --git a/bin/ps/extern.h b/bin/ps/extern.h
index ac625fb62af..61526d2b9ea 100644
--- a/bin/ps/extern.h
+++ b/bin/ps/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.12 2005/01/07 20:41:13 otto Exp $ */
+/* $OpenBSD: extern.h,v 1.13 2006/05/02 05:25:19 hugh Exp $ */
/* $NetBSD: extern.h,v 1.10 1995/05/21 13:38:27 mycroft Exp $ */
/*-
@@ -66,6 +66,7 @@ void pmem(const struct kinfo_proc2 *, VARENT *);
void pri(const struct kinfo_proc2 *, VARENT *);
void printheader(void);
void pvar(const struct kinfo_proc2 *kp, VARENT *);
+void pnice(const struct kinfo_proc2 *kp, VARENT *);
void rgname(const struct kinfo_proc2 *, VARENT *);
void rssize(const struct kinfo_proc2 *, VARENT *);
void runame(const struct kinfo_proc2 *, VARENT *);
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index cef2b643a4c..b3a967a7810 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keyword.c,v 1.23 2004/09/14 23:45:14 deraadt Exp $ */
+/* $OpenBSD: keyword.c,v 1.24 2006/05/02 05:25:19 hugh Exp $ */
/* $NetBSD: keyword.c,v 1.12.6.1 1996/05/30 21:25:13 cgd Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: keyword.c,v 1.23 2004/09/14 23:45:14 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: keyword.c,v 1.24 2006/05/02 05:25:19 hugh Exp $";
#endif
#endif /* not lint */
@@ -121,7 +121,7 @@ VAR var[] = {
{"msgrcv", "MSGRCV", NULL, USER, pvar, 4, 0, POFF(p_uru_msgrcv), UINT64, "lld"},
{"msgsnd", "MSGSND", NULL, USER, pvar, 4, 0, POFF(p_uru_msgsnd), UINT64, "lld"},
{"ni", "", "nice"},
- {"nice", "NI", NULL, 0, pvar, 2, 0, POFF(p_nice), UINT8, "d"},
+ {"nice", "NI", NULL, 0, pnice, 3},
{"nivcsw", "NIVCSW", NULL, USER, pvar, 5, 0, POFF(p_uru_nivcsw), UINT64, "lld"},
{"nsignals", "", "nsigs"},
{"nsigs", "NSIGS", NULL, USER, pvar, 4, 0, POFF(p_uru_nsignals), UINT64, "lld"},
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 50578a8cf21..1594121e200 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.40 2006/03/10 11:31:41 moritz Exp $ */
+/* $OpenBSD: print.c,v 1.41 2006/05/02 05:25:19 hugh Exp $ */
/* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
-static char rcsid[] = "$OpenBSD: print.c,v 1.40 2006/03/10 11:31:41 moritz Exp $";
+static char rcsid[] = "$OpenBSD: print.c,v 1.41 2006/05/02 05:25:19 hugh Exp $";
#endif
#endif /* not lint */
@@ -294,6 +294,14 @@ pri(const struct kinfo_proc2 *kp, VARENT *ve)
}
void
+pnice(const struct kinfo_proc2 *kp, VARENT *ve)
+{
+ VAR *v;
+ v = ve->var;
+ (void)printf("%*d", v->width, kp->p_nice - NZERO);
+}
+
+void
euname(const struct kinfo_proc2 *kp, VARENT *ve)
{
VAR *v;