survey open files
struct kinfo_file *
*kd, int op,
returns a (sub-)set of the open files in the kernel indicated by
kd. The op and
arg arguments constitute a predicate which limits the
set of files returned. The value of op describes the
filtering predicate as follows:
Files associated with a process will include information about the process that has the file open.
KERN_FILE_BYFILE the recognized file
types are defined in
Only the first elemsize
bytes of each array entry are returned. If the size of the
kinfo_file structure increases in size in a future
release of OpenBSD, the kernel will only return the
requested amount of data for each array entry and programs that use
will continue to function without the need for recompilation.
The files are returned as a contiguous array of
kinfo_file structures. The number of structures found
is returned in the reference parameter cnt. This
memory is owned by kvm and will be overwritten by subsequent calls to
kvm_getfiles() and destroyed by
kvm_close(). Data should be copied out if it needs
to be saved.
kvm_getfiles() will return
NULL on failure.
kvm_getfiles() will fail if:
- Could not allocate enough memory for internal buffer.
- The op argument has
KERN_FILE_BYPIDvalue and the process specified by arg was not found.
kvm(3), kvm_geterr(3), kvm_nlist(3), kvm_open(3), kvm_read(3)
This routine does not belong in the kvm interface.