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