summaryrefslogtreecommitdiff
path: root/bin/ps/keyword.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-12-11 00:16:50 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-12-11 00:16:50 +0000
commit4fd832da65e4abdcb67096960cfe64be43f7d304 (patch)
tree5eef462b645df216e17ea19c2d3a92a4f1adfcc8 /bin/ps/keyword.c
parent850a87bc6767cfe0b6460373a875a07dedb2ee5a (diff)
Make ps understand -o cwd using the new KERN_PROC_CWD sysctl. Some help
and suggestions from guenther. ok guenther
Diffstat (limited to 'bin/ps/keyword.c')
-rw-r--r--bin/ps/keyword.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 0b105b717e2..4653db0b790 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keyword.c,v 1.32 2011/04/10 03:20:58 guenther Exp $ */
+/* $OpenBSD: keyword.c,v 1.33 2011/12/11 00:16:49 nicm Exp $ */
/* $NetBSD: keyword.c,v 1.12.6.1 1996/05/30 21:25:13 cgd Exp $ */
/*-
@@ -74,6 +74,7 @@ int utime(), stime(), ixrss(), idrss(), isrss();
{ n1, n2, NULL, 0, fn, PIDLEN, 0, off, INT32, PIDFMT }
#define USERLEN 8
+#define CWDLEN 40
/* Bit types must match their respective entries in struct kinfo_proc */
VAR var[] = {
@@ -89,6 +90,7 @@ VAR var[] = {
{"cpu", "CPU", NULL, 0, pvar, 3, 0, POFF(p_estcpu), UINT32, "d"},
{"cpuid", "CPUID", NULL, 0, pvar, 8, 0, POFF(p_cpuid), UINT64, "lld"},
{"cputime", "", "time"},
+ {"cwd", "CWD", NULL, LJUST, curwd, CWDLEN},
{"dsiz", "DSIZ", NULL, 0, dsize, 4},
{"emul", "EMUL", NULL, LJUST, emulname, KI_EMULNAMELEN - 1},
{"etime", "", "start"},