summaryrefslogtreecommitdiff
path: root/bin/ps/keyword.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2012-04-04 16:13:12 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2012-04-04 16:13:12 +0000
commitd0ebd0cc207709d8141e262402d39e9467d3f10c (patch)
tree125519f956e02fdc5ba94814c19cc8b0a80be0b8 /bin/ps/keyword.c
parentcacc94cfadcbe5ced13da57c1ebad41ae8364a38 (diff)
Add "tid" as a formatting keyword. If the -H option is specified, include
the thread ID in the default format. ok deraadt@ sthen@
Diffstat (limited to 'bin/ps/keyword.c')
-rw-r--r--bin/ps/keyword.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index df81cdf948b..0b15a83e6bd 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keyword.c,v 1.35 2012/01/07 05:38:12 guenther Exp $ */
+/* $OpenBSD: keyword.c,v 1.36 2012/04/04 16:13:11 jsing Exp $ */
/* $NetBSD: keyword.c,v 1.12.6.1 1996/05/30 21:25:13 cgd Exp $ */
/*-
@@ -75,6 +75,11 @@ int utime(), stime(), ixrss(), idrss(), isrss();
#define PID(n1, n2, fn, off) \
{ n1, n2, NULL, 0, fn, PIDLEN, 0, off, INT32, PIDFMT }
+#define TIDFMT "d"
+#define TIDLEN 7
+#define TID(n1, n2, fn, off) \
+ { n1, n2, NULL, 0, fn, TIDLEN, 0, off, INT32, TIDFMT }
+
#define USERLEN 8
#define CWDLEN 40
@@ -163,6 +168,7 @@ VAR var[] = {
GID("svgid", "SVGID", pvar, POFF(p_svgid)),
UID("svuid", "SVUID", pvar, POFF(p_svuid)),
{"tdev", "TDEV", NULL, 0, tdev, 4},
+ TID("tid", "TID", pvar, POFF(p_tid)),
{"time", "TIME", NULL, USER, cputime, 9},
PID("tpgid", "TPGID", pvar, POFF(p_tpgid)),
{"tsess", "TSESS", NULL, 0, pvar, PTRWIDTH, 0, POFF(p_tsess), UINT64, "llx"},