VirtualBox

Changeset 25076 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Nov 28, 2009 10:55:30 PM (15 years ago)
Author:
vboxsync
Message:

RTFileQueryFsSizes: Moving it to a separate file so we can select platform specific implementations where it becomes necessary..

Location:
trunk/src/VBox/Runtime
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r25059 r25076  
    443443        r3/linux/time-linux.cpp \
    444444        r3/linux/RTProcIsRunningByName-linux.cpp \
     445        r3/posix/RTFileQueryFsSizes-posix.cpp \
    445446        r3/posix/RTSystemQueryOSInfo-posix.cpp \
    446447        r3/posix/alloc-posix.cpp \
     
    511512        r3/os2/thread-os2.cpp \
    512513        r3/os2/time-os2.cpp \
     514        r3/posix/RTFileQueryFsSizes-posix.cpp \
    513515        r3/posix/RTSystemQueryOSInfo-posix.cpp \
    514516        r3/posix/alloc-posix.cpp \
     
    548550        r3/darwin/sched-darwin.cpp \
    549551        r3/darwin/time-darwin.cpp \
     552        r3/posix/RTFileQueryFsSizes-posix.cpp \
    550553        r3/posix/RTSystemQueryOSInfo-posix.cpp \
    551554        r3/posix/dir-posix.cpp \
     
    592595        r3/freebsd/alloc-freebsd.cpp \
    593596        r3/freebsd/rtProcInitExePath-freebsd.cpp \
     597        r3/posix/RTFileQueryFsSizes-posix.cpp \
    594598        r3/posix/RTSystemQueryOSInfo-posix.cpp \
    595599        r3/posix/dir-posix.cpp \
     
    628632        generic/uuid-generic.cpp \
    629633        generic/RTProcIsRunningByName-generic.cpp \
     634        r3/posix/RTFileQueryFsSizes-posix.cpp \
    630635        r3/posix/RTSystemQueryOSInfo-posix.cpp \
    631636        r3/posix/dir-posix.cpp \
     
    692697        l4/timer-l4env.cpp \
    693698        l4/utf8-l4env.cpp \
     699        r3/posix/RTFileQueryFsSizes-posix.cpp \
    694700        r3/posix/alloc-posix.cpp \
    695701        r3/posix/dir-posix.cpp \
  • trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp

    r24889 r25076  
    4747# include <unistd.h>
    4848# include <sys/time.h>
    49 # include <sys/statvfs.h>
    5049#endif
    5150#ifdef RT_OS_LINUX
     
    719718
    720719
    721 RTR3DECL(int) RTFileQueryFsSizes(RTFILE hFile, PRTFOFF pcbTotal, RTFOFF *pcbFree,
    722                                  uint32_t *pcbBlock, uint32_t *pcbSector)
    723 {
    724     struct statvfs StatVFS;
    725     RT_ZERO(StatVFS);
    726     if (fstatvfs(hFile, &StatVFS))
    727         return RTErrConvertFromErrno(errno);
    728 
    729     /*
    730      * Calc the returned values.
    731      */
    732     if (pcbTotal)
    733         *pcbTotal = (RTFOFF)StatVFS.f_blocks * StatVFS.f_frsize;
    734     if (pcbFree)
    735         *pcbFree = (RTFOFF)StatVFS.f_bavail * StatVFS.f_frsize;
    736     if (pcbBlock)
    737         *pcbBlock = StatVFS.f_frsize;
    738     /* no idea how to get the sector... */
    739     if (pcbSector)
    740         *pcbSector = 512;
    741 
    742     return VINF_SUCCESS;
    743 }
    744 
    745 
    746 
    747720RTR3DECL(int) RTFileRename(const char *pszSrc, const char *pszDst, unsigned fRename)
    748721{
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