VirtualBox

Changeset 30281 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
Jun 17, 2010 10:25:10 AM (15 years ago)
Author:
vboxsync
Message:

Runtime: added Darwin support to RTFsQueryType

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/fs-posix.cpp

    r30254 r30281  
    3535#ifdef RT_OS_LINUX
    3636# include <mntent.h>
     37#endif
     38#ifdef RT_OS_DARWIN
     39# include <sys/mount.h>
    3740#endif
    3841
     
    228231            if (!strcmp("zfs", Stat.st_fstype))
    229232                *pu32Type = RTFS_FS_TYPE_ZFS;
     233#elif defined(RT_OS_DARWIN)
     234            struct statfs statfsBuf;
     235            if (!statfs(pszNativeFsPath, &statfsBuf))
     236            {
     237                if (!strcmp("hfs", statfsBuf.f_fstypename))
     238                    *pu32Type = RTFS_FS_TYPE_HFS;
     239                else if (   !strcmp("fat", statfsBuf.f_fstypename)
     240                         || !strcmp("msdos", statfsBuf.f_fstypename))
     241                    *pu32Type = RTFS_FS_TYPE_FAT;
     242                else if (!strcmp("ntfs", statfsBuf.f_fstypename))
     243                    *pu32Type = RTFS_FS_TYPE_NTFS;
     244                else if (!strcmp("autofs", statfsBuf.f_fstypename))
     245                    *pu32Type = RTFS_FS_TYPE_AUTOFS;
     246                else if (!strcmp("devfs", statfsBuf.f_fstypename))
     247                    *pu32Type = RTFS_FS_TYPE_DEVFS;
     248                else if (!strcmp("nfs", statfsBuf.f_fstypename))
     249                    *pu32Type = RTFS_FS_TYPE_NFS;
     250            }
    230251#endif
    231252        }
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