diff options
author | marcus <marcus@FreeBSD.org> | 2008-02-09 05:16:26 +0000 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2008-02-09 05:16:26 +0000 |
commit | 7e24637c24d89a152b59a841be37492eb89f6306 (patch) | |
tree | 20e45e9043b089cddbc2ac777d162e09cb3e0524 /sys/sys/user.h | |
parent | 7445f79ec2116bd87b6972c03986e41535d73509 (diff) | |
download | FreeBSD-src-7e24637c24d89a152b59a841be37492eb89f6306.zip FreeBSD-src-7e24637c24d89a152b59a841be37492eb89f6306.tar.gz |
Add support for displaying a process' current working directory, root
directory, and jail directory within procstat. While this functionality
is available already in fstat, encapsulating it in the kern.proc.filedesc
sysctl makes it accessible without using kvm and thus without needing
elevated permissions.
The new procstat output looks like:
PID COMM FD T V FLAGS REF OFFSET PRO NAME
76792 tcsh cwd v d -------- - - - /usr/src
76792 tcsh root v d -------- - - - /
76792 tcsh 15 v c rw------ 16 9130 - -
76792 tcsh 16 v c rw------ 16 9130 - -
76792 tcsh 17 v c rw------ 16 9130 - -
76792 tcsh 18 v c rw------ 16 9130 - -
76792 tcsh 19 v c rw------ 16 9130 - -
I am also bumping __FreeBSD_version for this as this new feature will be
used in at least one port.
Reviewed by: rwatson
Approved by: rwatson
Diffstat (limited to 'sys/sys/user.h')
-rw-r--r-- | sys/sys/user.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/sys/user.h b/sys/sys/user.h index 8177b1b..5595476 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -234,7 +234,7 @@ struct user { }; /* - * The KERN_PROC_FILE sysctl allows a process to dumpt the file descriptor + * The KERN_PROC_FILE sysctl allows a process to dump the file descriptor * array of another process. */ #define KF_TYPE_NONE 0 @@ -259,6 +259,10 @@ struct user { #define KF_VTYPE_VBAD 8 #define KF_VTYPE_UNKNOWN 255 +#define KF_FD_TYPE_CWD -1 /* Current working directory */ +#define KF_FD_TYPE_ROOT -2 /* Root directory */ +#define KF_FD_TYPE_JAIL -3 /* Jail directory */ + #define KF_FLAG_READ 0x00000001 #define KF_FLAG_WRITE 0x00000002 #define KF_FLAG_APPEND 0x00000004 |