- Timestamp:
- Mar 6, 2010 5:01:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r26288 r27133 55 55 # include <windows.h> 56 56 # include <winioctl.h> 57 #elif defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) 57 #elif defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) \ 58 || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) 58 59 # include <errno.h> 59 60 # include <sys/ioctl.h> … … 77 78 # include <sys/vtoc.h> 78 79 #endif /* RT_OS_SOLARIS */ 80 #ifdef RT_OS_FREEBSD 81 # include <sys/disk.h> 82 #endif /* RT_OS_FREEBSD */ 79 83 80 84 using namespace com; … … 1084 1088 goto out; 1085 1089 } 1090 #elif defined(RT_OS_FREEBSD) 1091 struct stat DevStat; 1092 if (!fstat(RawFile, &DevStat) && S_ISCHR(DevStat.st_mode)) 1093 { 1094 off_t cbMedia = 0; 1095 if (!ioctl(RawFile, DIOCGMEDIASIZE, &cbMedia)) 1096 { 1097 cbSize = cbMedia; 1098 } 1099 else 1100 { 1101 vrc = RTErrConvertFromErrno(errno); 1102 RTPrintf("Cannot get the block count for file '%s': %Rrc", rawdisk.raw(), vrc); 1103 goto out; 1104 } 1105 } 1106 else 1107 { 1108 RTPrintf("File '%s' is no character device\n", rawdisk.raw()); 1109 vrc = VERR_INVALID_PARAMETER; 1110 goto out; 1111 } 1086 1112 #else /* all unrecognized OSes */ 1087 1113 /* Hopefully this works on all other hosts. If it doesn't, it'll just fail
Note:
See TracChangeset
for help on using the changeset viewer.