VirtualBox

Changeset 77632 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Mar 10, 2019 1:33:52 PM (6 years ago)
Author:
vboxsync
Message:

IPRT: Adding RTFileSgRead and RTFileSgWrite (for FsPerf). bugref:9172

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/file.h

    r77236 r77632  
    370370 * @param   pvBuf       Where to put the bytes we read.
    371371 * @param   cbToRead    How much to read.
    372  * @param   *pcbRead    How much we actually read .
     372 * @param   pcbRead     How much we actually read .
    373373 *                      If NULL an error will be returned for a partial read.
    374374 */
     
    383383 * @param   pvBuf       Where to put the bytes we read.
    384384 * @param   cbToRead    How much to read.
    385  * @param   *pcbRead    How much we actually read .
     385 * @param   pcbRead     How much we actually read .
    386386 *                      If NULL an error will be returned for a partial read.
     387 *
     388 * @note    OS/2 requires separate seek and write calls.
     389 *
    387390 * @note    Whether the file position is modified or not is host specific.
    388391 */
    389392RTDECL(int)  RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, size_t cbToRead, size_t *pcbRead);
     393
     394/**
     395 * Read bytes from a file at a given offset into a S/G buffer.
     396 *
     397 * @returns iprt status code.
     398 * @param   hFile       Handle to the file.
     399 * @param   pSgBuf      Pointer to the S/G buffer to read into.
     400 * @param   cbToRead    How much to read.
     401 * @param   pcbRead     How much we actually read .
     402 *                      If NULL an error will be returned for a partial read.
     403 *
     404 * @note    It is not possible to guarantee atomicity on all platforms, so
     405 *          caller must take care wrt concurrent access to @a hFile.
     406 */
     407RTDECL(int)  RTFileSgRead(RTFILE hFile, PRTSGBUF pSgBuf, size_t cbToRead, size_t *pcbRead);
    390408
    391409/**
     
    397415 * @param   pSgBuf      Pointer to the S/G buffer to read into.
    398416 * @param   cbToRead    How much to read.
    399  * @param   *pcbRead    How much we actually read .
     417 * @param   pcbRead     How much we actually read .
    400418 *                      If NULL an error will be returned for a partial read.
     419 *
    401420 * @note    Whether the file position is modified or not is host specific.
     421 *
     422 * @note    It is not possible to guarantee atomicity on all platforms, so
     423 *          caller must take care wrt concurrent access to @a hFile.
    402424 */
    403425RTDECL(int)  RTFileSgReadAt(RTFILE hFile, RTFOFF off, PRTSGBUF pSgBuf, size_t cbToRead, size_t *pcbRead);
     
    410432 * @param   pvBuf       What to write.
    411433 * @param   cbToWrite   How much to write.
    412  * @param   *pcbWritten How much we actually wrote.
     434 * @param   pcbWritten How much we actually wrote.
    413435 *                      If NULL an error will be returned for a partial write.
    414436 */
     
    423445 * @param   pvBuf       What to write.
    424446 * @param   cbToWrite   How much to write.
    425  * @param   *pcbWritten How much we actually wrote.
     447 * @param   pcbWritten How much we actually wrote.
    426448 *                      If NULL an error will be returned for a partial write.
    427449 *
     450 * @note    OS/2 requires separate seek and write calls.
     451 *
    428452 * @note    Whether the file position is modified or not is host specific.
     453 *
    429454 * @note    Whether @a off is used when @a hFile was opened with RTFILE_O_APPEND
    430455 *          is also host specific.  Currently Linux is the the only one
     
    432457 */
    433458RTDECL(int)  RTFileWriteAt(RTFILE hFile, RTFOFF off, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
     459
     460/**
     461 * Write bytes from a S/G buffer to a file.
     462 *
     463 * @returns iprt status code.
     464 * @param   hFile       Handle to the file.
     465 * @param   pSgBuf      What to write.
     466 * @param   cbToWrite   How much to write.
     467 * @param   pcbWritten  How much we actually wrote.
     468 *                      If NULL an error will be returned for a partial write.
     469 *
     470 * @note    It is not possible to guarantee atomicity on all platforms, so
     471 *          caller must take care wrt concurrent access to @a hFile.
     472 */
     473RTDECL(int)  RTFileSgWrite(RTFILE hFile, PRTSGBUF pSgBuf, size_t cbToWrite, size_t *pcbWritten);
    434474
    435475/**
     
    441481 * @param   pSgBuf      What to write.
    442482 * @param   cbToWrite   How much to write.
    443  * @param   *pcbWritten How much we actually wrote.
     483 * @param   pcbWritten How much we actually wrote.
    444484 *                      If NULL an error will be returned for a partial write.
    445485 *
     486 * @note    It is not possible to guarantee atomicity on all platforms, so
     487 *          caller must take care wrt concurrent access to @a hFile.
     488 *
    446489 * @note    Whether the file position is modified or not is host specific.
     490 *
    447491 * @note    Whether @a off is used when @a hFile was opened with RTFILE_O_APPEND
    448492 *          is also host specific.  Currently Linux is the the only one
  • trunk/include/iprt/mangling.h

    r77549 r77632  
    956956# define RTFileSetSize                                  RT_MANGLER(RTFileSetSize)
    957957# define RTFileSetTimes                                 RT_MANGLER(RTFileSetTimes)
     958# define RTFileSgRead                                   RT_MANGLER(RTFileSgRead)
    958959# define RTFileSgReadAt                                 RT_MANGLER(RTFileSgReadAt)
     960# define RTFileSgWrite                                  RT_MANGLER(RTFileSgWrite)
    959961# define RTFileSgWriteAt                                RT_MANGLER(RTFileSgWriteAt)
    960962# define RTFileTell                                     RT_MANGLER(RTFileTell)
Note: See TracChangeset for help on using the changeset viewer.

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