VirtualBox

Changeset 37577 in vbox


Ignore:
Timestamp:
Jun 21, 2011 1:01:00 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72419
Message:

IPRT/darwin-r0drv: Redid RTFileReadAt without using vn_rdwr which seemingly was added in 10.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/VBox/Runtime/r0drv/darwin/mach_kernel-r0drv-darwin.cpp

    r37575 r37577  
    307307    AssertReturn((RTFOFF)offNative == off, VERR_OUT_OF_RANGE);
    308308
    309 
     309#if 0 /* Added in 10.6, grr. */
    310310    errno_t rc;
    311311    if (!pcbRead)
     
    320320    }
    321321    return !rc ? VINF_SUCCESS : RTErrConvertFromErrno(rc);
     322
     323#else
     324    uio_t hUio = uio_create(1, offNative, UIO_SYSSPACE, UIO_READ);
     325    if (!hUio)
     326        return VERR_NO_MEMORY;
     327    errno_t rc;
     328    if (uio_addiov(hUio, (user_addr_t)(uintptr_t)pvBuf, cbToRead) == 0)
     329    {
     330        rc = VNOP_READ(pThis->hVnode, hUio, 0 /*ioflg*/, pThis->hVfsCtx);
     331        if (pcbRead)
     332            *pcbRead = cbToRead - uio_resid(hUio);
     333        else if (!rc && uio_resid(hUio))
     334            rc = VERR_FILE_IO_ERROR;
     335    }
     336    else
     337        rc = VERR_INTERNAL_ERROR_3;
     338    uio_free(hUio);
     339    return rc;
     340
     341#endif
    322342}
    323343
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette