Lines Matching refs:hFile

354 RTR3DECL(int)  RTFileClose(RTFILE hFile)
356 if (hFile == NIL_RTFILE)
358 if (close(RTFileToNative(hFile)) == 0)
378 RTR3DECL(RTHCINTPTR) RTFileToNative(RTFILE hFile)
380 AssertReturn(hFile != NIL_RTFILE, -1);
381 return (intptr_t)hFile;
420 RTR3DECL(int) RTFileSeek(RTFILE hFile, int64_t offSeek, unsigned uMethod, uint64_t *poffActual)
447 off_t offCurrent = lseek(RTFileToNative(hFile), (off_t)offSeek, aSeekRecode[uMethod]);
458 RTR3DECL(int) RTFileRead(RTFILE hFile, void *pvBuf, size_t cbToRead, size_t *pcbRead)
466 ssize_t cbRead = read(RTFileToNative(hFile), pvBuf, cbToRead);
477 ssize_t cbReadPart = read(RTFileToNative(hFile), (char*)pvBuf + cbRead, cbToRead - cbRead);
494 RTR3DECL(int) RTFileWrite(RTFILE hFile, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten)
502 ssize_t cbWritten = write(RTFileToNative(hFile), pvBuf, cbToWrite);
513 ssize_t cbWrittenPart = write(RTFileToNative(hFile), (const char *)pvBuf + cbWritten, cbToWrite - cbWritten);
525 RTR3DECL(int) RTFileSetSize(RTFILE hFile, uint64_t cbSize)
538 if (chsize(RTFileToNative(hFile), (off_t)cbSize) == 0)
544 if (ftruncate(RTFileToNative(hFile), (off_t)cbSize) == 0)
551 RTR3DECL(int) RTFileGetSize(RTFILE hFile, uint64_t *pcbSize)
557 if (!fstat(RTFileToNative(hFile), &st))
577 if (!ioctl(RTFileToNative(hFile), DKIOCGETBLOCKCOUNT, &cBlocks))
580 if (!ioctl(RTFileToNative(hFile), DKIOCGETBLOCKSIZE, &cbBlock))
590 if (!ioctl(RTFileToNative(hFile), DKIOCGMEDIAINFO, &MediaInfo))
601 if (!ioctl(RTFileToNative(hFile), DIOCGMEDIASIZE, &cbMedia))
613 int rc = RTFileSeek(hFile, 0, RTFILE_SEEK_CURRENT, &offSaved);
616 rc = RTFileSeek(hFile, 0, RTFILE_SEEK_END, pcbSize);
617 int rc2 = RTFileSeek(hFile, offSaved, RTFILE_SEEK_BEGIN, NULL);
627 RTR3DECL(int) RTFileGetMaxSizeEx(RTFILE hFile, PRTFOFF pcbMax)
633 int rc = RTFileSeek(hFile, 0, RTFILE_SEEK_CURRENT, &offOld);
653 return RTFileSeek(hFile, offOld, RTFILE_SEEK_BEGIN, NULL);
656 rc = RTFileSeek(hFile, offLow + cbInterval, RTFILE_SEEK_BEGIN, NULL);
665 RTR3DECL(bool) RTFileIsValid(RTFILE hFile)
667 if (hFile != NIL_RTFILE)
669 int fFlags = fcntl(RTFileToNative(hFile), F_GETFD);
677 RTR3DECL(int) RTFileFlush(RTFILE hFile)
679 if (fsync(RTFileToNative(hFile)))
685 RTR3DECL(int) RTFileIoCtl(RTFILE hFile, unsigned long ulRequest, void *pvData, unsigned cbData, int *piRet)
688 int rc = ioctl(RTFileToNative(hFile), ulRequest, pvData);
695 RTR3DECL(int) RTFileSetMode(RTFILE hFile, RTFMODE fMode)
704 if (fchmod(RTFileToNative(hFile), fMode & RTFS_UNIX_MASK))
707 Log(("RTFileSetMode(%RTfile,%RTfmode): returns %Rrc\n", hFile, fMode, rc));
714 RTDECL(int) RTFileSetOwner(RTFILE hFile, uint32_t uid, uint32_t gid)
721 if (fchown(RTFileToNative(hFile), uidNative, gidNative))