- while((lastvecindex + 1) < vecindex) {
- c = 0;
- error = copyout(&c, vec + lastvecindex, 1);
- if (error) {
- return (EFAULT);
- }
- ++lastvecindex;
+ lastvecindex = -1;
+ for( ; addr < cur_end; addr += PAGE_SIZE ) {
+
+ pqueryinfo = info[lastvecindex + 1].disposition;
+
+ mincoreinfo = 0;
+
+ if (pqueryinfo & VM_PAGE_QUERY_PAGE_PRESENT)
+ mincoreinfo |= MINCORE_INCORE;
+ if (pqueryinfo & VM_PAGE_QUERY_PAGE_REF)
+ mincoreinfo |= MINCORE_REFERENCED;
+ if (pqueryinfo & VM_PAGE_QUERY_PAGE_DIRTY)
+ mincoreinfo |= MINCORE_MODIFIED;
+ if (pqueryinfo & VM_PAGE_QUERY_PAGE_PAGED_OUT)
+ mincoreinfo |= MINCORE_PAGED_OUT;
+ if (pqueryinfo & VM_PAGE_QUERY_PAGE_COPIED)
+ mincoreinfo |= MINCORE_COPIED;
+ if ((pqueryinfo & VM_PAGE_QUERY_PAGE_EXTERNAL) == 0)
+ mincoreinfo |= MINCORE_ANONYMOUS;
+ /*
+ * calculate index into user supplied byte vector
+ */
+ vecindex = (addr - first_addr)>> PAGE_SHIFT;
+ kernel_vec[vecindex] = (char)mincoreinfo;
+ lastvecindex = vecindex;