summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm_getfiles.3
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2013-10-22 16:40:25 +0000
committerguenther <guenther@openbsd.org>2013-10-22 16:40:25 +0000
commitcef0bbe1cc5517635356b7faa348b466660ec603 (patch)
tree8a975e0739a2b36fd5200d33c430980754b92498 /lib/libkvm/kvm_getfiles.3
parent- expand hardware list with iMX boards (diff)
downloadwireguard-openbsd-cef0bbe1cc5517635356b7faa348b466660ec603.tar.xz
wireguard-openbsd-cef0bbe1cc5517635356b7faa348b466660ec603.zip
- add UNIX-domain socket info to struct kinfo_file2
- convert netstat from kvm_getfiles() to kvm_getfile2() using that - delete kvm_getfiles() and KERN_FILE as no longer used (bump libkvm's major) - rename kvm_getfile2() to kvm_getfiles(), kinfo_file2 to kinfo_file and KERN_FILE2 to KERN_FILE. ok deraadt@, millert@ ports scan sthen@
Diffstat (limited to 'lib/libkvm/kvm_getfiles.3')
-rw-r--r--lib/libkvm/kvm_getfiles.365
1 files changed, 19 insertions, 46 deletions
diff --git a/lib/libkvm/kvm_getfiles.3 b/lib/libkvm/kvm_getfiles.3
index 6954f5aa60b..f26818fcdc4 100644
--- a/lib/libkvm/kvm_getfiles.3
+++ b/lib/libkvm/kvm_getfiles.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: kvm_getfiles.3,v 1.15 2013/08/03 06:25:32 guenther Exp $
+.\" $OpenBSD: kvm_getfiles.3,v 1.16 2013/10/22 16:40:27 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: August 3 2013 $
+.Dd $Mdocdate: October 22 2013 $
.Dt KVM_GETFILES 3
.Os
.Sh NAME
@@ -43,14 +43,9 @@
.Sh SYNOPSIS
.In kvm.h
.In sys/types.h
-.Fd #define _KERNEL
-.In sys/file.h
-.Fd #undef _KERNEL
-.\" .Fa kvm_t *kd
-.Ft char *
-.Fn kvm_getfiles "kvm_t *kd" "int op" "int arg" "int *cnt"
-.Ft struct kinfo_file2 *
-.Fn kvm_getfile2 "kvm_t *kd" "int op" "int arg" "size_t elemsize" "int *cnt"
+.In sys/sysctl.h
+.Ft struct kinfo_file *
+.Fn kvm_getfiles "kvm_t *kd" "int op" "int arg" "size_t elemsize" "int *cnt"
.Sh DESCRIPTION
.Fn kvm_getfiles
returns a (sub-)set of the open files in the kernel indicated by
@@ -61,38 +56,6 @@ and
.Fa arg
arguments constitute a predicate which limits the set of files
returned.
-No predicates are currently defined.
-.Pp
-The number of processes found is returned in the reference parameter
-.Fa cnt .
-The files are returned as a contiguous array of file structures,
-preceded by the address of the first file entry in the kernel.
-This memory is owned by kvm and is not guaranteed to be persistent across
-subsequent kvm library calls.
-Data should be copied out if it needs to be saved.
-.Pp
-.Fn kvm_getfile2
-is similar to
-.Fn kvm_getfiles
-but returns an array of
-.Vt kinfo_file2
-structures.
-Additionally, only the first
-.Fa elemsize
-bytes of each array entry are returned.
-If the size of the
-.Vt kinfo_file2
-structure increases in size in a future release of
-.Ox ,
-the kernel will only return the requested amount of data for
-each array entry and programs that use
-.Fn kvm_getfile2
-will continue to function without the need for recompilation.
-The
-.Fa op
-and
-.Fa arg
-arguments constitute a predicate which limits the set of processes returned.
The value of
.Fa op
describes the filtering predicate as follows:
@@ -112,20 +75,30 @@ files opened by processes with effective user ID
Files associated with a process will include information about
the process that has the file open.
.Pp
+Only the first
+.Fa elemsize
+bytes of each array entry are returned.
+If the size of the
+.Vt kinfo_file
+structure increases in size in a future release of
+.Ox ,
+the kernel will only return the requested amount of data for
+each array entry and programs that use
+.Fn kvm_getfiles
+will continue to function without the need for recompilation.
+.Pp
The files are returned as a contiguous array of
-.Vt kinfo_file2
+.Vt kinfo_file
structures.
The number of structures found is returned in the reference parameter
.Fa cnt .
This memory is owned by kvm and will be overwritten by subsequent calls to
-.Fn kvm_getfile2
+.Fn kvm_getfiles
and destroyed by
.Fn kvm_close .
Data should be copied out if it needs to be saved.
.Sh RETURN VALUES
.Fn kvm_getfiles
-and
-.Fn kvm_getfile2
will return
.Dv NULL
on failure.