KVM_VNODES(3) BSD Programmer's Manual KVM_VNODES(3)NAMEkvm_vnodes - return vnode table
SYNOPSIS
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/vnode.h>
#include <kvm.h>
#include <kvm_stat.h>
struct e_vnode *
kvm_vnodes(kvm_t *kd, int *avnodes);
DESCRIPTION
The kvm_vnodes() returns the entire vnode table of the kernel indicated
by kd. The returned data consists of an array whose size depends on the
current number of such objects in the system. Each element of the array
consists of a struct e_vnode structure which contains:
struct e_vnode {
struct vnode *avnode;
struct vnode vnode;
};
The avnode pointer contains the kernel address of this vnode structure
the and vnode structure contains the actual vnode. The struct vnode and
struct e_vnode structures are defined in /usr/include/sys/vnode.h. Memory
for these structures is obtained via malloc(3) and may be released via
free(3) if desired.
Note, the vnode table is not necessarily a consistent snapshot of the
system.
RETURN VALUESkvm_vnodes() will return NULL on failure. Upon failure kvm_geterr(3) can
be used to obtain a string describing the error.
SEE ALSOkvm(3), kvm_open(3), kvm_openfiles(3), kvm_close(3), kvm_read(3),
kvm_write(3), kvm_nlist(3), kvm_geterr(3)BSDI BSD/OS May 7, 1997 1