xref: /original-bsd/lib/libkvm/kvm_getfiles.3 (revision 2932bec8)
1.\" Copyright (c) 1992 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)kvm_getfiles.3	5.1 (Berkeley) 04/27/92
7.\"
8.Dd
9.Dt KVM_GETFILES 3
10.Os
11.Sh NAME
12.Nm kvm_getfiles
13.Nd survey open files
14.Sh SYNOPSIS
15.Fd #include <kvm.h>
16.Fd #include <sys/kinfo.h>
17.Fd #define KERNEL
18.Fd #include <sys/file.h>
19.Fd #undef KERNEL
20.\" .Fa kvm_t *kd
21.br
22.Ft char *
23.Fn kvm_getfiles "kvm_t *kd" "int op" "int arg" "int *cnt"
24.Sh DESCRIPTION
25.Fn kvm_getfiles
26returns a (sub-)set of the open files in the kernel indicated by
27.Fa kd.
28The
29.Fa op
30and
31.Fa arg
32arguments constitute a predicate which limits the set of processes
33returned.  No predicates are currently defined.
34.Pp
35The number of processes found is returned in the reference parameter
36.Fa cnt .
37The files are returned as a contiguous array of file structures,
38preceeded by the address of the first file entry in the kernel.
39This memory is owned by kvm and is not guaranteed to be persistent across
40subsequent kvm library calls.  Data should be copied out if it needs to be
41saved.
42.Sh RETURN VALUES
43.Fn kvm_getfiles
44will return NULL on failure.
45.Pp
46.Sh BUGS
47This routine does not belong in the kvm interface.
48.Sh SEE ALSO
49.Xr kvm 3 ,
50.Xr kvm_open 3 ,
51.Xr kvm_openfiles 3 ,
52.Xr kvm_close 3 ,
53.Xr kvm_read 3 ,
54.Xr kvm_write 3 ,
55.Xr kvm_nlist 3 ,
56.Xr kvm_geterr 3
57