161278Sbostic.\" Copyright (c) 1992, 1993 261278Sbostic.\" The Regents of the University of California. All rights reserved. 353277Ssklower.\" 453658Sbostic.\" This code is derived from software developed by the Computer Systems 553658Sbostic.\" Engineering group at Lawrence Berkeley Laboratory under DARPA contract 653658Sbostic.\" BG 91-66 and contributed to Berkeley. 753658Sbostic.\" 853277Ssklower.\" %sccs.include.redist.man% 953277Ssklower.\" 10*66948Sbostic.\" @(#)kvm_getfiles.3 8.2 (Berkeley) 04/19/94 1153277Ssklower.\" 1253277Ssklower.Dd 1353277Ssklower.Dt KVM_GETFILES 3 1453277Ssklower.Os 1553277Ssklower.Sh NAME 1653277Ssklower.Nm kvm_getfiles 1753277Ssklower.Nd survey open files 1853277Ssklower.Sh SYNOPSIS 1953277Ssklower.Fd #include <kvm.h> 2053277Ssklower.Fd #include <sys/kinfo.h> 2153277Ssklower.Fd #define KERNEL 2253277Ssklower.Fd #include <sys/file.h> 2353277Ssklower.Fd #undef KERNEL 2453277Ssklower.\" .Fa kvm_t *kd 2553277Ssklower.br 2653277Ssklower.Ft char * 2753277Ssklower.Fn kvm_getfiles "kvm_t *kd" "int op" "int arg" "int *cnt" 2853277Ssklower.Sh DESCRIPTION 2953277Ssklower.Fn kvm_getfiles 3053277Ssklowerreturns a (sub-)set of the open files in the kernel indicated by 3153277Ssklower.Fa kd. 3253277SsklowerThe 3353277Ssklower.Fa op 3453277Ssklowerand 3553277Ssklower.Fa arg 3653619Storekarguments constitute a predicate which limits the set of files 3753277Ssklowerreturned. No predicates are currently defined. 3853277Ssklower.Pp 3953277SsklowerThe number of processes found is returned in the reference parameter 4053277Ssklower.Fa cnt . 4153277SsklowerThe files are returned as a contiguous array of file structures, 42*66948Sbosticpreceded by the address of the first file entry in the kernel. 4353277SsklowerThis memory is owned by kvm and is not guaranteed to be persistent across 4453277Ssklowersubsequent kvm library calls. Data should be copied out if it needs to be 4553277Ssklowersaved. 4653277Ssklower.Sh RETURN VALUES 4753277Ssklower.Fn kvm_getfiles 4853277Ssklowerwill return NULL on failure. 4953277Ssklower.Pp 5053277Ssklower.Sh BUGS 5153277SsklowerThis routine does not belong in the kvm interface. 5253277Ssklower.Sh SEE ALSO 5353277Ssklower.Xr kvm 3 , 5453277Ssklower.Xr kvm_open 3 , 5553277Ssklower.Xr kvm_openfiles 3 , 5653277Ssklower.Xr kvm_close 3 , 5753277Ssklower.Xr kvm_read 3 , 5853277Ssklower.Xr kvm_write 3 , 5953277Ssklower.Xr kvm_nlist 3 , 6053277Ssklower.Xr kvm_geterr 3 61