From 4fd832da65e4abdcb67096960cfe64be43f7d304 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 11 Dec 2011 00:16:50 +0000 Subject: Make ps understand -o cwd using the new KERN_PROC_CWD sysctl. Some help and suggestions from guenther. ok guenther --- bin/ps/keyword.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin/ps/keyword.c') 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"}, -- cgit v1.2.3