summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm_getfiles.3
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-02-11 03:03:08 +0000
committerguenther <guenther@openbsd.org>2015-02-11 03:03:08 +0000
commit4aba674d98011e9129df3418b07092cd2fe1c8ce (patch)
treeac0610e97aa9beef59f6393020676734ab347f8d /lib/libkvm/kvm_getfiles.3
parentMore unifdef OPENSSL_NO_RFC3779 that got missed last time around. (diff)
downloadwireguard-openbsd-4aba674d98011e9129df3418b07092cd2fe1c8ce.tar.xz
wireguard-openbsd-4aba674d98011e9129df3418b07092cd2fe1c8ce.zip
sysctl({CTL_KERN, KERN_FILE, KERN_FILE_BYFILE}) previously required
the extra argument to be zero; instead, make it filter on the file type (DTYPE_*) when non-zero to make claudio's netstat work easier. ok claudio@
Diffstat (limited to 'lib/libkvm/kvm_getfiles.3')
-rw-r--r--lib/libkvm/kvm_getfiles.327
1 files changed, 24 insertions, 3 deletions
diff --git a/lib/libkvm/kvm_getfiles.3 b/lib/libkvm/kvm_getfiles.3
index f26818fcdc4..b8e0ed58d13 100644
--- a/lib/libkvm/kvm_getfiles.3
+++ b/lib/libkvm/kvm_getfiles.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: kvm_getfiles.3,v 1.16 2013/10/22 16:40:27 guenther Exp $
+.\" $OpenBSD: kvm_getfiles.3,v 1.17 2015/02/11 03:03:08 guenther Exp $
.\" $NetBSD: kvm_getfiles.3,v 1.3 1996/03/18 22:33:23 thorpej Exp $
.\"
.\" Copyright (c) 1992, 1993
@@ -34,7 +34,7 @@
.\"
.\" @(#)kvm_getfiles.3 8.2 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: October 22 2013 $
+.Dd $Mdocdate: February 11 2015 $
.Dt KVM_GETFILES 3
.Os
.Sh NAME
@@ -62,7 +62,9 @@ describes the filtering predicate as follows:
.Pp
.Bl -tag -width 20n -offset indent -compact
.It Dv KERN_FILE_BYFILE
-all open files
+all open files with type
+.Fa arg
+(0 for all files)
.It Dv KERN_FILE_BYPID
files opened by process ID
.Fa arg
@@ -70,11 +72,30 @@ files opened by process ID
.It Dv KERN_FILE_BYUID
files opened by processes with effective user ID
.Fa arg
+(\-1 for all users)
.El
.Pp
Files associated with a process will include information about
the process that has the file open.
.Pp
+For
+.Dv KERN_FILE_BYFILE
+the recognized file types are defined in
+.In sys/file.h :
+.Pp
+.Bl -tag -width 20n -offset indent -compact
+.It Dv DTYPE_VNODE
+files and devices
+.It Dv DTYPE_SOCKET
+sockets, regardless of domain
+.It Dv DTYPE_PIPE
+pipes and FIFOs
+.It Dv DTYPE_KQUEUE
+kqueues
+.It Dv DTYPE_SYSTRACE
+systrace control files
+.El
+.Pp
Only the first
.Fa elemsize
bytes of each array entry are returned.