xnu: use host_page_size instead of task_info with TASK_VM_INFO flag

This commit is contained in:
Álvaro Felipe Melchor 2016-02-13 21:09:02 +01:00
parent c24dbc3054
commit 073e08321a

View File

@ -251,16 +251,11 @@ static int tsk_getperm(RIO *io, task_t task, vm_address_t addr) {
static int tsk_pagesize(RIOMach *riom) {
//cache the pagesize
static ut64 pagesize = 0;
static vm_size_t pagesize = 0;
kern_return_t kr;
task_vm_info_data_t task_vm_info;
mach_msg_type_number_t count = TASK_VM_INFO_COUNT;
if (pagesize)
return pagesize;
kr = task_info (riom->task, TASK_VM_INFO, (task_info_t)&task_vm_info, &count);
kr = host_page_size (mach_host_self (), &pagesize);
if (kr != KERN_SUCCESS)
perror ("task_info");
pagesize = task_vm_info.page_size;
pagesize = 4096;
return pagesize;
}