diff options
author | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2014-12-05 04:12:49 +0000 |
---|---|---|
committer | Masao Uebayashi <uebayasi@cvs.openbsd.org> | 2014-12-05 04:12:49 +0000 |
commit | c8525d7f58e30cc7e582a014d2ed096379ccbe9e (patch) | |
tree | ec1d9e9fd25511db56d8684473978444d773b6fb /sys/uvm/uvm_extern.h | |
parent | 70eb0676761b32588c52742bb357451ea0d0c95d (diff) |
Introduce a new sysctl to retrieve VM map entries
This adds a new sysctl KERN_PROC_VMMAP, which returns an array of VM map
entries of a specified process. This prevents debuggers from iterating
vm_map_entry RB tree via kvm(3).
The name KERN_PROC_VMMAP and struct kinfo_vmentry are chosen from the same
function in FreeBSD. struct kinfo_vmentry is revised to reduce size, because
OpenBSD does not keep track of filepaths. The semantic is also changed to
return max buffer size as a hint, and start iteration at the specified base
address.
Much valuable input from deraadt@, guenther@, tedu@
OK tedu@ deraadt@
Diffstat (limited to 'sys/uvm/uvm_extern.h')
-rw-r--r-- | sys/uvm/uvm_extern.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/uvm/uvm_extern.h b/sys/uvm/uvm_extern.h index 3727296d325..8656b4cdad4 100644 --- a/sys/uvm/uvm_extern.h +++ b/sys/uvm/uvm_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_extern.h,v 1.124 2014/11/21 06:40:40 deraadt Exp $ */ +/* $OpenBSD: uvm_extern.h,v 1.125 2014/12/05 04:12:48 uebayasi Exp $ */ /* $NetBSD: uvm_extern.h,v 1.57 2001/03/09 01:02:12 chs Exp $ */ /* @@ -477,6 +477,11 @@ void kmeminit_nkmempages(void); void kmeminit(void); extern u_int nkmempages; +struct process; +struct kinfo_vmentry; +int fill_vmmap(struct process *, struct kinfo_vmentry *, + size_t *); + #endif /* _KERNEL */ #endif /* _UVM_UVM_EXTERN_H_ */ |