- if ((maxprot & VM_PROT_READ) == VM_PROT_READ) {
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)vmoffset, size, foffset,
- UIO_USERSPACE, IO_NODELOCKED|IO_UNIT, cred, (int *) 0, p);
+ if ((maxprot & VM_PROT_READ) == VM_PROT_READ
+ && vbr.user_tag != VM_MEMORY_IOKIT
+ && coredumpok(map,vmoffset)) {
+ vm_map_size_t tmp_vmsize = vmsize;
+ off_t xfer_foffset = foffset;
+
+ //LP64todo - works around vn_rdwr_64() 2G limit
+ while (tmp_vmsize > 0) {
+ vm_map_size_t xfer_vmsize = tmp_vmsize;
+ if (xfer_vmsize > INT_MAX)
+ xfer_vmsize = INT_MAX;
+ error = vn_rdwr_64(UIO_WRITE, vp,
+ vmoffset, xfer_vmsize, xfer_foffset,
+ (IS_64BIT_PROCESS(p) ? UIO_USERSPACE64 : UIO_USERSPACE32),
+ IO_NODELOCKED|IO_UNIT, cred, (int *) 0, p);
+ tmp_vmsize -= xfer_vmsize;
+ xfer_foffset += xfer_vmsize;
+ }